arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.06255cs.LGcs.AIcs.CLcs.CR

通过提示对抗性调优反击越狱攻击

Fight Back Against Jailbreaking via Prompt Adversarial Tuning

Peking University(北京大学);Shanghai Jiao Tong University(上海交通大学)

Yichuan Mo, Yuji Wang, Zeming Wei, Yisen Wang

AI总结:

针对大语言模型易受越狱攻击、现有防御多依赖微调或启发式设计的问题,提出提示对抗性调优方法PAT,通过训练用户提示的防护前缀实现防御,可将高级攻击成功率降至近0%且开销极低。

摘要:

尽管大语言模型(LLMs)已在各类应用中取得巨大成功,但它们也容易受到越狱攻击。目前已有多种主流防御策略被提出,用于防止LLMs生成有害信息,这些策略大多聚焦于模型微调或启发式防御设计。然而,如何通过提示优化实现内在鲁棒性仍是一个开放性问题。本文受用于实现可靠鲁棒性的对抗训练范式启发,提出了名为Prompt Adversarial Tuning(PAT,提示对抗性调优)的方法,该方法训练一个附加在用户提示后的提示控制模块作为防护前缀。为了在维持自然性能的同时达成防御目标,我们同时使用对抗提示和良性提示来优化控制提示。综合实验表明,我们的方法对灰盒攻击和黑盒攻击均有效,可将高级攻击的成功率降至接近0%,同时保持模型在良性任务上的效用,且仅产生可忽略的计算开销,为未来LLM安全领域的探索开辟了新视角。我们的代码可在https://github.com/PKU-ML/PAT获取。

英文摘要:

While Large Language Models (LLMs) have achieved tremendous success in various applications, they are also susceptible to jailbreaking attacks. Several primary defense strategies have been proposed to protect LLMs from producing harmful information, mostly focusing on model fine-tuning or heuristical defense designs. However, how to achieve intrinsic robustness through prompt optimization remains an open problem. In this paper, motivated by adversarial training paradigms for achieving reliable robustness, we propose an approach named Prompt Adversarial Tuning (PAT) that trains a prompt control attached to the user prompt as a guard prefix. To achieve our defense goal whilst maintaining natural performance, we optimize the control prompt with both adversarial and benign prompts. Comprehensive experiments show that our method is effective against both grey-box and black-box attacks, reducing the success rate of advanced attacks to nearly 0%, while maintaining the model's utility on the benign task and incurring only negligible computational overhead, charting a new perspective for future explorations in LLM security. Our code is available at https://github.com/PKU-ML/PAT.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑