mlsanityData to 7 Oct 2026

Why Knowing Both Hops Is Not Enough: Understanding Two-Hop Generalization in Language Models

arXiv 2608.07261 ↗First posted 7 Aug 2026cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) can solve complex multi-hop problems yet exhibit puzzling failures on simple two-hop queries: although a model may correctly store each individual hop, it often fails to combine them. To understand the internal mechanisms of this phenomenon, we train transformers from scratch in a controlled symbolic environment. Our experiments reveal a pattern in two-hop generalization: models generalize reliably when the second hop follows the training distribution, but always fail when it deviates. Through mechanistic analysis, we provide a complete explanation for these distinct generalization behaviors: in settings where models generalize successfully, performance is driven by the emergence of consistent intermediate representations for the same entities across contexts, whereas failures on settings where the second hop is out-of-distribution arise from a mismatch across layers: lower layers correctly construct these intermediate representations, but upper layers, while trained on corresponding atomic facts, primarily learn to map them to outputs rather than to reason over them. Driven by this insight, we propose a recurrent-style training strategy, which enables transformers to reuse their reasoning circuitry across input forms and substantially improves generalization on out-of-distribution two-hop queries. Our data and code are available at https://github.com/zzl-strong/two_hop .

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 25 of its 40 references that are in the map. First posted on arXiv 7 Aug 2026.

Builds on

25 of 40 references.

References · 25

  1. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  2. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
  3. 2022Locating and Editing Factual Associations in GPTcited by 2,609
  4. 2022Measuring and Narrowing the Compositionality Gap in Language Modelscited by 1,054
  5. 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 512
  6. 2024Improve Mathematical Reasoning in Language Models by Automated Process Supervisioncited by 426
  7. 2024From Explicit CoT to Implicit CoT: Learning to Internalize CoT Step by Stepcited by 225
  8. 2024Do Large Language Models Latently Perform Multi-Hop Reasoning?cited by 165
  9. 2025Scaling Latent Reasoning via Looped Language Modelscited by 145
  10. 2023Looped Transformers are Better at Learning Learning Algorithmscited by 135
  11. 2023Taken out of context: On measuring situational awareness in LLMscited by 131
  12. 2024Hopping Too Late: Exploring the Limitations of Large Language Models on Multi-Hop Queriescited by 78
13 more
  1. 2024Steering Knowledge Selection Behaviours in LLMs via SAE-Based Representation Engineeringcited by 60
  2. 2024Understanding and Patching Compositional Reasoning in LLMscited by 45
  3. 2023The Impact of Depth on Compositional Generalization in Transformer Language Modelscited by 37
  4. 2023VISIT: Visualizing and Interpreting the Semantic Information Flow of Transformerscited by 32
  5. 2024Interpreting Arithmetic Mechanism in Large Language Models through Comparative Neuron Analysiscited by 31
  6. 2025Back Attention: Understanding and Enhancing Multi-Hop Reasoning in Large Language Modelscited by 23
  7. 2025How Do LLMs Perform Two-Hop Reasoning in Context?cited by 20
  8. 2022Does Your Model Classify Entities Reasonably? Diagnosing and Mitigating Spurious Correlations in Entity Typingcited by 16
  9. 2024Lessons from Studying Two-Hop Latent Reasoningcited by 15
  10. 2024Evolution of SAE Features Across Layers in LLMscited by 14
  11. 2024Extractive Structures Learned in Pretraining Enable Generalization on Finetuned Factscited by 13
  12. 2025Grokking in the Wild: Data Augmentation for Real-World Multi-Hop Reasoning with Transformerscited by 12
  13. 2025How Do Language Models Compose Functions?cited by 7

Built on by

Not cited yet.