mlsanityData to 7 Oct 2026

In-Context Language Learning: Architectures and Algorithms

arXiv 2401.12973 ↗First posted 23 Jan 2024cs.CL cs.LGcited by 86

Not on the map. Why?

Abstract (arXiv)

Large-scale neural language models exhibit a remarkable capacity for in-context learning (ICL): they can infer novel functions from datasets provided as input. Most of our current understanding of when and how ICL arises comes from LMs trained on extremely simple learning problems like linear regression and associative recall. There remains a significant gap between these model problems and the "real" ICL exhibited by LMs trained on large text corpora, which involves not just retrieval and function approximation but free-form generation of language and other structured outputs. In this paper, we study ICL through the lens of a new family of model problems we term in context language learning (ICLL). In ICLL, LMs are presented with a set of strings from a formal language, and must generate additional strings from the same language. We focus on in-context learning of regular languages generated by random finite automata. We evaluate a diverse set of neural sequence models (including several RNNs, Transformers, and state-space model variants) on regular ICLL tasks, aiming to answer three questions: (1) Which model classes are empirically capable of ICLL? (2) What algorithmic solutions do successful models implement to perform ICLL? (3) What architectural changes can improve ICLL in less performant models? We first show that Transformers significantly outperform neural sequence models with recurrent or convolutional representations on ICLL tasks. Next, we provide evidence that their ability to do so relies on specialized "n-gram heads" (higher-order variants of induction heads) that compute input-conditional next-token distributions. Finally, we show that hard-wiring these heads into neural models improves performance not just on ICLL, but natural language modeling -- improving the perplexity of 340M-parameter models by up to 1.14 points (6.7%) on the SlimPajama dataset.

Key facts. Cited by 86 papers in the map (data through 7 Oct 2026). Builds on 43 of its 62 references that are in the map. First posted on arXiv 23 Jan 2024.

Builds on

43 of 62 references.

References · 43

  1. 2017Attention Is All You Needcited by 59,932
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  3. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  4. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  5. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
  6. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  7. 2020GLU Variants Improve Transformercited by 1,724
  8. 2019Root Mean Square Layer Normalizationcited by 1,425
  9. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
  10. 2022In-context Learning and Induction Headscited by 930
  11. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  12. 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 831
31 more
  1. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 814
  2. 2022Transformers learn in-context by gradient descentcited by 714
  3. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
  4. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  5. 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
  6. 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 495
  7. 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
  8. 2022On the Parameterization and Initialization of Diagonal State Space Modelscited by 418
  9. 2023Hyena Hierarchy: Towards Larger Convolutional Language Modelscited by 388
  10. 2023Larger language models do in-context learning differentlycited by 386
  11. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
  12. 2022Long Range Language Modeling via Gated State Spacescited by 265
  13. 2022The Parallelism Tradeoff: Limitations of Log-Precision Transformerscited by 191
  14. 2022Transformer Quality in Linear Timecited by 189
  15. 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 188
  16. 2021An Attention Free Transformercited by 111
  17. 2022The Devil in Linear Transformercited by 98
  18. 2022Compositional Semantic Parsing with Large Language Modelscited by 95
  19. 2021An Interpretability Illusion for BERTcited by 94
  20. 2023Uncovering mesa-optimization algorithms in Transformerscited by 94
  21. 2023A Theory of Emergent In-Context Learning as Implicit Structure Inductioncited by 86
  22. 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
  23. 2020RNNs can generate bounded hierarchical languages with optimal memorycited by 59
  24. 2019Sequential Neural Networks as Automatacited by 54
  25. 2021Few-Shot Semantic Parsing with Language Models Trained On Codecited by 50
  26. 2019Memory-Augmented Recurrent Neural Networks Can Learn Generalized Dyck Languagescited by 31
  27. 2023Transformers are uninterpretable with myopic methods: a case study with bounded Dyck grammarscited by 30
  28. 2020On the Linguistic Capacity of Real-Time Counter Automatacited by 16
  29. 2023Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning Abilitycited by 16
  30. 2022What Makes Instruction Learning Hard? An Investigation and a New Challenge in a Synthetic Environmentcited by 9
  31. 2023MLRegTest: A Benchmark for the Machine Learning of Regular Languagescited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 35; 2025: 34; 2026: 17.

86 papers.

Sort:

By area:

  1. 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 373
  2. 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 208
  3. 2024Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modelingcited by 167
  4. 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
  5. 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Taskscited by 104
  6. 2024Gated Slot Attention for Efficient Linear-Time Sequence Modelingcited by 73
  7. 2024Attention Heads of Large Language Models: A Surveycited by 65
  8. 2024Mechanistic Design and Scaling of Hybrid Architecturescited by 57
  9. 2024Linearizing Large Language Modelscited by 51
  10. 2024Is Mamba Capable of In-Context Learning?cited by 45
  11. 2024The Expressive Capacity of State Space Models: A Formal Language Perspectivecited by 45
  12. 2025Emergent Symbolic Mechanisms Support Abstract Reasoning in Large Language Modelscited by 31
38 more
  1. 2024Linear Transformers are Versatile In-Context Learnerscited by 28
  2. 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited by 28
  3. 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steeringcited by 24
  4. 2026Gated DeltaNet-2: Decoupling Erase and Write in Linear Attentioncited by 24
  5. 2024A Hitchhiker's Guide to Scaling Law Estimationcited by 23
  6. 2024Training Neural Networks as Recognizers of Formal Languagescited by 23
  7. 2025The Dual-Route Model of Inductioncited by 22
  8. 2024Algorithmic Capabilities of Random Transformerscited by 17
  9. 2024Memory Mosaicscited by 16
  10. 2024Sparse Autoencoders Reveal Temporal Difference Learning in Large Language Modelscited by 15
  11. 2024Progressive distillation induces an implicit curriculumcited by 15
  12. 2024Evidence from counterfactual tasks supports emergent analogical reasoning in large language modelscited by 14
  13. 2024What Do Language Models Learn in Context? The Structured Task Hypothesiscited by 13
  14. 2024XLand-100B: A Large-Scale Multi-Task Dataset for In-Context Reinforcement Learningcited by 13
  15. 2025Language Model Behavioral Phases are Consistent Across Architecture, Training Data, and Scalecited by 13
  16. 2024Distributional Associations vs In-Context Reasoning: A Study of Feed-forward and Attention Layerscited by 12
  17. 2025Systems and Algorithms for Convolutional Multi-Hybrid Language Models at Scalecited by 12
  18. 2025Scaling Linear Attention with Sparse State Expansioncited by 12
  19. 2025EvaLearn: Quantifying the Learning Capability and Efficiency of LLMs via Sequential Problem Solvingcited by 10
  20. 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
  21. 2025From Markov to Laplace: How Mamba In-Context Learns Markov Chainscited by 9
  22. 2025Do different prompting methods yield a common task representation in language models?cited by 9
  23. 2025Yes, Q-learning Helps Offline In-Context RLcited by 8
  24. 2025Mechanistic evaluation of Transformers and state space modelscited by 8
  25. 2024ALTA: Compiler-Based Analysis of Transformerscited by 7
  26. 2024N-Gram Induction Heads for In-Context RL: Improving Stability and Reducing Data Needscited by 6
  27. 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformerscited by 6
  28. 2024How Effective are State Space Models for Machine Translation?cited by 5
  29. 2024Task Diversity Shortens the ICL Plateaucited by 5
  30. 2024A Survey of RWKVcited by 5
  31. 2025Resona: Improving Context Copying in Linear Recurrence Models with Retrievalcited by 5
  32. 2025Bigram Subnetworks: Mapping to Next Tokens in Transformer Language Modelscited by 5
  33. 2024Amortized Inference of Causal Models via Conditional Fixed-Point Iterationscited by 4
  34. 2025Unlocking In-Context Learning for Natural Datasets Beyond Language Modellingcited by 4
  35. 2025Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worldscited by 4
  36. 2025Counterfactual reasoning: an analysis of in-context emergencecited by 4
  37. 2025In-Context Algebracited by 4
  38. 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and Whencited by 3

50 most cited of 86 All 86 (JSON)

Similar, not cited

Close in wording, no citation either way

  1. 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
  2. 2022Self-Generated In-Context Learning: Leveraging Auto-regressive Language Models as a Demonstration Generator
  3. 2023Concept-aware Training Improves In-context Learning Ability of Language Models
  4. 2025Beyond In-Context Learning: Aligning Long-form Generation of Large Language Models via Task-Inherent Attribute Guidelines
  5. 2025On the Relationship Between the Choice of Representation and In-Context Learning
  6. 2023Multilingual LLMs are Better Cross-lingual In-context Learners with Alignment
  7. 2023In-Context Explainers: Harnessing LLMs for Explaining Black Box Models
  8. 2025Leveraging In-Context Learning for Language Model Agents