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

函数诱导与任务泛化:一项可解释性研究——关于“加一错误”加法

Function Induction and Task Generalization: An Interpretability Study with Off-by-One Addition

University of Southern California(南加州大学);Salesforce AI Research(Salesforce AI研究院)

Qinyuan Ye, Robin Jia, Xiang Ren

AI总结:

本研究通过分析“加一错误”加法任务,揭示了语言模型中函数诱导机制如何实现任务泛化,展示了其在多种任务中的复用能力。

摘要:

大型语言模型展示了通过上下文学习执行未见过任务的有趣能力。然而,仍然不清楚模型内部的机制如何驱动这种任务级泛化。在本工作中,我们通过“加一错误”加法(即1+1=3,2+2=5,3+3=?)这一两步、反事实任务的视角来探讨这一问题。利用电路式可解释性技术,如路径修补,我们分析了模型在执行任务时的内部计算,并提出了三个关键发现。首先,我们识别出一个机制,该机制解释了模型从标准加法到“加一错误”加法的泛化。它类似于先前工作中描述的归纳头机制,但操作在更高的抽象层次上;因此,我们称之为“函数诱导”。其次,我们展示了+1函数的归纳是由多个注意力头并行控制的,每个注意力头都会发出+1函数的不同部分。最后,我们发现这种函数诱导机制被广泛应用于更广泛的任务中,包括合成任务如移位多选问答和算法任务如八进制加法。总体而言,我们的发现为语言模型内部可重用和可组合的结构如何实现任务级泛化提供了更深入的理解。

英文摘要:

Large language models demonstrate the intriguing ability to perform unseen tasks via in-context learning. However, it remains unclear what mechanisms inside the model drive such task-level generalization. In this work, we approach this question through the lens of off-by-one addition (i.e., 1+1=3, 2+2=5, 3+3=?), a two-step, counterfactual task with an unexpected +1 function as a second step. Leveraging circuit-style interpretability techniques such as path patching, we analyze the models' internal computations behind their performance and present three key findings. First, we identify a mechanism that explains the model's generalization from standard addition to off-by-one addition. It resembles the induction head mechanism described in prior work, yet operates at a higher level of abstraction; we therefore term it "function induction" in this work. Second, we show that the induction of the +1 function is governed by multiple attention heads in parallel, each of which emits a distinct piece of the +1 function. Finally, we find that this function induction mechanism is reused in a broader range of tasks, including synthetic tasks such as shifted multiple-choice QA and algorithmic tasks such as base-8 addition. Overall, our findings offer deeper insights into how reusable and composable structures within language models enable task-level generalization.

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

↑