Resisting Harmful Instructions through Training-Free Weight Editing

📄 arXiv: 2610.21189v1 📥 PDF

作者: Ali Ebrahimpour-Boroojeny, Xiaocong Yang, Samuel Schapiro, Zahra Borhani, Francisco R. Ortega, Yujia Zheng, ChengXiang Zhai

分类: cs.LG

发布日期: 2026-10-15


💡 一句话要点

提出无训练权重编辑方法以抵抗有害指令

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 无训练方法 权重编辑 指令遵循模型 安全性 性别歧视 虚假信息 机器学习 人工智能

📋 核心要点

  1. 现有指令遵循模型在处理有害指令时,容易遵从与安全对齐相悖的请求,存在安全隐患。
  2. 本文提出了一种无训练的权重编辑方法,通过前向推理对模型权重进行修改,从而减少对不良指令的遵从。
  3. 在实验中,该方法在指令性撒谎和性别歧视的任务上显著提高了诚实响应率,展示了其有效性。

📝 摘要(中文)

指令遵循语言模型可能会遵从与预期行为和安全对齐相悖的请求。本文提出了一种无训练的权重编辑方法,旨在减少对特定不良指令的遵从。该方法仅需对少量提示对进行前向推理,且由于编辑存储在模型权重中,改变或删除提示中的指令无法撤销权重修改。我们在五个指令调优模型上评估了该方法在两种有害行为(指令性虚假和指令性性别歧视)下的效果。结果表明,该方法在指令性撒谎基准上提高了平均诚实响应率,且在指令性性别歧视方面显著降低了性别歧视响应率。这些结果确立了我们基于对比的权重编辑方法作为有效的无训练干预手段。

🔬 方法详解

问题定义:本文旨在解决指令遵循语言模型在面对有害指令时的高遵从性问题。现有方法通常依赖于训练过程,难以快速适应新的指令或行为要求。

核心思路:提出了一种无训练的权重编辑方法,通过对模型权重进行修改,直接影响模型对特定不良指令的响应,避免了传统训练方法的复杂性和时间成本。

技术框架:该方法的整体流程包括:首先,选择一小组提示对;然后,进行前向推理以编辑模型权重;最后,评估编辑后的模型在特定任务上的表现。

关键创新:最重要的技术创新在于权重编辑的对比性方法,这种方法与现有的训练依赖方法本质上不同,能够在不需要重新训练的情况下实现模型行为的调整。

关键设计:在权重编辑过程中,使用了特定的损失函数来指导权重的修改,并确保编辑后的权重在面对不同的指令时仍然有效。

🖼️ 关键图片

fig_0
fig_1

📊 实验亮点

实验结果显示,在指令性撒谎的基准上,该方法的平均诚实响应率提高了6.2和4.6个百分点,显著优于最强替代方案。在指令性性别歧视方面,响应率从57.9%降低至24.3%,结合公平提示后进一步降低至11.9%。

🎯 应用场景

该研究的潜在应用领域包括安全性高的对话系统、内容审核和自动化客服等。通过减少模型对有害指令的遵从,可以提升系统的安全性和可靠性,具有重要的实际价值和社会影响。未来,该方法可能会与其他安全机制结合,进一步增强模型的安全性。

📄 摘要(原文)

Instruction-following language models can comply with requests that conflict with intended behaviors and safety alignment. We introduce a training-free weight-editing approach for reducing compliance with targeted undesirable instructions. Our method needs only forward passes on a small set of prompt pairs per target behavior, and because the edit is stored in the model's weights, changing or deleting instructions in the prompt cannot undo the weight modification. We evaluate the approach on two target harmful behaviors across five instruction-tuned models: instructed falsehood and instructed sexism. On two instructed-lying benchmarks, it improves mean honest response rates by 6.2 and 4.6 percentage points over the strongest alternative, significantly on three of the five models and within noise on the other two. In a controlled study of seven prompt formats, it maintains higher honest-response rates than single-layer activation steering when orders to lie arrive in single-turn formats not used to construct the edit. For instructed sexism, it reduces the mean sexist-response rate from 57.9% to 24.3%; combining the edit with a fairness prompt reduces it further to 11.9%. These results establish our contrast-based weight editing approach as an effective training-free intervention in two distinct behavioral domains, supporting its use both independently and alongside prompt-based safeguards.