Lune

NeurIPS2024顶会

Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks

Tianyu He, Darshil Doshi, Aritra Das, Andrey Gromov

摘要

Large language models can solve tasks that were not present in the training set. This capability is believed to be due to in-context learning and skill composition. In this work, we study the emergence of in-context learning and skill composition in a collection of modular arithmetic tasks. Specifically, we consider a finite collection of linear modular functions z=a x+b y  mod  pz = a \, x + b \, y \;\mathrm{mod}\; p labeled by the vector (a,b)∈Zp2(a, b) \in \mathbb{Z}_p^2. We use some of these tasks for pre-training and the rest for out-of-distribution testing. We empirically show that a GPT-style transformer exhibits a transition from in-distribution to out-of-distribution generalization as the number of pre-training tasks increases. We find that the smallest model capable of out-of-distribution generalization requires two transformer blocks, while for deeper models, the out-of-distribution generalization phase is transient, necessitating early stopping. Finally, we perform an interpretability study of the pre-trained models, revealing highly structured representations in both attention heads and MLPs; and discuss the learned algorithms. Notably, we find an algorithmic shift in deeper models, as we go from few to many in-context examples.

问 Lune

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

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

已有 18 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Transformers learn to implement preconditioned gradient descent for in-context learning 引用了 Language Models are Few-Shot Learners
  • Transformers learn to implement preconditioned gradient descent for in-context learning 引用了 Transformers Learn In-Context by Gradient Descent
  • Transformers learn to implement preconditioned gradient descent for in-context learning 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks 引用了 Towards Understanding Grokking: An Effective Theory of Representation Learning
  • Emergent Analogical Reasoning in Transformers 引用了 Towards Understanding Grokking: An Effective Theory of Representation Learning
  • Emergent Analogical Reasoning in Transformers 引用了 Transformers Learn In-Context by Gradient Descent
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time 引用了 Transformers learn to implement preconditioned gradient descent for in-context learning
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time 引用了 Uncovering a Universal Abstract Algorithm for Modular Addition in Neural Networks
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time 引用了 Language Models are Few-Shot Learners
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time 引用了 Transformers Learn In-Context by Gradient Descent
  • Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • In-Context Learning Strategies Emerge Rationally 引用了 Transformers learn to implement preconditioned gradient descent for in-context learning
  • In-Context Learning Strategies Emerge Rationally 引用了 Language Models are Few-Shot Learners
  • In-Context Learning Strategies Emerge Rationally 引用了 Transformers Learn In-Context by Gradient Descent
  • In-Context Learning Strategies Emerge Rationally 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • Transformers Learn In-Context by Gradient Descent 引用了 Language Models are Few-Shot Learners
  • Transformers Learn In-Context by Gradient Descent 引用了 What Can Transformers Learn In-Context? A Case Study of Simple Function Classes
  • What Can Transformers Learn In-Context? A Case Study of Simple Function Classes 引用了 Language Models are Few-Shot Learners
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper18

  1. In-Context Learning Strategies Emerge RationallyDaniel Wurgaft, Ekdeep Singh Lubana, Core Francisco Park, Hidenori Tanaka 等NeurIPS 2025 · 19 次引用
  2. Uncovering a Universal Abstract Algorithm for Modular Addition in Neural NetworksGavin McCracken, Gabriela Moisescu-Pareja, Vincent Létourneau, Doina Precup 等NeurIPS 2025 · 14 次引用
  3. Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and TimeBlake Bordelon, Mary I. Letey, Cengiz PehlevanICLR 2026 · 14 次引用
  4. Circuit Stability Characterizes Language Model GeneralizationAlan SunACL 2025 · 4 次引用
  5. Emergent Analogical Reasoning in TransformersGouki Minegishi, Jingyuan Feng, Hiroki Furuta, Takeshi Kojima 等ICML 2026 · 4 次引用

它引用的 Paper16

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. What Can Transformers Learn In-Context? A Case Study of Simple Function ClassesShivam Garg, Dimitris Tsipras, Percy Liang, Gregory ValiantNeurIPS 2022 · 883 次引用
  3. Transformers Learn In-Context by Gradient DescentJohannes von Oswald, Eyvind Niklasson, Ettore Randazzo, João Sacramento 等ICML 2023 · 729 次引用
  4. Transformers learn to implement preconditioned gradient descent for in-context learningKwangjun Ahn, Xiang Cheng, Hadi Daneshmand, Suvrit SraNeurIPS 2023 · 324 次引用
  5. Towards Understanding Grokking: An Effective Theory of Representation LearningZiming Liu, Ouail Kitouni, Niklas Nolte, Eric J. Michaud 等NeurIPS 2022 · 299 次引用

相关 Paper

  1. When can in-context learning generalize out of task distribution?Page C. Goddard, Lindsay M. Smith, Vudtiwat Ngampruetikorn, David J. SchwabICML 2025
  2. 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
  3. Extrapolation by Association: Length Generalization Transfer In TransformersZiyang Cai, Nayoung Lee, Avi Schwarzschild, Samet Oymak 等NeurIPS 2025 · 13 次引用
  4. Teaching Arithmetic to Small TransformersNayoung Lee, Kartik Sreenivasan, Jason D. Lee, Kangwook Lee 等ICLR 2024 · 128 次引用
  5. How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with RepresentationsTianyu Guo, Wei Hu, Song Mei, Huan Wang 等ICLR 2024 · 80 次引用
黄昏的海面,两侧是细线勾勒的悬崖