arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.16423cs.LGcs.AI
收藏

梯度偏移:理解防御性训练方法如何保护语言模型完整性

Shifting the Gradient: Understanding How Defensive Training Methods Protect Language Model Integrity

Stanford University(斯坦福大学);MATS

Satchel Grant, Victor Gillioz, Jake Ward, Thomas McGrath

AI总结:

本文通过对比PPS和IP两种防御性训练方法,揭示其在保护语言模型完整性上的不同机制,发现PPS通过调整激活梯度抑制特质表达,而IP则通过解释数据中的特质表达来减少预测损失。

摘要:

防御性训练方法如正向预防引导(PPS)和接种提示(IP)通过看似相似的过程在训练过程中向大型语言模型(LLMs)添加特征诱导对象,同时保护LLM免受特征获取的影响。这些方法的成功引发了问题:它们是如何工作的?PPS和IP是否做着相同的事?我们通过“邪恶性”作为案例研究特征,对这两种方法进行了行为和机制比较。我们的核心发现是PPS和IP通过不同的机制实现防御效益。行为上,我们显示PPS和IP都不是纯粹的关联机制;PPS既能防御特征获取,又能主动减少已有的表达,而IP在先前微调过以表达特征的模型中无效。这种行为差异反映在机制上:PPS将激活梯度向抑制方向偏移,沿着PPS向量轴。当PPS向量与特征表达轴对齐时,它可以反转梯度压力,减少而非增加该轴上的激活。相反,IP继续抵制精确的机制解释。直接余弦相似度分析显示,IP具有与PPS显著不同的梯度特征,而定性分析显示IP的梯度更分散。此外,IP在特征表达数据上的下一个令牌预测损失上表现更好,而PPS并不需要如此,这与IP在训练数据中“解释掉”特征表达的观点一致。总体而言,我们的分析揭示了每种方法的不同机制,并突显了关于IP机制图景的开放性问题。

英文摘要:

Defensive training methods such as positive preventative steering (PPS) and inoculation prompting (IP) offer surprising results through seemingly similar processes: both add trait-inducing objects to large language models (LLMs) during training, and both defend the LLM against acquiring the trait. The success of these methods raises the questions: how do they work, and are they doing the same thing? We provide behavioral and mechanistic analyses of PPS and IP, using the acquisition of an ``evil'' persona by Qwen2.5-7B-Instruct as an in-depth case study and replicating key measurements across six traits and four models. Behaviorally, neither method operates through a purely associative mechanism, and both methods prevent trait acquisition; but PPS can also substantially reduce pre-existing trait expression, whereas IP does so only modestly. Mechanistically, PPS induces a concentrated change in the activation gradient and shifts the signal along the trait direction from amplifying to attenuating, whereas IP changes the gradient more diffusely and shifts it close to zero along the trait direction. Gradient manipulations show that the direction of this component is causally relevant to trait acquisition, although it is one effect rather than a complete account of either defense. We then show that IP lowers the next-token prediction loss on trait-expressing data, whereas PPS can raise it at the intensities at which it defends; we show how this analysis raises the possibility that the loss changes and the gradient shift are two summaries of the same training signal rather than completely separate mechanisms. Together, our results show that PPS and IP are not interchangeable, and they highlight open questions about a complete mechanistic picture.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑