Lune

EMNLP2023Top-tier venue

Dissecting Recall of Factual Associations in Auto-Regressive Language Models

Mor Geva, Jasmijn Bastings, Katja Filippova, Amir Globerson

Abstract

Transformer-based language models (LMs) are known to capture factual knowledge in their parameters. While previous work looked into where factual associations are stored, only little is known about how they are retrieved internally during inference. We investigate this question through the lens of information flow. Given a subject-relation query, we study how the model aggregates information about the subject and relation to predict the correct attribute. With interventions on attention edges, we first identify two critical points where information propagates to the prediction: one from the relation positions followed by another from the subject positions. Next, by analyzing the information at these points, we unveil a three-step internal mechanism for attribute extraction. First, the representation at the lastsubject position goes through an enrichment process, driven by the early MLP sublayers, to encode many subject-related attributes. Second, information from the relation propagates to the prediction. Third, the prediction representation "queries" the enriched subject to extract the attribute. Perhaps surprisingly, this extraction is typically done via attention heads, which often encode subject-attribute mappings in their parameters. Overall, our findings introduce a comprehensive view of how factual associations are stored and extracted internally in LMs, facilitating future research on knowledge localization and editing. 1

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

223 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Function Vectors in Large Language Models cites Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space
  • Function Vectors in Large Language Models cites Analyzing Transformers in Embedding Space
  • The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A" cites Fast Model Editing at Scale
  • The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A" cites Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space
  • Towards Best Practices of Activation Patching in Language Models: Metrics and Methods cites Progress measures for grokking via mechanistic interpretability
  • Towards Best Practices of Activation Patching in Language Models: Metrics and Methods cites Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Models
  • Towards Best Practices of Activation Patching in Language Models: Metrics and Methods cites Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space
  • Towards Best Practices of Activation Patching in Language Models: Metrics and Methods cites Analyzing Transformers in Embedding Space
  • Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Models cites Fast Model Editing at Scale
  • Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Models cites Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space
  • HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language Models cites Language Models Represent Space and Time
  • HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language Models cites Fast Model Editing at Scale
  • Analyzing Transformers in Embedding Space cites Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers223

  1. The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"Lukas Berglund, Meg Tong, Maximilian Kaufmann, Mikita Balesni et al.ICLR 2024 · 462 citations
  2. HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language ModelsBernal Jimenez Gutierrez, Yiheng Shu, Yu Gu, Michihiro Yasunaga et al.NeurIPS 2024 · 395 citations
  3. Language Models Represent Space and TimeWes Gurnee, Max TegmarkICLR 2024 · 303 citations
  4. Towards Best Practices of Activation Patching in Language Models: Metrics and MethodsFred Zhang, Neel NandaICLR 2024 · 233 citations
  5. Function Vectors in Large Language ModelsEric Todd, Millicent L. Li, Arnab Sen Sharma, Aaron Mueller et al.ICLR 2024 · 229 citations

Builds on10

  1. Fast Model Editing at ScaleEric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn et al.ICLR 2022 · 527 citations
  2. Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language ModelsPeter Hase, Mohit Bansal, Been Kim, Asma GhandehariounNeurIPS 2023 · 307 citations
  3. Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary SpaceMor Geva, Avi Caciularu, Kevin Ro Wang, Yoav GoldbergEMNLP 2022 · 92 citations
  4. Progress measures for grokking via mechanistic interpretabilityNeel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith et al.ICLR 2023 · 54 citations
  5. Analyzing Transformers in Embedding SpaceGuy Dar, Mor Geva, Ankit Gupta, Jonathan BerantACL 2023 · 36 citations

Related papers

  1. Linearity of Relation Decoding in Transformer Language ModelsEvan Hernandez, Arnab Sen Sharma, Tal Haklay, Kevin Meng et al.ICLR 2024 · 163 citations
  2. Do All Autoregressive Transformers Remember Facts the Same Way? A Cross-Architecture Analysis of Recall MechanismsMinyeong Choe, Haehyun Cho, Changho Seo, Hyunil KimEMNLP 2025
  3. Factual Retrieval in LLMs Is a Redundant, Distributed and Non-Contiguous ProcessHail Hochman, Natalie Shapira, Yoav GoldbergACL 2026
  4. A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation AnalysisAlessandro Stolfo, Yonatan Belinkov, Mrinmaya SachanEMNLP 2023 · 11 citations
  5. Relation Also Knows: Rethinking the Recall and Editing of Factual Associations in Auto-Regressive Transformer Language ModelsXiyu Liu, Zhengxiao Liu, Naibin Gu, Zheng Lin et al.AAAI 2025 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines