mlsanityData to 14 Oct 2026

Fine-Tuning Dynamics of In-Context Factual Recall in Transformers

arXiv 2605.27774 ↗First posted 26 May 2026cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

In-context learning -- performing tasks based on examples given in the prompt -- is an important capability that has emerged in large language models and has received significant attention in both theory and practice. Existing theoretical work often focuses on settings where the learning uses information purely from the prompt. However, many practical instances of in-context learning require the model to retrieve factual knowledge stored in the model's parameters, with the context serving to identify which knowledge is relevant. In this work, we study how in-context learning leverages factual knowledge recall. We formalize this behavior by introducing the in-context factual recall (IC-recall) task, where a transformer is provided a context of (subject, answer) pairs generated from a hidden relation, along with a query subject, and must both infer this hidden relation and retrieve the corresponding answer. Factual knowledge is modeled by the transformer having access to a simple pre-constructed MLP associative memory storing (subject, relation, answer) triplets. We analyze the supervised fine-tuning dynamics of a one-layer transformer on IC-recall data and prove that the model successfully performs IC-recall by converging to a particular pairwise attention pattern. This fine-tuning stage requires a very small number of samples -- only polylogarithmic in the number of stored knowledge triplets. Experiments verify our theoretical predictions and show that the pairwise attention pattern emerges even when the MLP layer is pretrained instead of constructed.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 34 of its 37 references that are in the map. First posted on arXiv 26 May 2026.

Builds on

34 of 37 references.

References · 34

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  4. 2019Language Models as Knowledge Bases?cited by 1,936
  5. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  6. 2022In-context Learning and Induction Headscited by 964
  7. 2022Transformers learn in-context by gradient descentcited by 732
  8. 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 719
  9. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  10. 2021Knowledge Neurons in Pretrained Transformerscited by 601
  11. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  12. 2017How to Escape Saddle Points Efficientlycited by 285
22 more
  1. 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 260
  2. 2024Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Lawscited by 144
  3. 2022A Kernel-Based View of Language Model Fine-Tuningcited by 121
  4. 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 118
  5. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
  6. 2024Learning Dynamics of LLM Finetuningcited by 95
  7. 2024Understanding Factual Recall in Transformers via Associative Memoriescited by 51
  8. 2024Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformerscited by 50
  9. 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 50
  10. 2024How Far Can Transformers Reason? The Globality Barrier and Inductive Scratchpadcited by 36
  11. 2025Learning Compositional Functions with Transformers from Easy-to-Hard Datacited by 36
  12. 2023Scaling Laws for Associative Memoriescited by 35
  13. 2024Understanding Finetuning for Factual Knowledge Extractioncited by 32
  14. 2024From Sparse Dependence to Sparse Attention: Unveiling How Chain-of-Thought Enhances Transformer Sample Efficiencycited by 29
  15. 2024Learning Associative Memories with Gradient Descentcited by 16
  16. 2026Thinking to Recall: How Reasoning Unlocks Parametric Knowledge in LLMscited by 16
  17. 2024Understanding the Interplay between Parametric and Contextual Knowledge for Large Language Modelscited by 15
  18. 2025LENSLLM: Unveiling Fine-Tuning Dynamics for LLM Selectioncited by 14
  19. 2024Does Knowledge Localization Hold True? Surprising Differences Between Entity and Relation Perspectives in Language Modelscited by 9
  20. 2025Provable In-Context Vector Arithmetic via Retrieving Task Conceptscited by 8
  21. 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 3
  22. 2026Geometric Factual Recall in Transformerscited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.