mlsanityData to 7 Oct 2026

Interpreting Key Mechanisms of Factual Recall in Transformer-Based Language Models

arXiv 2403.19521 ↗First posted 28 Mar 2024cs.CL cs.AI cs.LGcited by 30

Not on the map. Why?

Abstract (arXiv)

In this paper, we delve into several mechanisms employed by Transformer-based language models (LLMs) for factual recall tasks. We outline a pipeline consisting of three major steps: (1) Given a prompt ``The capital of France is,'' task-specific attention heads extract the topic token, such as ``France,'' from the context and pass it to subsequent MLPs. (2) As attention heads' outputs are aggregated with equal weight and added to the residual stream, the subsequent MLP acts as an ``activation,'' which either erases or amplifies the information originating from individual heads. As a result, the topic token ``France'' stands out in the residual stream. (3) A deep MLP takes ``France'' and generates a component that redirects the residual stream towards the direction of the correct answer, i.e., ``Paris.'' This procedure is akin to applying an implicit function such as ``getcapital(X),'' and the argument X is the topic token information passed by attention heads. To achieve the above quantitative and qualitative analysis for MLPs, we proposed a novel analytic method aimed at decomposing the outputs of the MLP into components understandable by humans. Additionally, we observed a universal anti-overconfidence mechanism in the final layer of models, which suppresses correct predictions. We mitigate this suppression by leveraging our interpretation to improve factual recall confidence. The above interpretations are evaluated across diverse tasks spanning various domains of factual knowledge, using various language models from the GPT-2 families, 1.3B OPT, up to 7B Llama-2, and in both zero- and few-shot setups.

Key facts. Cited by 30 papers in the map (data through 7 Oct 2026). Builds on 32 of its 51 references that are in the map. First posted on arXiv 28 Mar 2024.

Builds on

32 of 51 references.

References · 32

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  5. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  6. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  7. 2022Locating and Editing Factual Associations in GPTcited by 2,609
  8. 2023A Survey of Large Language Modelscited by 2,537
  9. 2019Fine-Tuning Language Models from Human Preferencescited by 2,124
  10. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  11. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
  12. 2022In-context Learning and Induction Headscited by 930
20 more
  1. 2022Toy Models of Superpositioncited by 928
  2. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 700
  3. 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 512
  4. 2023Towards Best Practices of Activation Patching in Language Models: Metrics and Methodscited by 328
  5. 2013Direct and Indirect Effectscited by 276
  6. 2024Do Llamas Work in English? On the Latent Language of Multilingual Transformerscited by 275
  7. 2023Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchillacited by 145
  8. 2023The Hydra Effect: Emergent Self-repair in Language Model Computationscited by 145
  9. 2024CharacterEval: A Chinese Benchmark for Role-Playing Conversational Agent Evaluationcited by 139
  10. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
  11. 2023Circuit Component Reuse Across Tasks in Transformer Language Modelscited by 105
  12. 2023Is This the Subspace You Are Looking for? An Interpretability Illusion for Subspace Activation Patchingcited by 75
  13. 2023Characterizing Mechanisms for Factual Recall in Language Modelscited by 47
  14. 2024Competition of Mechanisms: Tracing How Language Models Handle Facts and Counterfactualscited by 40
  15. 2023Neuron-Level Knowledge Attribution in Large Language Modelscited by 37
  16. 2023Fortify the Shortest Stave in Attention: Enhancing Context Awareness of Large Language Models for Effective Tool Usecited by 27
  17. 2023An Analysis and Mitigation of the Reversal Cursecited by 22
  18. 2024Monotonic Representation of Numeric Properties in Language Modelscited by 15
  19. 2023An Adversarial Example for Direct Logit Attribution: Memory Management in GELU-4Lcited by 10
  20. 2023Transformer Language Models Handle Word Frequency in Prediction Headcited by 8

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 12; 2025: 12; 2026: 6.

30 papers.

Sort:

By area:

  1. 2024Hymba: A Hybrid-head Architecture for Small Language Modelscited by 95
  2. 2024A Primer on the Inner Workings of Transformer-based Language Modelscited by 83
  3. 2024Attention Heads of Large Language Models: A Surveycited by 65
  4. 2024Knowledge Circuits in Pretrained Transformerscited by 60
  5. 2024Understanding Factual Recall in Transformers via Associative Memoriescited by 45
  6. 2024Memory3: Language Modeling with Explicit Memorycited by 39
  7. 2025Taming Knowledge Conflicts in Language Modelscited by 27
  8. 2024Mixture of In-Context Experts Enhance LLMs' Long Context Awarenesscited by 17
  9. 2025Knowledge Updating? No More Model Editing! Just Selective Contextual Reasoningcited by 15
  10. 2024Mixture-of-Modules: Reinventing Transformers as Dynamic Assemblies of Modulescited by 11
  11. 2025Revealing and Mitigating Over-Attention in Knowledge Editingcited by 8
  12. 2025Autonomy-of-Experts Modelscited by 7
18 more
  1. 2026Instruction Anchor: Dissecting the Mechanistic Dynamics of Modality Arbitrationcited by 6
  2. 2025AttentionInfluence: Adopting Attention Head Influence for Weak-to-Strong Pretraining Data Selectioncited by 5
  3. 2024ResiDual Transformer Alignment with Spectral Decompositioncited by 4
  4. 2025HARP: Hallucination Detection via Reasoning Subspace Projectioncited by 4
  5. 2025Unveiling the Mechanisms of Multi-Hop Reasoning in Transformers via Identity Bridgecited by 3
  6. 2025Facts in Stats: Impacts of Pretraining Diversity on Language Model Generalizationcited by 3
  7. 2025DeepInsert: Early Layer Bypass for Efficient and Performant Multimodal Understandingcited by 2
  8. 2025AIR: Post-training Data Selection for Reasoning via Attention Head Influencecited by 2
  9. 2024PEAR: Position-Embedding-Agnostic Attention Re-weighting Enhances Retrieval-Augmented Generation with Zero Inference Overheadcited by 1
  10. 2025Order-Level Attention Similarity Across Language Models: A Latent Commonalitycited by 1
  11. 2024LargePiG: Your Large Language Model is Secretly a Pointer Generatorcited by 0
  12. 2024Information Anxiety in Large Language Modelscited by 0
  13. 2025Benchmarking and Rethinking Knowledge Editing for Large Language Modelscited by 0
  14. 2026Listen to the Layers: Mitigating Hallucinations with Inter-Layer Disagreementcited by 0
  15. 2026Do Transformers Use their Depth Adaptively? Evidence from a Relational Reasoning Taskcited by 0
  16. 2026Context-Gated Associative Retrieval: From Theory to Transformerscited by 0
  17. 2026Relational Linear Properties in Language Models: An Empirical Investigationcited by 0
  18. 2026The System Prompt Illusion: How Instruction Preambles Modify Computation in Language Modelscited by 0