对齐增强解码:通过对概率分布的Token级自适应精炼进行防御
Alignment-Enhanced Decoding:Defending via Token-Level Adaptive Refining of Probability Distributions
AI总结:
本文提出对齐增强解码(AED)防御方法,通过定义竞争指数量化对齐失败并利用自我评估反馈自适应结合logits,在保持有用性的同时增强安全对齐,有效抵御越狱攻击。
摘要:
大型语言模型容易受到越狱攻击,这可能导致生成有害内容。虽然先前的防御措施通过对输入进行扰动或检查来减轻这些风险,但它们忽略了竞争目标这一对齐失败的潜在原因。在本文中,我们提出了Alignment-Enhanced Decoding (AED)(对齐增强解码),这是一种利用自适应解码来解决越狱问题根本原因的新型防御方法。我们首先定义了Competitive Index(竞争指数)来量化对齐失败,并利用自我评估的反馈来计算对齐后的logits。然后,AED将AED和对齐后的logits与原始logits自适应结合,以获得无害且有用的分布。因此,我们的方法在保持有用性的同时增强了安全对齐。我们在五个模型和四种常见越狱攻击上进行了实验,结果验证了我们方法的有效性。代码可在 https://github.com/GIGABaozi/AED.git 获取。
英文摘要:
Large language models are susceptible to jailbreak attacks, which can result in the generation of harmful content. While prior defenses mitigate these risks by perturbing or inspecting inputs, they ignore competing objectives, the underlying cause of alignment failures. In this paper, we propose Alignment-Enhanced Decoding (AED), a novel defense that employs adaptive decoding to address the root causes of jailbreak issues. We first define the Competitive Index to quantify alignment failures and utilize feedback from self-evaluation to compute post-alignment logits. Then, AED adaptively combines AED and post-alignment logits with the original logits to obtain harmless and helpful distributions. Consequently, our method enhances safety alignment while maintaining helpfulness. We conduct experiments across five models and four common jailbreaks, with the results validating the effectiveness of our approach. Code is available at https://github.com/GIGABaozi/AED.git.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。