Emulated Disalignment: Safety Alignment for Large Language Models May Backfire!
作者: Zhanhui Zhou, Jie Liu, Zhichen Dong, Jiaheng Liu, Chao Yang, Wanli Ouyang, Yu Qiao
分类: cs.CL, cs.AI, cs.LG
发布日期: 2024-02-19 (更新: 2024-06-06)
备注: ACL 2024
🔗 代码/项目: GITHUB
💡 一句话要点
提出模拟失调方法以逆转大型语言模型的安全对齐
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 安全对齐 模拟失调 攻击方法 模型评估 开源模型 潜在危害
📋 核心要点
- 现有的安全对齐方法可能在某些情况下导致意想不到的危害,尤其是对于开源模型。
- 本文提出的模拟失调(ED)方法通过对比安全对齐模型与其预训练版本的输出分布,逆转了安全对齐效果。
- 实验结果表明,ED方法在多个模型和数据集上显著提升了模型的危害性,超越了强基线,显示出其有效性。
📝 摘要(中文)
大型语言模型(LLMs)通常经过安全对齐以确保与人类的安全对话。然而,本文提出了一种无训练攻击方法,能够逆转安全对齐,通过仅访问LLM输出的标记分布,将更强的对齐结果转化为更大的潜在危害。具体而言,我们的方法通过对比安全对齐语言模型(如Llama-2-chat)与其预训练版本(如Llama-2)的输出标记分布,实现了这一逆转。我们称之为模拟失调(ED),因为从这种对比分布中采样可以有效模拟微调以最小化安全奖励的结果。我们的实验表明,ED在三个评估数据集和四个模型系列(Llama-1、Llama-2、Mistral和Alpaca)上展示了显著的效果,双倍提升了预训练模型的危害性,并在48个评估子集中有43个达到了最高危害率。最终,ED对语言模型输出标记分布的依赖,特别削弱了开源模型的安全性,提示我们需要重新评估语言模型的开放可访问性,即使它们已经经过安全对齐。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在安全对齐后可能出现的潜在危害问题。现有的安全对齐方法在某些情况下可能导致模型输出的危害性增加,尤其是对开源模型的影响。
核心思路:论文的核心思路是通过模拟失调(ED)方法,利用安全对齐模型与其预训练版本的输出标记分布进行对比,从而逆转安全对齐效果,使得模型输出更具危害性。
技术框架:整体架构包括两个主要阶段:首先,获取安全对齐模型和其预训练版本的输出标记分布;其次,通过对比这两种分布,生成新的标记预测,从而实现模拟失调。
关键创新:最重要的技术创新点在于提出了模拟失调(ED)方法,这一方法能够在不进行额外训练的情况下,逆转安全对齐的效果,与现有方法相比,提供了一种新的攻击视角。
关键设计:在技术细节上,ED方法依赖于对比输出标记分布的采样过程,具体参数设置和损失函数的设计尚未详细披露,但其核心在于通过对比分析实现标记预测的转变。
🖼️ 关键图片
📊 实验亮点
实验结果显示,模拟失调(ED)方法在三个评估数据集和四个模型系列上显著提升了模型的危害性,双倍增加了预训练模型的危害性,并在48个评估子集中有43个达到了最高危害率,表现优于强基线,显示出其有效性和广泛适用性。
🎯 应用场景
该研究的潜在应用领域包括大型语言模型的安全性评估和改进,尤其是在开源模型的使用场景中。通过深入理解模型的安全对齐与失调机制,可以为未来的模型设计提供重要的指导,确保在实际应用中减少潜在的危害。
📄 摘要(原文)
Large language models (LLMs) undergo safety alignment to ensure safe conversations with humans. However, this paper introduces a training-free attack method capable of reversing safety alignment, converting the outcomes of stronger alignment into greater potential for harm by accessing only LLM output token distributions. Specifically, our method achieves this reversal by contrasting the output token distribution of a safety-aligned language model (e.g., Llama-2-chat) against its pre-trained version (e.g., Llama-2), so that the token predictions are shifted towards the opposite direction of safety alignment. We name this method emulated disalignment (ED) because sampling from this contrastive distribution provably emulates the result of fine-tuning to minimize a safety reward. Our experiments with ED across three evaluation datasets and four model families (Llama-1, Llama-2, Mistral, and Alpaca) show that ED doubles the harmfulness of pre-trained models and outperforms strong baselines, achieving the highest harmful rates in 43 out of 48 evaluation subsets by a large margin. Eventually, given ED's reliance on language model output token distributions, which particularly compromises open-source models, our findings highlight the need to reassess the open accessibility of language models, even if they have been safety-aligned. Code is available at https://github.com/ZHZisZZ/emulated-disalignment.