Lune

ICLR2026顶会

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

Qinyuan Ye, Robin Jia, Xiang Ren

摘要

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. 1 INTRODUCTION As the capabilities of language models (LMs) continue to grow, users apply them to increasingly challenging and diverse tasks, accompanied by evolving expectations (Zhao et al., 2024; Tamkin et al., 2024; Kwa et al., 2025) . Consequently, it becomes impractical to include every task of interest in a model's training prior to deployment. In this context, task-level generalization-the ability of a model to perform novel tasks at inference time-becomes highly crucial and valued. Prior work shows that LMs already exhibit this capability to a significant extent through in-context learning (Brown et al., 2020; Chen et al., 2022; Min et al., 2022a). The underlying mechanisms of this behavior are being actively investigated, with work on induction heads (Olsson et al., 2022) and function vectors (Hendel et al., 2023; Todd et al., 2024) offering substantial insights on pattern matching tasks (i.e., ) and mapping-style tasks (e.g., France: Paris, Australia: → Canberra). However, our understanding is still limited, especially regarding more complex generalization scenarios involving multi-step reasoning or newly-defined concepts in the task. In this work, we aim to enhance our understanding of how models handle novelty and unconventionality with one counterfactual task: off-by-one addition (i.e., 1+1=3, 2+2=5, 3+3=?). For humans, this task consists of two sequential steps: standard addition, followed by an unexpected increment of one to the sum. When a language model is prompted to perform this task with in-context learning, we anticipate two possible outcomes: (1) the model acquires the intended +1 operation and thus outputs 7, or (2) it adheres to fundamental arithmetic rules and outputs 6. We begin our study by evaluating six contemporary LMs on off-by-one addition. Our findings indicate that all evaluated models consistently demonstrate the first outcome, effectively leveraging in-context

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Efficient Streaming Language Models with Attention Sinks 引用了 Language Models are Few-Shot Learners
  • Locating and Editing Factual Associations in GPT 引用了 Investigating Gender Bias in Language Models Using Causal Mediation Analysis
  • Locating and Editing Factual Associations in GPT 引用了 Language Models are Few-Shot Learners
  • Measuring Massive Multitask Language Understanding 引用了 Language Models are Few-Shot Learners
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper34

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou 等ICLR 2021 · 7,905 次引用
  3. Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 次引用
  4. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
  5. Investigating Gender Bias in Language Models Using Causal Mediation AnalysisJesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian 等NeurIPS 2020 · 851 次引用

相关 Paper

  1. Which Attention Heads Matter for In-Context Learning?Kayo Yin, Jacob SteinhardtICML 2025
  2. Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion ScaleHritik Bansal, Karthik Gopalakrishnan, Saket Dingliwal, Sravan Bodapati 等ACL 2023 · 11 次引用
  3. Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasksTianyu He, Darshil Doshi, Aritra Das, Andrey GromovNeurIPS 2024 · 52 次引用
  4. Circuit Component Reuse Across Tasks in Transformer Language ModelsJack Merullo, Carsten Eickhoff, Ellie PavlickICLR 2024 · 108 次引用
  5. Task Generalization with Autoregressive Compositional Structure: Can Learning from D Tasks Generalize to DT Tasks?Amirhesam Abedsoltan, Huaqing Zhang, Kaiyue Wen, Hongzhou Lin 等ICML 2025
黄昏的海面,两侧是细线勾勒的悬崖