TL;DR
Researchers have uncovered a sequential "reasoning pathway" inside Large Language Models (LLMs) that explains how they tackle multi-hop queries. By identifying that models often fail because they "run out of layers" to complete the final reasoning step, the authors introduced a novel back-patching technique that can recover the correct answer in up to 66% of previously failed cases.
What Problem Does This Paper Address?
LLMs are surprisingly good at answering complex questions like "The spouse of the performer of Imagine is...", which requires connecting two distinct facts:
- Hop 1: The performer of Imagine is John Lennon.
- Hop 2: The spouse of John Lennon is Yoko Ono.
Despite their success, LLMs frequently stumble on these "multi-hop" queries even when they clearly "know" the individual facts in isolation. The internal mechanics—how the model moves from the first entity (Imagine) to the bridge entity (John Lennon) and finally to the target (Yoko Ono)—have remained largely a mystery. This paper aims to map this internal reasoning pathway and understand why it breaks down.
Methods
The authors employed several mechanistic interpretability tools to peek under the hood:
- Patchscopes: A sophisticated probing framework that decodes the semantic content of a hidden representation by "patching" it into a separate prompt designed to describe an entity. This allows researchers to see which entity a specific layer is "thinking about."
- Attention Knockout: Systematically blocking the flow of information between tokens at specific layers to identify which connections are critical for the final answer.
- Logit Lens / Vocabulary Projection: Projecting the updates from individual sublayers (MLPs and Attention) directly into the model's vocabulary to see which concepts they are promoting.
- Back-patching (Novel): The authors' key innovation. They take a hidden representation from a later layer (where the bridge entity has been resolved) and inject it back into an earlier layer of the same prompt. This effectively gives the model "extra layers" to finish its computation.
Datasets
The study introduces a new dataset of 82,020 two-hop queries derived from Wikidata.
- Filtering for Shortcuts: The authors carefully filtered the data to ensure the model wasn't just guessing based on simple correlations (e.g., guessing "Yoko Ono" just because "Imagine" appeared in the prompt, without actually "reasoning" through John Lennon).
- Comparative Subsets: They created two specific subsets for analysis:
- Correct: Cases where the model successfully answers the multi-hop query.
- Incorrect: Cases where the model knows both individual facts but fails the combined multi-hop query.
Key Insights and Ideas
- The Sequential Pathway: Reasoning isn't a single "aha!" moment. It happens in three distinct stages:
- Early Layers: The first hop is resolved at the position of the first entity (e.g., Imagine).
- Middle Layers: This "bridge" information propagates to the very last token in the prompt.
- Late Layers: The second hop is resolved at the last token, finally producing the target answer.
- "Hopping Too Late": In cases where the model fails, the first hop is often resolved significantly later in the network than in successful cases.
- Layer Specialization: The model's layers are not interchangeable. Early layers seem specialized for the first "knowledge extraction" step. If the first hop takes too long to resolve, the bridge entity only reaches the final token in the upper layers, which may lack the specific machinery needed to perform the second hop.
Key Results
- Back-patching Success: By manually moving information from later layers back to earlier ones, the researchers could fix 32% to 66% of incorrect cases across different models (LLaMA 2, LLaMA 3, Pythia). This proves that the failure isn't necessarily a lack of knowledge, but a structural limitation in how that knowledge is processed over the available layers.
- MLP Dominance: The study found that MLP sublayers generally play a larger role than attention sublayers in "conjuring" the final predicted token once the reasoning is complete.
- Model Scaling: Larger models like LLaMA 3 70B showed more robust information propagation, though they still exhibited the same sequential bottleneck.
Limitations and Future Work
- Not a Practical Inference Fix: Currently, back-patching requires knowing the "correct" source and target layers, which isn't known ahead of time during standard inference.
- Scope: The study focused exclusively on two-hop queries. Extending this to three or more hops remains for future work.
- Approximation: The tools used (Patchscopes, Logit Lens) are approximations of internal states, not perfect mirrors.
- Future Directions: The authors suggest that finding ways to "a priori" select layers for back-patching could lead to more robust multi-hop reasoning without needing expensive Chain-of-Thought prompting.
Summary updated