SafeEvo: Deciphering the Safety Alignment Mechanism and Evolution in Language Models
作者: Miao Yu, Hao Huang, Lu Yuan, Yunpeng Li, Kun Wang, Zuming Jiang
分类: cs.AI
发布日期: 2026-10-07
💡 一句话要点
提出SafeEvo框架以解析语言模型的安全对齐机制
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 安全对齐 大型语言模型 可解释性 拒绝电路 优化算法 自然语言处理 对抗性输入
📋 核心要点
- 现有研究主要关注对齐后的安全表示,忽视了预训练模型中的安全机制及其演变。
- SafeEvo框架从电路角度出发,识别和分析拒绝电路的演变,提出安全电路对齐(SCA)以优化安全更新。
- 实验结果表明,SCA在对齐强度、拒绝率和模型效用方面均显著优于传统方法。
📝 摘要(中文)
安全可解释性推动了对大型语言模型(LLM)对齐研究的深入,超越了仅依赖数据或算法的行为约束。然而,现有研究主要集中在对齐后的安全相关表示、注意力头或神经元上,忽视了预训练模型中的安全机制及其在对齐检查点间的演变。为此,本文提出了SafeEvo,一个从电路(LLM的稀疏子图)角度出发的可解释性框架。SafeEvo首先应用基于优化的提取算法,识别出在预训练基础LLM中独立表达拒绝行为的弱拒绝电路。对这些电路的因果消融完全消除了基础模型对有害输入的拒绝。SafeEvo还追踪拒绝电路在连续对齐检查点间的演变,发现其结构逐步变化,表明对齐成本可能源于拒绝电路更新对效用相关参数的影响。通过引入安全电路对齐(SCA),SafeEvo将安全更新限制在拒绝电路内。实验表明,SCA在三个方面优于传统对齐:更强的对齐,降低有害性评分63.21%;减少过度拒绝,良性查询的拒绝率降低58.44%;更好的效用,保留99.58%的原始模型能力。
🔬 方法详解
问题定义:本文旨在解决现有大型语言模型在安全对齐方面的不足,特别是对预训练模型中安全机制的忽视。现有方法未能有效解析拒绝行为的内在机制,导致对齐效果不佳。
核心思路:SafeEvo框架通过电路视角分析拒绝电路,识别出能够独立表达拒绝行为的电路,并追踪其在对齐过程中的演变。通过限制安全更新在拒绝电路内,提升对齐效果。
技术框架:SafeEvo的整体架构包括电路提取、拒绝电路分析和安全电路对齐三个主要模块。首先,通过优化算法提取弱拒绝电路;其次,分析这些电路在不同对齐检查点的演变;最后,实施SCA以优化安全更新。
关键创新:SafeEvo的核心创新在于从电路角度出发,首次系统性地分析了拒绝电路的演变及其对对齐效果的影响,提出的SCA方法显著提升了安全对齐的效果。
关键设计:在实验中,采用了优化算法提取拒绝电路,并通过因果消融验证其对拒绝行为的影响。SCA方法的设计限制了安全更新的范围,确保了模型效用的保留。
🖼️ 关键图片
📊 实验亮点
实验结果显示,SCA方法在三个大型语言模型和两种对齐算法上表现优异,平均降低有害性评分63.21%,良性查询的拒绝率减少58.44%,并保留99.58%的原始模型能力,显著提升了模型的安全性和效用。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理中的安全性提升、对抗性输入的防护以及大型语言模型的安全对齐。通过优化拒绝机制,SafeEvo能够在实际应用中提高模型的安全性和可靠性,具有重要的实际价值和未来影响。
📄 摘要(原文)
Safety interpretability advances the study of Large Language Model (LLM) alignment from behavioral constraints driven by data or algorithms towards a deeper understanding of internal mechanisms. However, existing works have focused primarily on safety-related representations, attention heads, or neurons after alignment, while largely overlooking the safety mechanisms in pretrained-only models and their evolution across alignment checkpoints. To address this, we propose SafeEvo, an interpretability framework from the circuit (sparse subgraphs of an LLM) perspective. SafeEvo first applies an optimization-based extraction algorithm to identify weak refusal circuits in pretrained base LLMs that can independently express refusal behavior. Causally ablating these circuits completely eliminates the base model's refusal of harmful inputs. SafeEvo then traces the evolution of refusal circuits across successive alignment checkpoints and finds that their structures change progressively, suggesting that the alignment tax may result from refusal-circuit updates affecting utility-related parameters. To validate this, SafeEvo introduces Safety Circuit Alignment (SCA), which confines safety updates to the refusal circuits. Experiments across three LLMs and two alignment algorithms show that, on average, SCA outperforms vanilla alignment in three aspects: \textbf{(1) stronger alignment}, lowering harmfulness score by 63.21\%; \textbf{(2) less over-refusal}, yielding a 58.44\% decrease in refusal rates for benign queries; and \textbf{(3) better utility}, retaining 99.58\% of the original model capabilities.