mlsanityData to 14 Oct 2026

Memory Injections: Correcting Multi-Hop Reasoning Failures during Inference in Transformer-Based Language Models

arXiv 2309.05605 ↗First posted 11 Sep 2023cs.CL cs.AI cs.LGcited by 21

On the map: LLM reasoning → Knowledge- and tool-augmented reasoning

Abstract (arXiv)

Answering multi-hop reasoning questions requires retrieving and synthesizing information from diverse sources. Large Language Models (LLMs) struggle to perform such reasoning consistently. Here we propose an approach to pinpoint and rectify multi-hop reasoning failures through targeted memory injections on LLM attention heads. First, we analyze the per-layer activations of GPT-2 models in response to single and multi-hop prompts. We then propose a mechanism that allows users to inject pertinent prompt-specific information, which we refer to as "memories," at critical LLM locations during inference. By thus enabling the LLM to incorporate additional relevant information during inference, we enhance the quality of multi-hop prompt completions. We show empirically that a simple, efficient, and targeted memory injection into a key attention layer can often increase the probability of the desired next token in multi-hop tasks, by up to 424%.

Key facts. Cited by 21 papers in the map (data through 14 Oct 2026). Placed in Knowledge- and tool-augmented reasoning, one of 17 directions in LLM reasoning. Builds on 37 of its 43 references that are in the map. First posted on arXiv 11 Sep 2023.

Builds on

37 of 43 references.

Closest ancestors · 1

Same direction, newest first

  1. 2022UniKGQA: Unified Retrieval and Reasoning for Solving Multi-hop Question Answering Over Knowledge Graph2 Dec

Other references · 36

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  5. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  6. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
  7. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  8. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  9. 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,282
  10. 2023Language Models Don't Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Promptingcited by 1,122
  11. 2022Mass-Editing Memory in a Transformercited by 1,001
  12. 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 886
24 more
  1. 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
  2. 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 623
  3. 2021Knowledge Neurons in Pretrained Transformerscited by 601
  4. 2021Editing Factual Knowledge in Language Modelscited by 553
  5. 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
  6. 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 528
  7. 2021Fast Model Editing at Scalecited by 498
  8. 2022Memory-Based Model Editing at Scalecited by 447
  9. 2021Measuring and Improving Consistency in Pretrained Language Modelscited by 364
  10. 2023MQuAKE: Assessing Knowledge Editing in Language Models via Multi-Hop Questionscited by 300
  11. 2021Time-Aware Language Models as Temporal Knowledge Basescited by 296
  12. 2023Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Modelscited by 243
  13. 2023Evaluating the Ripple Effects of Knowledge Editing in Language Modelscited by 242
  14. 2023Large Language Model Guided Tree-of-Thoughtcited by 221
  15. 2023Transformer-Patcher: One Mistake worth One Neuroncited by 197
  16. 2021Towards Continual Knowledge Learning of Language Modelscited by 174
  17. 2023PMET: Precise Model Editing in a Transformercited by 173
  18. 2018Open Domain Question Answering Using Early Fusion of Knowledge Bases and Textcited by 168
  19. 2022Analyzing Transformers in Embedding Spacecited by 132
  20. 2022Subgraph Retrieval Enhanced Model for Multi-hop Knowledge Base Question Answeringcited by 93
  21. 2021Do Language Models Have Beliefs? Methods for Detecting, Updating, and Visualizing Model Beliefscited by 79
  22. 2023Can GPT-3 Perform Statutory Reasoning?cited by 73
  23. 2023GPT-4 Can't Reasoncited by 40
  24. 2022Neural Knowledge Bank for Pretrained Transformerscited by 16

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 2; 2024: 9; 2025: 9; 2026: 1.

21 papers.

Sort:

By area:

  1. 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 422
  2. 2024Hopping Too Late: Exploring the Limitations of Large Language Models on Multi-Hop Queriescited by 78
  3. 2024Demystifying Chains, Trees, and Graphs of Thoughtscited by 63
  4. 2024Knowledge Circuits in Pretrained Transformerscited by 60
  5. 2024LoFiT: Localized Fine-tuning on LLM Representationscited by 57
  6. 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 50
  7. 2025Towards Understanding Distilled Reasoning Models: A Representational Approachcited by 26
  8. 2023Attention Lens: A Tool for Mechanistically Interpreting the Attention Head Information Retrieval Mechanismcited by 22
  9. 2024Distributional reasoning in LLMs: Parallel reasoning processes in multi-hop reasoningcited by 21
  10. 2023Assessing Knowledge Editing in Language Models via Relation Perspectivecited by 15
  11. 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 15
  12. 2025Compositional Generalization from Learned Skills via CoT Training: A Theoretical and Structural Analysis for Reasoningcited by 10
9 more
  1. 2024Breaking Chains: Unraveling the Links in Multi-Hop Knowledge Unlearningcited by 8
  2. 2025Model Directions, Not Words: Mechanistic Topic Models Using Sparse Autoencoderscited by 8
  3. 2025Too Late to Recall: Explaining the Two-Hop Problem in Multimodal Knowledge Retrievalcited by 7
  4. 2025Unboxing the Black Box: Mechanistic Interpretability for Algorithmic Understanding of Neural Networkscited by 6
  5. 2025CryptoX : Compositional Reasoning Evaluation of Large Language Modelscited by 5
  6. 2025All for One: LLMs Solve Mental Math at the Last Token With Information Transferred From Other Tokenscited by 5
  7. 2025Dynamic Weight Grafting: Localizing Finetuned Factual Knowledge in Transformerscited by 3
  8. 2025Data Shifts Hurt CoT: A Theoretical Studycited by 2
  9. 2026Scaling Reasoning Hop Exposes Weaknesses: Demystifying and Improving Hop Generalization in Large Language Modelscited by 1

Similar, not cited

Close in wording, no citation either way

  1. 2024Towards Interpreting Language Models: A Case Study in Multi-Hop Reasoning
  2. 2023Uncertainty Guided Global Memory Improves Multi-Hop Question Answering
  3. 2026Layer-Order Inversion: Rethinking Latent Multi-Hop Reasoning in Large Language Models
  4. 2024Enhancing Multi-hop Reasoning through Knowledge Erasure in Large Language Model Editing
  5. 2024Large Language Models Still Face Challenges in Multi-Hop Reasoning with External Knowledge
  6. 2025Can Memory-Augmented Language Models Generalize on Reasoning-in-a-Haystack Tasks?
  7. 2025Back Attention: Understanding and Enhancing Multi-Hop Reasoning in Large Language Models
  8. 2026G-MemLLM: Gated Latent Memory Augmentation for Long-Context Reasoning in Large Language Models