[Paper Review] Towards a Mechanistic Interpretation of Multi-Step Reasoning Capabilities of Language Models
This paper introduces MechanisticProbe, a novel attention-based probing method that detects implicit reasoning trees within language models by analyzing attention patterns. The approach successfully recovers reasoning structures in GPT-2 and LLaMA across synthetic and natural language reasoning tasks, demonstrating that models perform multi-step reasoning mechanistically rather than via memorization.
Recent work has shown that language models (LMs) have strong multi-step (i.e., procedural) reasoning capabilities. However, it is unclear whether LMs perform these tasks by cheating with answers memorized from pretraining corpus, or, via a multi-step reasoning mechanism. In this paper, we try to answer this question by exploring a mechanistic interpretation of LMs for multi-step reasoning tasks. Concretely, we hypothesize that the LM implicitly embeds a reasoning tree resembling the correct reasoning process within it. We test this hypothesis by introducing a new probing approach (called MechanisticProbe) that recovers the reasoning tree from the model's attention patterns. We use our probe to analyze two LMs: GPT-2 on a synthetic task (k-th smallest element), and LLaMA on two simple language-based reasoning tasks (ProofWriter & AI2 Reasoning Challenge). We show that MechanisticProbe is able to detect the information of the reasoning tree from the model's attentions for most examples, suggesting that the LM indeed is going through a process of multi-step reasoning within its architecture in many cases.
Motivation & Objective
- Investigate whether large language models (LMs) perform multi-step reasoning via internal mechanistic processes or by recalling memorized answers.
- Address the ambiguity in LMs' reasoning: do they follow procedural logic or rely on pretraining shortcuts?
- Develop a method to mechanistically interpret how LMs encode and execute reasoning steps within their attention mechanisms.
- Validate that attention patterns reflect structured reasoning trees, not just random attention flows.
- Demonstrate that accurate reasoning tree recovery correlates with better model robustness and performance.
Proposed method
- Propose MechanisticProbe, a two-stage non-parametric probing framework to recover reasoning trees from attention patterns.
- First stage: identify useful input statements (nodes) in the reasoning tree using attention patterns.
- Second stage: infer the hierarchical structure (tree heights) of the reasoning process from attention flows.
- Use simple classifiers to detect necessary reasoning nodes and their relative positions in the reasoning chain.
- Apply the probe to GPT-2 on a synthetic k-th smallest element task and LLaMA on ProofWriter and ARC tasks.
- Validate findings via ablation (pruning attention heads) and correlation analysis between probing scores and model robustness.
Experimental results
Research questions
- RQ1Do language models perform multi-step reasoning via internal mechanistic processes, or do they rely on memorized answers?
- RQ2Can attention patterns in LMs encode structured reasoning trees that mirror correct logical derivations?
- RQ3To what extent does the model’s reasoning process correlate with its prediction accuracy and robustness?
- RQ4Are attention heads that contribute to reasoning tree recovery essential for correct predictions?
- RQ5Can probing scores predict model robustness under input perturbations?
Key findings
- MechanisticProbe successfully recovers reasoning trees from attention patterns in both GPT-2 and LLaMA across multiple tasks.
- The model identifies useful input statements early in the network, particularly in bottom layers, supporting a step-by-step reasoning process.
- Pruning attention heads identified by MechanisticProbe leads to significant accuracy degradation, confirming their functional importance.
- Models with higher probing scores (indicating better reasoning tree recovery) show greater robustness to input noise, with test accuracy increasing by ~4% when probing score SP2 is high.
- Examples with high probing scores exhibit stronger prediction confidence and better tolerance to input corruption, suggesting mechanistic reasoning enhances reliability.
- The method reveals that attention mechanisms in LMs are structured to support procedural reasoning, not just associative recall.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.