Table of Contents
Fetching ...

When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compression

Xinnan Dai, Kai Yang, Cheng Luo, Shenglai Zeng, Kai Guo, Jiliang Tang

Abstract

Reasoning hallucinations in large language models (LLMs) often appear as fluent yet unsupported conclusions that violate either the given context or underlying factual knowledge. Although such failures are widely observed, the mechanisms by which decoder-only Transformers produce them remain poorly understood. We model next-token prediction as a graph search process over an underlying graph, where entities correspond to nodes and learned transitions form edges. From this perspective, contextual reasoning is a constrained search over a sampled subgraph (intrinsic reasoning), while context-free queries rely on memorized structures in the underlying graph (extrinsic reasoning). We show that reasoning hallucinations arise from two fundamental mechanisms: \textbf{Path Reuse}, where memorized knowledge overrides contextual constraints during early training, and \textbf{Path Compression}, where frequently traversed multi-step paths collapse into shortcut edges in later training. Together, these mechanisms provide a unified explanation for reasoning hallucinations in LLMs and connected to well-known behaviors observed in downstream applications.

When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compression

Abstract

Reasoning hallucinations in large language models (LLMs) often appear as fluent yet unsupported conclusions that violate either the given context or underlying factual knowledge. Although such failures are widely observed, the mechanisms by which decoder-only Transformers produce them remain poorly understood. We model next-token prediction as a graph search process over an underlying graph, where entities correspond to nodes and learned transitions form edges. From this perspective, contextual reasoning is a constrained search over a sampled subgraph (intrinsic reasoning), while context-free queries rely on memorized structures in the underlying graph (extrinsic reasoning). We show that reasoning hallucinations arise from two fundamental mechanisms: \textbf{Path Reuse}, where memorized knowledge overrides contextual constraints during early training, and \textbf{Path Compression}, where frequently traversed multi-step paths collapse into shortcut edges in later training. Together, these mechanisms provide a unified explanation for reasoning hallucinations in LLMs and connected to well-known behaviors observed in downstream applications.

Paper Structure

This paper contains 38 sections, 3 theorems, 18 equations, 12 figures, 4 tables.

Key Result

Proposition 2.1

Let $\pi^* = (v_1, \dots, v_L)$ be a shortest path in a graph. For any intermediate node $v_k$ where $1 \le k < L$, the suffix $(v_k, \dots, v_L)$ remains a strictly optimal shortest path from $v_k$ to $v_L$. $\blacktriangleleft$$\blacktriangleleft$

Figures (12)

  • Figure 1: Reasoning Hallucinations from Underlying Graph Structures. (a) Building up the underlying graph for the implicit knowledge structure (b) In intrinsic reasoning, the model reuses common paths and hallucinates a direct relation (John → Scott) instead of the correct reasoning provided in context (John → Kim → Scott). (c) In extrinsic reasoning, long reasoning chains (David → John → Kim → Scott) are compressed into shorter paths (David → Kim → Scott), causing hallucinated relations via path compression.
  • Figure 2: Training evolution in conditional reasoning. (a) Accuracy trajectories under a 20% training set. The persistent gap between global and local accuracy indicates the emergence of hallucinations. (b) Accuracy trajectories under a 0.1% training set. Hallucinations persist and cannot be resolved by simply increasing the number of training steps. The zoomed-out view further shows that, at later stages of training, the Exist Acc gradually deteriorates and Global Acc is not stable.
  • Figure 3: Path Compression. (a) Accuracy degradation during training across graph settings. (b) Errors are biased toward k-hop neighbors. (c) Path-compression hallucinations via implicit k-hop edge creation. (d) Accumulation of high–out-degree nodes in erroneous predictions.
  • Figure 4: Error Understanding. (a) Prediction errors decrease as the out-degree of the start nodes increases. (b) Path compression reveals a tendency to bypass bridge nodes, directly jumping across communities.
  • Figure 5: Uncompressed ratio under different model settings. (a) Increasing the number of layers does not prevent the decline of the uncompressed ratio. (b) The uncompressed ratio consistently declines across different next-token prediction frameworks.
  • ...and 7 more figures

Theorems & Definitions (8)

  • Definition 3.1: Underlying Reasoning Graph
  • Definition 3.2: Valid Reasoning Path
  • Proposition 2.1: Substructure Property of Shortest Paths
  • proof
  • Proposition 2.3: Condition for Hallucinating Shortcuts
  • proof
  • Proposition 2.4: Generalized Condition for Shortcut Hallucination
  • proof