跳转至

从检测到拒绝:通过电路引导的权重缩放构建更安全的大语言模型

文章背景与核心概要

尽管经过了广泛的对齐训练,大语言模型(LLM)在面对对抗性攻击时,仍然容易生成不安全的内容。本文从机械可解释性的视角深入研究了LLM的安全性,揭示了一个决定拒绝行为的多阶段“安全电路”。基于这种内部解构,作者提出了一种电路引导的权重缩放方法,该方法在显著提升模型抵御对抗提示词安全性的同时,依然保持了良好的通用任务性能。

这项研究深入剖析了模型内部安全机制的组织架构,通过对注意力头和神经元层面的定向干预,证明了有害检测、安全信号中继以及拒绝响应生成之间的因果链条。实验表明,这种电路结构在多种模型架构和攻击设置下具有高度的一致性,为未来构建更具鲁棒性、且性能损失极小的大语言模型开辟了新途径。


📌 摘要与总结

Despite extensive alignment efforts, Large Language Models (LLMs) remain vulnerable to generating unsafe content under adversarial attacks. This paper investigates LLM safety through the lens of mechanistic interpretability, uncovering a multi-stage safety circuit that dictates refusal behavior. Building upon this internal decomposition, the authors propose a circuit-guided weight-scaling method that significantly boosts model safety under adversarial prompts while preserving general task performance.

尽管经过广泛的对齐努力,大语言模型(LLM)在对抗攻击下仍然容易生成不安全的内容。本文通过机械可解释性的视角研究了LLM的安全性,揭示了一个决定拒绝行为的多阶段安全电路(safety circuit)。基于这种内部解构,作者提出了一种电路引导的权重缩放方法,该方法在保持通用任务性能的同时,显著提升了模型在对抗提示词下的安全性。


🔍 核心发现与摘要

LLM安全性的内部架构被组织为一个包含三个关键组件的多阶段安全电路

The internal architecture of LLM safety is organized into a multi-stage safety circuit comprising three key components:

  1. 有害检测头(Harmful Detection Heads): 专门响应有害输入的注意力头。
  2. 安全神经元(Safety Neurons): 在残差流中介导和稳定安全信号的神经元。
  3. 拒绝头(Refusal Heads): 负责将这些信号转化为安全拒绝响应的注意力头。
  1. Harmful Detection Heads: Attention heads that specifically respond to harmful inputs.
  2. Safety Neurons: Neurons that mediate and stabilize safety signals within the residual stream.
  3. Refusal Heads: Attention heads responsible for translating these signals into a safe refusal response.

通过对注意力头和神经元层面进行定向干预,该研究展示了支持这种电路组织形式的因果证据。具体而言,抑制上游的有害检测头会破坏下游的拒绝行为,这一过程由安全神经元进行介导。

Through targeted interventions at the attention-head and neuron levels, the study demonstrates causal evidence supporting this circuit organization. Specifically, suppressing upstream Harmful Detection Heads disrupts downstream refusal behavior, a process mediated by safety neurons.

性能与鲁棒性

  • 架构无关性: 所识别出的电路解构在多种LLM架构和各种对抗攻击设置中具有高度的一致性。
  • 电路引导的权重缩放: 利用简单且保持架构不变的权重缩放作为机械探针,该方法在六个经测试的LLM上将抵御攻击的安全率提升了 26.5%
  • 极小的性能权衡: 这种增强在四个标准基准测试中仅带来了可忽略不计的 1.7% 的准确率下降

Performance & Robustness

  • Architecture-Agnostic: The identified circuit decomposition recurs consistently across multiple LLM architectures and various adversarial attack settings.
  • Circuit-Guided Weight Scaling: Utilizing simple, architecture-preserving weight scaling as a mechanistic probe, the approach improves safety rates against attacks by 26.5% across six tested LLMs.
  • Minimal Performance Trade-off: The enhancement incurs only a negligible 1.7% accuracy drop across four standard benchmarks.

🔗 全文与资源

🔗 Full-Text & Resources


📚 引用

如果您在研究中使用了这项工作,请引用该 arXiv 预印本:

📚 Citation

If you use this work in your research, please cite the arXiv preprint:

@article{chu2026detectionrefusalsaferllms,
      title={From Detection to Refusal: Safer LLMs via Circuit-Guided Weight Scaling}, 
      author={Kuan-Lin Chu and Chung-En Sun and Tsui-Wei Weng},
      year={2026},
      eprint={2609.00051},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}