mlsanityData to 7 Oct 2026

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

arXiv 2406.02550 ↗First posted 4 Jun 2024cs.LG cond-mat.dis-nn hep-thcited by 40

Not on the map. Why?

Abstract (arXiv)

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; p labeled by the vector (a, b) ∈ mathbbZp2. 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.

Key facts. Cited by 40 papers in the map (data through 7 Oct 2026). Builds on 5 of its 29 references that are in the map. First posted on arXiv 4 Jun 2024.

Builds on

5 of 29 references.

References · 5

  1. 2022Emergent Abilities of Large Language Modelscited by 2,483
  2. 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 599
  3. 2023A Theory for Emergence of Complex Skills in Language Modelscited by 111
  4. 2023Grokking modular arithmeticcited by 77
  5. 2023To grok or not to grok: Disentangling generalization and memorization on corrupted algorithmic datasetscited by 24

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 5; 2025: 25; 2026: 10.

40 papers.

Sort:

By area:

  1. 2025The Origins of Representation Manifolds in Large Language Modelscited by 46
  2. 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
  3. 2025Emergent Abilities in Large Language Models: A Surveycited by 34
  4. 2024Not All LLM Reasoners Are Created Equalcited by 29
  5. 2024A Percolation Model of Emergence: Analyzing Transformers Trained on a Formal Languagecited by 26
  6. 2025Strategy Coopetition Explains the Emergence and Transience of In-Context Learningcited by 17
  7. 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
  8. 2025Let Me Grok for You: Accelerating Grokking via Embedding Transfer from a Weaker Modelcited by 13
  9. 2025When can in-context learning generalize out of task distribution?cited by 13
  10. 2025Does Data Scaling Lead to Visual Compositional Generalization?cited by 13
  11. 2025Dynamics of Transient Structure in In-Context Linear Regression Transformerscited by 12
  12. 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergencecited by 10
28 more
  1. 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
  2. 2025An explainable transformer circuit for compositional generalizationcited by 8
  3. 2025Position: Solve Layerwise Linear Models First to Understand Neural Dynamical Phenomena (Neural Collapse, Emergence, Lazy/Rich Regime, and Grokking)cited by 8
  4. 2025Circuit Stability Characterizes Language Model Generalizationcited by 6
  5. 2024Task Diversity Shortens the ICL Plateaucited by 5
  6. 2025Distinct Computations Emerge From Compositional Curricula in In-Context Learningcited by 5
  7. 2025Decomposing Complex Visual Comprehension into Atomic Visual Skills for Vision Language Modelscited by 4
  8. 2025In-Context Algebracited by 4
  9. 2026Skill Neologisms: Towards Skill-based Continual Learningcited by 4
  10. 2026Model Capacity Determines Grokking through Competing Memorisation and Generalisation Speedscited by 4
  11. 2025On the Emergence of Induction Heads for In-Context Learningcited by 3
  12. 2025On the geometry and topology of representations: the manifolds of modular additioncited by 3
  13. 2025Understanding Post-Training Structural Changes in Large Language Modelscited by 2
  14. 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descentcited by 2
  15. 2025Explainability of Large Language Models: Opportunities and Challenges toward Generating Trustworthy Explanationscited by 2
  16. 2025Emergence and Localisation of Semantic Role Circuits in LLMscited by 2
  17. 2025Beyond Progress Measures: Theoretical Insights into the Mechanism of Grokkingcited by 1
  18. 2026Bayesian Optimality of In-Context Learning with Selective State Spacescited by 1
  19. 2026Quantifying Hyperparameter Transfer and the Importance of Embedding Layer Learning Ratecited by 1
  20. 2024Identifying Sub-networks in Neural Networks via Functionally Similar Representationscited by 0
  21. 2025Learning Pseudorandom Numbers with Transformers: Permuted Congruential Generators, Curricula, and Interpretabilitycited by 0
  22. 2025Multimodal LLMs Do Not Compose Skills Optimally Across Modalitiescited by 0
  23. 2026A Bayesian Perspective on the Role of Epistemic Uncertainty for Delayed Generalization in In-Context Learningcited by 0
  24. 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoningcited by 0
  25. 2026Temporal Task Diversity: Inductive Biases Under Non-Stationarity in Synthetic Sequence Modellingcited by 0
  26. 2026Assign and Add: A Mechanistic Study of Compositional Arithmeticcited by 0
  27. 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatchcited by 0
  28. 2026Universal Transformers for Circuit Computations: Perfect Length Generalization in Tiny Transformerscited by 0