Agent Module Mechanisms

Mechanistic Detection and Mitigation of Hallucination in Large Reasoning Models

RHD moves hallucination analysis from final answers to reasoning trajectories. It characterizes early fluctuation, shallow pattern matching, erroneous backtracking, and pseudo-verification in multi-step reasoning, then uses process-level reward constraints to mitigate these failures.

ICLR 2026 First author Zhongxiang Sun, Qipeng Wang, Haoyu Wang, Xiao Zhang, Jun Xu
RHD / GRPO-R visual abstract

A temporal neural-dynamics account of reasoning hallucination in large reasoning models.

When a large reasoning model produces a wrong answer, where does the hallucination actually form across the reasoning trajectory?

From the research problem to mechanism and evidence

The figures below follow their order in the paper. Each section connects the figure to the question it resolves and the conclusion it supports.

1

Method

Measuring reasoning trajectories

The method figure shows how hidden states, LogitLens vocabulary distributions, Reasoning Score, CV Score, and Attention Score are computed across steps.

RHD / GRPO-R Measuring reasoning trajectories figure

The left side starts from the transformer decoder layer: multi-self-attention and FFN update hidden states, and LogitLens converts intermediate states into vocabulary distributions. The center grid then tracks distributions over reasoning steps c1, c2, c3, ..., cK.

The colored triangles at the top represent step-level reasoning states used to compute R_score from early to later steps. The right side defines CV Score as sigma over mean. Attention Score measures the fraction of top-attended earlier steps whose Reasoning Scores fall in shallow or overthinking ranges. This figure is the exact measurement pipeline behind later "fluctuating", "stable", and "misguided attention" claims.

How to read this figure
  • Follow hidden state h through LogitLens to see where the per-step vocabulary distributions come from.
  • Read R_score as the trajectory's reasoning-strength signal over steps.
  • Read CV Score as early trajectory fluctuation and Attention Score as later attention to shallow or overthinking steps.
2

Problem

A trajectory can go wrong before the answer

The case figure compares a fluctuating hallucinated trajectory with a stable truthful trajectory on the same inflation word problem.

RHD / GRPO-R A trajectory can go wrong before the answer figure

The question asks how much Liam should pay now, given prices were 10 percent cheaper last year. The left plot shows a hallucinated trajectory with a fluctuating R_score curve across about 100 steps; the right plot shows a shorter truthful trajectory with a more stable R_score curve.

The bottom text boxes tie the curves to concrete reasoning events. Step 2 to Step 3 is a correct verification even in the hallucinated trace. Step 44 to Step 45 is labeled incorrect verification and overthinking. Step 73 is labeled incorrect backtracking or misguided attention, leading to the wrong final answer 261.9 instead of the golden answer 291. The figure therefore makes the failure temporally localizable.

How to read this figure
  • Use the red callouts to connect score fluctuations with named failure events.
  • Compare Step 44 to Step 45 and Step 73 with the truthful Step 23 to Step 24 verification.
  • The visible wrong answer, 261.9 versus golden answer 291, is the endpoint of earlier trajectory instability.
3

Results

Validating misled reasoning patterns

The result figure validates the scoring scheme with three bar charts: reasoning score, CV score, and attention score.

RHD / GRPO-R Validating misled reasoning patterns (a) Reasoning Score validation on GSM-NoOp panel

(a) Reasoning Score validation on GSM-NoOp

RHD / GRPO-R Validating misled reasoning patterns (b) Pattern #1 early fluctuation on ReTruthQA panel

(b) Pattern #1 early fluctuation on ReTruthQA

RHD / GRPO-R Validating misled reasoning patterns (c) Pattern #2 misguided attention on ReTruthQA panel

(c) Pattern #2 misguided attention on ReTruthQA

Panel (a) compares mean reasoning score for misleading and non-misleading steps: the non-misleading bar is higher, matching the interpretation that better reasoning steps should carry stronger reasoning signal.

Panels (b) and (c) compare truth versus hallucination on CV Score and Attention Score. Hallucination has higher CV Score and higher Attention Score in the visible bars, aligning with the case figure's story that hallucinated traces fluctuate more and concentrate attention on misleading steps.

How to read this figure
  • Panel (a) validates R_score against misleading versus non-misleading reasoning states.
  • Panel (b) links hallucination to higher trajectory fluctuation.
  • Panel (c) links hallucination to stronger attention concentration on problematic reasoning steps.
4

Results

Connecting dynamics with reliability

The consistency analysis combines pie charts, bar charts, and a scatter plot to connect rising consistency, reasoning score, and perplexity.

RHD / GRPO-R Connecting dynamics with reliability (a) Consistency analysis panel

(a) Consistency analysis

RHD / GRPO-R Connecting dynamics with reliability (b) Rising-2 accuracy comparison panel

(b) Rising-2 accuracy comparison

RHD / GRPO-R Connecting dynamics with reliability (c) Reasoning score versus perplexity panel

(c) Reasoning score versus perplexity

RHD / GRPO-R Connecting dynamics with reliability (d) Rising-2 versus stable perplexity panel

(d) Rising-2 versus stable perplexity

Panels (a) and (b) compare rising consistency and stable consistency. The pie charts show that rising consistency contains a much larger inconsistent portion than stable consistency, and the adjacent bar chart compares the consistency ratio between successive steps.

Panel (c) plots perplexity against Reasoning Score and shows a downward trend: higher reasoning score corresponds to lower perplexity in the visible scatter. Panel (d) compares mean perplexity for rising-2 and stable conditions. These panels connect the trajectory scores to reliability and uncertainty, not just to qualitative examples.

How to read this figure
  • Use panels (a)-(b) to read consistency as a step-to-step property, not a final-answer property.
  • Use panel (c) to connect R_score with perplexity through the visible negative trend.
  • Use panel (d) to see that the trajectory pattern has a measurable uncertainty signature.

Main experimental results

RHD is tested both as a detector of reasoning hallucinations and as a process signal for mitigation. The first table reports RHD's AUC and MC3 across ReTruthQA domains; the second shows how GRPO-R changes downstream reasoning accuracy.

Reasoning hallucination detection on ReTruthQA

BackboneMATH AUCMATH MC3Science AUCScience MC3MultiHop AUCMultiHop MC3
R1-7B + RHD0.79780.56990.71940.60090.73610.7103
R1-14B + RHD0.72920.46440.76860.56710.72550.5154

AUC evaluates binary detection; MC3 evaluates multi-trace ranking. Values are on a 0-1 scale.

Reasoning hallucination mitigation with GRPO-R

BackboneMethodMATH500AIMEGPQA-DGPQA-MGPQA-E
DeepSeek-R1-1.5BGRPO0.7700.3330.3590.3350.359
DeepSeek-R1-1.5BGRPO-R0.7880.3670.4140.3710.357
Qwen2.5-1.5BGRPO0.4800.0330.2470.2140.266
Qwen2.5-1.5BGRPO-R0.4900.1330.2470.2430.275

Accuracy on MATH500, AIME 2024, and GPQA. Values are on a 0-1 scale.

What the results show

  • RHD achieves the strongest AUC reported in the main table across all three domains for both R1-7B and R1-14B.
  • GRPO-R improves eight of ten benchmark-backbone comparisons, ties one, and is slightly lower on one GPQA-extended comparison.
  • The mitigation results connect diagnosis to control: the same reasoning-depth signal used to detect unstable trajectories can shape more reliable policies.

What this project establishes

1

Reasoning Score separates shallow and deep reasoning steps

On GSM-NoOp, steps misled by semantically irrelevant phrases receive lower Reasoning Scores than non-misled steps. This validates the score as an internal signal for shallow pattern matching.

2

Two trajectory patterns localize reasoning hallucination

Hallucinated traces show larger early-stage variation in Reasoning Score and stronger late-stage attention to earlier shallow or overthinking steps. CV Score and Attention Score operationalize these two patterns.

3

Overthinking has a measurable uncertainty signature

The mechanism analysis links rising Reasoning Score patterns with consistency changes and perplexity. Excessive score increases can correspond to overthinking and spurious verification instead of reliable correction.

4

GRPO-R turns diagnosis into step-level reward

GRPO-R adds the mechanism-derived deep-reasoning signal to reinforcement learning through potential-based shaping. The reward acts on intermediate steps while preserving the outcome objective.

Position in the broader research program

RHD contributes the temporal reasoning layer of the Cognitive Neuroscience of AI Agents program. It makes reasoning paths observable in a way that answer-only evaluation cannot.

This matters for any agent that plans, searches, proves, or debugs over many steps. A reliable agent must know not only whether its final answer is correct, but whether the path that produced the answer remained stable, evidence-sensitive, and self-correcting.

Resources and Citation

@inproceedings{sun2026mechanistic,
  title={Mechanistic Detection and Mitigation of Hallucination in Large Reasoning Models},
  author={Sun, Zhongxiang and Wang, Qipeng and Wang, Haoyu and Zhang, Xiao and Xu, Jun},
  booktitle={The Fourteenth International Conference on Learning Representations},
  year={2026}
}