[论文解读] Refusal in Language Models Is Mediated by a Single Direction
本文在残差激活中识别出一个单一的一维方向,该方向在13个开源聊天模型中介导拒绝;消融该方向可使拒绝失效,而添加该方向则会引发拒绝,从而通过权重编辑实现白盒越狱。
Conversational large language models are fine-tuned for both instruction-following and safety, resulting in models that obey benign requests but refuse harmful ones. While this refusal behavior is widespread across chat models, its underlying mechanisms remain poorly understood. In this work, we show that refusal is mediated by a one-dimensional subspace, across 13 popular open-source chat models up to 72B parameters in size. Specifically, for each model, we find a single direction such that erasing this direction from the model's residual stream activations prevents it from refusing harmful instructions, while adding this direction elicits refusal on even harmless instructions. Leveraging this insight, we propose a novel white-box jailbreak method that surgically disables refusal with minimal effect on other capabilities. Finally, we mechanistically analyze how adversarial suffixes suppress propagation of the refusal-mediating direction. Our findings underscore the brittleness of current safety fine-tuning methods. More broadly, our work showcases how an understanding of model internals can be leveraged to develop practical methods for controlling model behavior.
研究动机与目标
- 研究对有害指令的拒绝在聊天模型内部激活中的表示机制。
- 识别区分有害与无害指令处理的最小的一维方向。
- 展示通过激活层级干预对模型行为的因果操控。
- 提出一种通过权重正交化实现的白盒越狱方法,在移除拒绝的同时保留其他能力。
- 分析对抗性后缀如何影响拒绝方向的传导。
提出的方法
- 使用均值差异从指令后令牌跨层残差激活中提取候选拒绝方向。
- 通过验证其消融拒绝的能力以及添加时能诱发拒绝,同时尽量保持其他行为,选取一个最有效的方向。
- 通过从所有层和令牌的激活中移除该方向来执行方向性消融,以评估是否可绕过拒绝。
- 通过在选定层的激活中注入该方向来实现激活相加,以在无害提示上诱导拒绝。
- 通过对模型权重矩阵相对于拒绝方向进行正交化来实现白盒越狱,以防止将此方向写入残差流。
- 在标准语言模型基准上评估正交化后的模型的一致性,并在 HarmBench 上与其他越狱进行比较。
实验结果
研究问题
- RQ1模型残差流中的单一方向是否在多个开源聊天模型中介导拒绝?
- RQ2消融该方向是否足以关闭拒绝,添加它是否足以在无害提示上诱导拒绝?
- RQ3权重正交化干预是否能作为实用的白盒越狱,且不对通用能力造成严重损害?
- RQ4对抗性后缀如何干扰拒绝方向在各个令牌之间的传导?
主要发现
| 模型 | MMLU | ARC | GSM8K | TruthfulQA |
|---|---|---|---|---|
| Gemma 7B | 51.8 / 51.7 (+0.1) | 51.7 / 51.5 (+0.2) | 31.3 / 32.0 (-0.7) | 44.7 / 47.1 (-2.4) |
| Yi 34B | 73.5 / 74.9 (-1.4) | 65.6 / 64.9 (+0.7) | 65.5 / 65.0 (+0.5) | 51.9 / 55.4 (-3.5) |
| Llama-2 70B | 63.1 / 63.0 (+0.1) | 65.2 / 65.4 (-0.2) | 54.5 / 53.0 (+1.5) | 51.8 / 52.8 (-1.0) |
| Llama-3 70B | 79.8 / 79.9 (-0.1) | 71.5 / 71.8 (-0.3) | 90.8 / 91.2 (-0.4) | 59.5 / 61.8 (-2.3) |
| Qwen 72B | 76.5 / 77.2 (-0.7) | 67.2 / 67.6 (-0.4) | 76.3 / 75.5 (+0.8) | 55.0 / 56.4 (-1.4) |
- 单一的差异均值方向可解释至多13个模型、参数规模达72B的拒绝。
- 消融拒绝方向会降低拒绝率,并在有害提示中产生不安全的输出。
- 将拒绝方向添加到激活中,即使在无害提示下也会诱导拒绝。
- 权重正交化作为有效的白盒越狱,在对其他能力的影响很小。
- 对抗性后缀通过劫持注意力并降低其在拒绝方向上的投影来抑制拒绝方向。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。