arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2311.09096cs.CL
收藏

通过目标优先级防御大型语言模型免受越狱攻击

Defending Large Language Models Against Jailbreaking Attacks Through Goal Prioritization

Tsinghua University(清华大学)

Zhexin Zhang, Junxiao Yang, Pei Ke, Fei Mi, Hongning Wang, Minlie Huang

AI总结:

针对LLM有用性与安全性目标冲突导致的越狱风险,本文提出在训练和推理阶段引入目标优先级,显著降低ChatGPT与Llama2-13B的攻击成功率。

摘要:

尽管大量注意力已集中于通过越狱攻击利用LLM的弱点,但在防御这些攻击方面仍缺乏足够努力。我们指出促成越狱成功的一个关键因素:有用性目标与安全性目标之间的内在冲突。因此,我们建议在训练和推理两个阶段整合目标优先级以进行反制。在推理期间实施目标优先级,可将ChatGPT的越狱攻击成功率(ASR)从66.4%大幅降至3.6%。而将目标优先级整合到模型训练中,可将Llama2-13B的ASR从71.0%降至6.6%。值得注意的是,即使在训练期间不包含任何越狱样本的场景下,我们的方法也能将ASR削减一半。此外,我们的发现表明,虽然更强的LLM面临更大的安全风险,但它们也具备更强的被引导以防御此类攻击的能力,这两者都源于其更强的指令遵循能力。因此,我们的工作有助于理解越狱攻击与防御,并阐明LLM能力与安全性之间的关系。我们的代码可在https://github.com/thu-coai/JailbreakDefense_GoalPriority获取。

英文摘要:

While significant attention has been dedicated to exploiting weaknesses in LLMs through jailbreaking attacks, there remains a paucity of effort in defending against these attacks. We point out a pivotal factor contributing to the success of jailbreaks: the intrinsic conflict between the goals of being helpful and ensuring safety. Accordingly, we propose to integrate goal prioritization at both training and inference stages to counteract. Implementing goal prioritization during inference substantially diminishes the Attack Success Rate (ASR) of jailbreaking from 66.4% to 3.6% for ChatGPT. And integrating goal prioritization into model training reduces the ASR from 71.0% to 6.6% for Llama2-13B. Remarkably, even in scenarios where no jailbreaking samples are included during training, our approach slashes the ASR by half. Additionally, our findings reveal that while stronger LLMs face greater safety risks, they also possess a greater capacity to be steered towards defending against such attacks, both because of their stronger ability in instruction following. Our work thus contributes to the comprehension of jailbreaking attacks and defenses, and sheds light on the relationship between LLMs' capability and safety. Our code is available at \url{https://github.com/thu-coai/JailbreakDefense_GoalPriority}.

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

↑