Understanding Factual Recall in Transformers via Associative Memories
Not on the map. Why?
Abstract (arXiv)
Large language models have demonstrated an impressive ability to perform factual recall. Prior work has found that transformers trained on factual recall tasks can store information at a rate proportional to their parameter count. In our work, we show that shallow transformers can use a combination of associative memories to obtain such near optimal storage capacity. We begin by proving that the storage capacities of both linear and MLP associative memories scale linearly with parameter count. We next introduce a synthetic factual recall task, and prove that a transformer with a single layer of self-attention followed by an MLP can obtain 100% accuracy on the task whenever either the total number of self-attention parameters or MLP parameters scales (up to log factors) linearly with the number of facts. In particular, the transformer can trade off between using the value matrices or the MLP as an associative memory to store the dataset of facts. We complement these expressivity results with an analysis of the gradient flow trajectory of a simplified linear attention model trained on our factual recall task, where we show that the model exhibits sequential learning behavior.
Key facts. Cited by 51 papers in the map (data through 14 Oct 2026). Builds on 13 of its 50 references that are in the map. First posted on arXiv 9 Dec 2024.
Builds on
13 of 50 references.
References · 13
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2020Hopfield Networks is All You Needcited by 475
- 2024Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Lawscited by 144
- 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?cited by 47
- 2021On the Optimal Memorization Power of ReLU Neural Networkscited by 40
- 2023Memorization Capacity of Multi-Head Attention in Transformerscited by 40
- 2021Approximating How Single Head Attention Learnscited by 38
- 2024Understanding Finetuning for Factual Knowledge Extractioncited by 32
- 2024Interpreting Key Mechanisms of Factual Recall in Transformer-Based Language Modelscited by 31
- 2024Mixture of Parrots: Experts improve memorization more than reasoningcited by 21
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 15
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformerscited by 11
1 more
- 2024On the Optimal Memorization Capacity of Transformerscited by 10
Built on by
Citing papers per year: 2024: 1; 2025: 23; 2026: 27.
51 papers.
Sort:
By area:
- 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 74
- 2025Muon Outperforms Adam in Tail-End Associative Memory Learningcited by 46
- 2025How do language models learn facts? Dynamics, curricula and hallucinationscited by 37
- 2025Taming Knowledge Conflicts in Language Modelscited by 30
- 2026There Will Be a Scientific Theory of Deep Learningcited by 29
- 2025Data Mixing Can Induce Phase Transitions in Knowledge Acquisitioncited by 16
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thoughtcited by 16
- 2025Why and How LLMs Hallucinate: Connecting the Dots with Subsequence Associationscited by 15
- 2026Sharp Capacity Scaling of Spectral Optimizers in Learning Associative Memorycited by 14
- 2025Language Model Behavioral Phases are Consistent Across Architecture, Training Data, and Scalecited by 13
- 2025Emergence of Linear Truth Encodings in Language Modelscited by 12
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
38 more
- 2026Mechanistic Data Attribution: Tracing the Training Origins of Interpretable LLM Unitscited by 10
- 2026Why Fine-Tuning Encourages Hallucinations and How to Fix Itcited by 7
- 2026T^2MLR: Transformer with Temporal Middle-Layer Recurrencecited by 7
- 2025NIRVANA: Structured Pruning Reimagined for Large Language Model Compressioncited by 6
- 2025Model-Aware Tokenizer Transfercited by 6
- 2025Recurrent Self-Attention Dynamics: An Energy-Agnostic Perspective from Jacobianscited by 5
- 2025On the Emergence of Induction Heads for In-Context Learningcited by 5
- 2026MemoryLLM: Plug-n-Play Interpretable Feed-Forward Memory for Transformerscited by 5
- 2026Universal Redundancies in Time Series Foundation Modelscited by 5
- 2025Mamba Knockout for Unraveling Factual Information Flowcited by 4
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Trainingcited by 4
- 2026What to Keep, What to Forget: A Rate--Distortion View of Memory Compaction in LLMs and Agentscited by 4
- 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecturecited by 3
- 2025Disentangling Feature Structure: A Mathematically Provable Two-Stage Training Dynamics in Transformerscited by 3
- 2025Facts in Stats: Impacts of Pretraining Diversity on Language Model Generalizationcited by 3
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 3
- 2026Sharp Capacity Thresholds in Linear Associative Memory: From Top-1 Retrieval to Tail-Average Learningcited by 3
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?cited by 2
- 2025How Transformers Learn In-Context Recall Tasks? Optimality, Training Dynamics and Generalizationcited by 1
- 2026Retrievit: In-context Retrieval Capabilities of Transformers, State Space Models, and Hybrid Architecturescited by 1
- 2026Factual recall in linear associative memories: sharp asymptotics and mechanistic insightscited by 1
- 2026Geometric Factual Recall in Transformerscited by 1
- 2026The Future of Facts: Tracing the Factual Generation-Verification Gapcited by 1
- 2026Fine-Tuning Dynamics of In-Context Factual Recall in Transformerscited by 1
- 2026MLPs are Hebbians: Constructing Efficient Fact-Storing MLPs for Transformerscited by 1
- 2026The Rank the Task Demands: A Causal Rank Law for Matrix Memories Trained on Group Compositioncited by 1
- 2025`Generalization is hallucination' through the lens of tensor completionscited by 0
- 2025Position: Pause Recycling LoRAs and Prioritize Mechanisms to Uncover Limits and Effectivenesscited by 0
- 2025Testing Transformer Learnability on the Arithmetic Sequence of Rooted Treescited by 0
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformerscited by 0
- 2026TIDE: Every Layer Knows the Token Beneath the Contextcited by 0
- 2026A theoretical model for task routing in mixture-of-expert transformerscited by 0
- 2026The Privacy-Hallucination Tradeoff in Differentially Private Language Modelscited by 0
- 2026When the Gradient Sees Rank: Provable Necessity, Causal Recruitment, and Composition in Trained Matrix Memoriescited by 0
- 2026Circuit-Diff: Factual Edit-based Intervention Method for Localizing Knowledge in Attribution Graphscited by 0
- 2026What Pretraining and Midtraining Make Learnable from Rewards?cited by 0
- 2026Constant-Memory Recall: Learned Associations in a Fixed Matrix Statecited by 0
- 2026Muon Learns Facts Better: Understanding the Role of Spectral Orthogonalizationcited by 0
50 most cited of 51 All 51 (JSON)
- 2026Divergence controls entropy in distillation2 Oct 2026
- 2026Muon Learns Facts Better: Understanding the Role of Spectral Orthogonalization2 Oct 2026
- 2026What Pretraining and Midtraining Make Learnable from Rewards?29 Sep 2026
- 2026Constant-Memory Recall: Learned Associations in a Fixed Matrix State23 Sep 2026
- 2026Circuit-Diff: Factual Edit-based Intervention Method for Localizing Knowledge in Attribution Graphs20 Sep 2026
- 2026When the Gradient Sees Rank: Provable Necessity, Causal Recruitment, and Composition in Trained Matrix Memories12 Sep 2026
- 2026The Rank the Task Demands: A Causal Rank Law for Matrix Memories Trained on Group Composition10 Sep 2026
- 2026The Privacy-Hallucination Tradeoff in Differentially Private Language Models31 Aug 2026
- 2026T^2MLR: Transformer with Temporal Middle-Layer Recurrence16 Jul 2026
- 2026MLPs are Hebbians: Constructing Efficient Fact-Storing MLPs for Transformers10 Jul 2026
- 2026What to Keep, What to Forget: A Rate--Distortion View of Memory Compaction in LLMs and Agents9 Jul 2026
- 2026A theoretical model for task routing in mixture-of-expert transformers12 Jun 2026
38 more
- 2026Fine-Tuning Dynamics of In-Context Factual Recall in Transformers26 May 2026
- 2026The Future of Facts: Tracing the Factual Generation-Verification Gap26 May 2026
- 2026Geometric Factual Recall in Transformers12 May 2026
- 2026Factual recall in linear associative memories: sharp asymptotics and mechanistic insights11 May 2026
- 2026TIDE: Every Layer Knows the Token Beneath the Context7 May 2026
- 2026Sharp Capacity Thresholds in Linear Associative Memory: From Top-1 Retrieval to Tail-Average Learning6 May 2026
- 2026There Will Be a Scientific Theory of Deep Learning23 Apr 2026
- 2026Why Fine-Tuning Encourages Hallucinations and How to Fix It16 Apr 2026
- 2026Sharp Capacity Scaling of Spectral Optimizers in Learning Associative Memory27 Mar 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers5 Mar 2026
- 2026Retrievit: In-context Retrieval Capabilities of Transformers, State Space Models, and Hybrid Architectures3 Mar 2026
- 2026Universal Redundancies in Time Series Foundation Models2 Feb 2026
- 2026MemoryLLM: Plug-n-Play Interpretable Feed-Forward Memory for Transformers30 Jan 2026
- 2026Mechanistic Data Attribution: Tracing the Training Origins of Interpretable LLM Units29 Jan 2026
- 2025Testing Transformer Learnability on the Arithmetic Sequence of Rooted Trees1 Dec 2025
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Training10 Nov 2025
- 2025On the Emergence of Induction Heads for In-Context Learning2 Nov 2025
- 2025Language Model Behavioral Phases are Consistent Across Architecture, Training Data, and Scale28 Oct 2025
- 2025Model-Aware Tokenizer Transfer24 Oct 2025
- 2025Facts in Stats: Impacts of Pretraining Diversity on Language Model Generalization17 Oct 2025
- 2025Emergence of Linear Truth Encodings in Language Models17 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2025Muon Outperforms Adam in Tail-End Associative Memory Learning30 Sep 2025
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thought27 Sep 2025
- 2025NIRVANA: Structured Pruning Reimagined for Large Language Model Compression17 Sep 2025
- 2025Position: Pause Recycling LoRAs and Prioritize Mechanisms to Uncover Limits and Effectiveness16 Jun 2025
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2025Mamba Knockout for Unraveling Factual Information Flow30 May 2025
- 2025Recurrent Self-Attention Dynamics: An Energy-Agnostic Perspective from Jacobians26 May 2025
- 2025Data Mixing Can Induce Phase Transitions in Knowledge Acquisition23 May 2025
- 2025How Transformers Learn In-Context Recall Tasks? Optimality, Training Dynamics and Generalization21 May 2025
- 2025Why and How LLMs Hallucinate: Connecting the Dots with Subsequence Associations17 Apr 2025
- 2025How do language models learn facts? Dynamics, curricula and hallucinations27 Mar 2025
- 2025Taming Knowledge Conflicts in Language Models14 Mar 2025
- 2025Disentangling Feature Structure: A Mathematically Provable Two-Stage Training Dynamics in Transformers28 Feb 2025
- 2025`Generalization is hallucination' through the lens of tensor completions24 Feb 2025
- 2025Test-time regression: a unifying framework for designing sequence models with associative memory21 Jan 2025
50 newest of 51 All 51 (JSON)
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thoughtcited by 16
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Trainingcited by 4
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 3
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformerscited by 0
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers5 Mar 2026
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Training10 Nov 2025
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thought27 Sep 2025
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2026Why Fine-Tuning Encourages Hallucinations and How to Fix Itcited by 7
- 2026Divergence controls entropy in distillationcited by 0
- 2026Divergence controls entropy in distillation2 Oct 2026
- 2026Why Fine-Tuning Encourages Hallucinations and How to Fix It16 Apr 2026
- 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 74
- 2025Muon Outperforms Adam in Tail-End Associative Memory Learningcited by 46
- 2025How do language models learn facts? Dynamics, curricula and hallucinationscited by 37
- 2025Taming Knowledge Conflicts in Language Modelscited by 30
- 2026There Will Be a Scientific Theory of Deep Learningcited by 29
- 2025Data Mixing Can Induce Phase Transitions in Knowledge Acquisitioncited by 16
- 2025Why and How LLMs Hallucinate: Connecting the Dots with Subsequence Associationscited by 15
- 2026Sharp Capacity Scaling of Spectral Optimizers in Learning Associative Memorycited by 14
- 2025Language Model Behavioral Phases are Consistent Across Architecture, Training Data, and Scalecited by 13
- 2025Emergence of Linear Truth Encodings in Language Modelscited by 12
- 2026T^2MLR: Transformer with Temporal Middle-Layer Recurrencecited by 7
- 2025NIRVANA: Structured Pruning Reimagined for Large Language Model Compressioncited by 6
12 most cited of 38 All 38 (JSON)
- 2026Muon Learns Facts Better: Understanding the Role of Spectral Orthogonalization2 Oct 2026
- 2026What Pretraining and Midtraining Make Learnable from Rewards?29 Sep 2026
- 2026Constant-Memory Recall: Learned Associations in a Fixed Matrix State23 Sep 2026
- 2026When the Gradient Sees Rank: Provable Necessity, Causal Recruitment, and Composition in Trained Matrix Memories12 Sep 2026
- 2026The Rank the Task Demands: A Causal Rank Law for Matrix Memories Trained on Group Composition10 Sep 2026
- 2026The Privacy-Hallucination Tradeoff in Differentially Private Language Models31 Aug 2026
- 2026T^2MLR: Transformer with Temporal Middle-Layer Recurrence16 Jul 2026
- 2026MLPs are Hebbians: Constructing Efficient Fact-Storing MLPs for Transformers10 Jul 2026
- 2026Fine-Tuning Dynamics of In-Context Factual Recall in Transformers26 May 2026
- 2026The Future of Facts: Tracing the Factual Generation-Verification Gap26 May 2026
- 2026Geometric Factual Recall in Transformers12 May 2026
- 2026Factual recall in linear associative memories: sharp asymptotics and mechanistic insights11 May 2026
12 newest of 38 All 38 (JSON)