arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2402.08983cs.CRcs.AIcs.CL
收藏

SafeDecoding:通过安全感知解码防御越狱攻击

SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decoding

University of Washington(华盛顿大学);The Pennsylvania State University(宾夕法尼亚州立大学);Allen Institute for AI(艾伦人工智能研究所)

Zhangchen Xu, Fengqing Jiang, Luyao Niu, Jinyuan Jia, Bill Yuchen Lin, Radha Poovendran

AI总结:

本文提出SafeDecoding,一种安全感知解码策略,通过放大安全免责声明的token概率并削弱有害token序列的概率,有效防御LLM越狱攻击,在不损害响应有用性的前提下显著降低攻击成功率。

摘要:

随着大型语言模型(LLMs)日益融入代码生成和聊天机器人助手等实际应用,人们已做出大量努力使LLM的行为与人类价值观(包括安全性)保持一致。越狱攻击旨在引发LLM产生意外且不安全的行为,仍然是LLM面临的重大/首要安全威胁。在本文中,我们旨在通过引入SafeDecoding(一种安全感知解码策略)来防御越狱攻击,使LLM能够对用户查询生成有用且无害的响应。我们开发SafeDecoding的见解基于这样一个观察:尽管代表有害内容的token概率超过代表无害响应的token概率,但在按概率降序对token进行排序后,安全免责声明仍然出现在排名靠前的token中。这使得我们能够通过识别安全免责声明并放大其token概率,同时削弱与越狱攻击目标一致的token序列的概率,来缓解越狱攻击。我们在五个LLM上使用六种最先进的越狱攻击和四个基准数据集进行了广泛实验。结果表明,SafeDecoding显著降低了越狱攻击的攻击成功率和危害性,同时没有损害对良性用户查询响应的有用性。SafeDecoding优于六种防御方法。

英文摘要:

As large language models (LLMs) become increasingly integrated into real-world applications such as code generation and chatbot assistance, extensive efforts have been made to align LLM behavior with human values, including safety. Jailbreak attacks, aiming to provoke unintended and unsafe behaviors from LLMs, remain a significant/leading LLM safety threat. In this paper, we aim to defend LLMs against jailbreak attacks by introducing SafeDecoding, a safety-aware decoding strategy for LLMs to generate helpful and harmless responses to user queries. Our insight in developing SafeDecoding is based on the observation that, even though probabilities of tokens representing harmful contents outweigh those representing harmless responses, safety disclaimers still appear among the top tokens after sorting tokens by probability in descending order. This allows us to mitigate jailbreak attacks by identifying safety disclaimers and amplifying their token probabilities, while simultaneously attenuating the probabilities of token sequences that are aligned with the objectives of jailbreak attacks. We perform extensive experiments on five LLMs using six state-of-the-art jailbreak attacks and four benchmark datasets. Our results show that SafeDecoding significantly reduces the attack success rate and harmfulness of jailbreak attacks without compromising the helpfulness of responses to benign user queries. SafeDecoding outperforms six defense methods.

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

↑