arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.04962cs.CLcs.AI
收藏

用于引导与解释语言模型的激活缩放(Activation Scaling)

Activation Scaling for Steering and Interpreting Language Models

ETH Zürich(苏黎世联邦理工学院);University of Copenhagen(哥本哈根大学);EPFL(洛桑联邦理工学院);The University of Chicago(芝加哥大学)

Niklas Stoehr, Kevin Du, Vésteinn Snæbjarnarson, Robert West, Ryan Cotterell, Aaron Schein

AI总结:

该研究提出激活缩放方法,通过基于梯度的优化学习仅修改激活向量带符号幅值的稀疏干预,在合成任务上效果与引导向量相当且更具可解释性,还实现了对不同长度提示的泛化。

摘要:

给定提示词“Rome is in”,我们能否仅通过将少数相关激活向量乘以标量,就能引导语言模型把对错误词元“France”的预测翻转为正确词元“Italy”?我们认为,成功对模型进行干预是解释其内部运作机制的前提。具体而言,我们提出了一个包含三项指标的目标:成功的干预应能将正确与错误词元的预测结果互换(有效性),同时不影响其他词元(忠实性),且干预需具备稀疏性(最小性)。借助基于梯度的优化方法,该目标让我们能够学习(并后续评估)一种特定的高效且可解释的干预方式:激活缩放(activation scaling)仅修改激活向量的带符号幅值,以增强、削弱或反转模型中已编码的引导方向。在合成任务上,这种干预方式在有效性和忠实性方面与引导向量(steering vectors)表现相当,但最小性远优于后者,让我们能够精准定位可解释的模型组件。我们从多个角度评估了激活缩放,在不同数据集上对比了性能,并将激活标量设为激活向量本身的可学习函数,以推广到不同长度的提示词场景。

英文摘要:

Given the prompt "Rome is in", can we steer a language model to flip its prediction of an incorrect token "France" to a correct token "Italy" by only multiplying a few relevant activation vectors with scalars? We argue that successfully intervening on a model is a prerequisite for interpreting its internal workings. Concretely, we establish a three-term objective: a successful intervention should flip the correct with the wrong token and vice versa (effectiveness), and leave other tokens unaffected (faithfulness), all while being sparse (minimality). Using gradient-based optimization, this objective lets us learn (and later evaluate) a specific kind of efficient and interpretable intervention: activation scaling only modifies the signed magnitude of activation vectors to strengthen, weaken, or reverse the steering directions already encoded in the model. On synthetic tasks, this intervention performs comparably with steering vectors in terms of effectiveness and faithfulness, but is much more minimal allowing us to pinpoint interpretable model components. We evaluate activation scaling from different angles, compare performance on different datasets, and make activation scalars a learnable function of the activation vectors themselves to generalize to varying-length prompts.

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

↑