arXiv:2507.09875cs.CLcs.AI2025-07被引 3

揭示大模型如何通过函数归纳实现任务泛化

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

  • 发现模型通过高层抽象的函数归纳机制泛化到错位加法
  • 多个注意力头并行协作完成+1函数的推断
  • 该机制可复用于多种合成与算法类任务

大语言模型可通过上下文学习执行未见过的任务,但其内部驱动任务泛化的机制尚不明确。本文以错位加法(如1+1=3, 2+2=5, 3+3=?)这一两步、反事实任务为研究对象,采用电路式可解释性技术(如路径修补),分析模型内部计算过程。研究发现:第一,模型从标准加法泛化到错位加法依赖一种新型机制,类似已有研究中的归纳头,但作用于更高层抽象,本文称之为“函数归纳”;第二,+1函数的归纳由多个注意力头并行完成,每个头贡献函数的一部分;第三,该函数归纳机制在更广泛的任务中被复用,包括移位多选问答和八进制加法等合成与算法任务。研究深化了对语言模型中可复用、可组合结构如何支持任务泛化的理解。

原文摘要 · Abstract (English)

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.

可解释性函数归纳任务泛化注意力机制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。