Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge
On the map: LLM reasoning → Reasoning benchmarks and evaluation
Abstract (arXiv)
Transformer-based language models excel at in-context learning (ICL), where they can adapt to new tasks based on contextual examples, without parameter updates. In a specific form of ICL, which we refer to as textitcontextual recall, models pretrained on open-ended text leverage pairwise examples to recall specific facts in novel prompt formats. We investigate whether contextual recall emerges from pretraining alone, what finetuning is required, and what mechanisms drive the necessary representations. For this, we introduce a controlled synthetic framework where pretraining sequences consist of subject-grammar-attribute tuples, with attribute types tied to grammar statistics. We demonstrate that while such pretraining successfully yields factual knowledge, it is insufficient for contextual recall: models fail to implicitly infer attribute types when the grammar statistics are removed in ICL prompts. However, we show that finetuning on tasks requiring implicit inference, distinct from the ICL evaluation, using a subset of subjects, triggers the emergence of contextual recall across all subjects. This transition is accompanied by the formation of low-dimensional latent encodings of the shared attribute type. For mechanistic insight, we derive a construction for an attention-only transformer that replicates the transition from factual to contextual recall, corroborated by empirical validation.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 43 of its 46 references that are in the map. First posted on arXiv 21 Mar 2026.
Builds on
43 of 46 references.
Closest ancestors · 1
Same direction, newest first
- 2024Distributional Associations vs In-Context Reasoning: A Study of Feed-forward and Attention Layers5 Jun
Other references · 42
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022In-context Learning and Induction Headscited by 930
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023In-Context Learning Creates Task Vectorscited by 302
- 2023Function Vectors in Large Language Modelscited by 292
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2023Physics of Language Models: Part 3.1, Knowledge Storage and Extractioncited by 264
30 more
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
- 2023Birth of a Transformer: A Memory Viewpointcited by 154
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 149
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 2024What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationcited by 86
- 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 72
- 2024Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimalitycited by 71
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 62
- 2025Which Attention Heads Matter for In-Context Learning?cited by 61
- 2024Competition Dynamics Shape Algorithmic Phases of In-Context Learningcited by 52
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
- 2024Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformerscited by 46
- 2024Understanding Factual Recall in Transformers via Associative Memoriescited by 45
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Dual Operating Modes of In-Context Learningcited by 42
- 2025How do language models learn facts? Dynamics, curricula and hallucinationscited by 33
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 26
- 2025Task Vectors in In-Context Learning: Emergence, Formation, and Benefitcited by 20
- 2025Strategy Coopetition Explains the Emergence and Transience of In-Context Learningcited by 17
- 2025Dynamics of Transient Structure in In-Context Linear Regression Transformerscited by 12
- 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
- 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitationscited by 8
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 7
- 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformerscited by 6
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Flycited by 4
- 2025Facts in Stats: Impacts of Pretraining Diversity on Language Model Generalizationcited by 3
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Beyond Semantics: How Temporal Biases Shape Retrieval in Transformer and State-Space Models
- 2023Concept-aware Training Improves In-context Learning Ability of Language Models
- 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
- 2024Concept-aware Data Construction Improves In-context Learning of Language Models
- 2025"Lost-in-the-Later": Framework for Quantifying Contextual Grounding in Large Language Models
- 2025How Transformers Learn In-Context Recall Tasks? Optimality, Training Dynamics and Generalization
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Models