层级自暴露与补丁:针对越狱攻击防御的肯定性token缓解方法
Layer-Level Self-Exposure and Patch: Affirmative Token Mitigation for Jailbreak Attack Defense
AI总结:
针对LLMs面临的越狱攻击问题,提出Layer-AdvPatcher方法,通过识别易生成肯定性token的层并利用自增强数据集进行遗忘修补,有效降低攻击危害性和成功率且不影响良性查询效用。
摘要:
随着大型语言模型(LLMs)在聊天机器人助手和代码生成等多种应用中日益普及,使其行为符合安全和伦理标准变得至关重要。然而,利用漏洞诱导非预期或有害输出的越狱攻击,对LLMs的安全性构成了重大威胁。本文提出Layer-AdvPatcher,一种通过自增强数据集利用遗忘策略修补LLMs内特定层的新型防御方法。我们的见解是,某些层在面对有害提示时倾向于生成肯定性token。通过识别这些层并对抗性地暴露它们以生成更多有害数据,我们可以了解其固有的多样化攻击漏洞。基于这些暴露,我们“遗忘”这些问题,减少肯定性token的影响,从而在保持模型对安全查询响应不变的情况下最小化越狱风险。我们在两个模型、四个基准数据集和多种最先进的越狱攻击上进行了广泛实验,以证明方法的有效性。结果表明,与近期防御方法相比,我们的框架在不损害良性查询效用的情况下降低了越狱攻击的危害性和成功率。代码公开于:https://github.com/oyy2000/LayerAdvPatcher
英文摘要:
As large language models (LLMs) are increasingly deployed in diverse applications, including chatbot assistants and code generation, aligning their behavior with safety and ethical standards has become paramount. However, jailbreak attacks, which exploit vulnerabilities to elicit unintended or harmful outputs, threaten LLMs' safety significantly. In this paper, we introduce Layer-AdvPatcher, a novel methodology designed to defend against jailbreak attacks by utilizing an unlearning strategy to patch specific layers within LLMs through self-augmented datasets. Our insight is that certain layer(s), tend to produce affirmative tokens when faced with harmful prompts. By identifying these layers and adversarially exposing them to generate more harmful data, one can understand their inherent and diverse vulnerabilities to attacks. With these exposures, we then "unlearn" these issues, reducing the impact of affirmative tokens and hence minimizing jailbreak risks while keeping the model's responses to safe queries intact. We conduct extensive experiments on two models, four benchmark datasets, and multiple state-of-the-art jailbreak attacks to demonstrate the efficacy of our approach. Results indicate that our framework reduces the harmfulness and attack success rate of jailbreak attacks without compromising utility for benign queries compared to recent defense methods. Our code is publicly available at: https://github.com/oyy2000/LayerAdvPatcher
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。