When Do Hallucinations Arise? A Graph Perspective on the Evolution of Path Reuse and Path Compression
Organizations: Michigan State University · University of Michigan · Independent Researcher
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: Path Reuse, where memorized knowledge overrides contextual constraints during early training, and 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.
Figures & tables
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
|---|---|
| Hidden size ( ) | 512 |
| Sequence length (block size) | 128 |
| Learning rate | |
| Optimizer | AdamW |
| Weight decay | 0.1 |
| Learning rate scheduler | Cosine |
| Parameter | LLaMA | Mixtral | Qwen2 |
| Hidden size ( ) | 512 | ||
| FFN hidden size | |||
| Number of layers | 6 | ||
| Attention heads | 16 | ||
| Key-value heads (GQA) | 8 | ||
| Head dimension | 64 | ||
| epoch-1 | epoch-7 | epoch-49 | time (ms) | |
|---|---|---|---|---|
| 1197.10 | ||||
| 1805.54 | ||||
| 324.62 | ||||
| 375.81 | ||||
| 199.79 | ||||
| 393.95 |
| Dataset | #Node | #Edge | #Community | Internal degree | External degree |
|---|---|---|---|---|---|
| GSM8K (Math) | 1406 | 5084 | 71 | 0.383 | 0.002 |
| APPS (Code) | 12454 | 112184 | 136 | 0.389 | 0.001 |
| DocRED (KG) | 20221 | 38180 | 770 | 0.431 |
Hallucination in Language Models
Hallucination in language models studies how systems produce unsupported or false claims and how to detect, explain, and reduce them.
See all 247 papers