Detecting Hallucination in LLMs: Tracing the Topological Signatures of Impaired Context Sharing
Organizations: Institute of Computing, Universidade Estadual de Campinas (UNICAMP), Campinas, SP, Brazil · Department of Computer and Information Science, University of Pennsylvania, Philadelphia, PA, USA
Abstract
In this work, we examine the topology of information flow patterns within attention graphs to effectively distinguish hallucinated from non-hallucinated responses. We analyze the Forman-Ricci curvature to identify structural patterns indicating information bottlenecks in attention graphs. We then introduce a method that captures both semi-local and global information-flow characteristics of attention heads associated with hallucinated responses. We evaluate our approach extensively across several LLMs and established benchmarks. Empirical results demonstrate that our proposed single-pass approach provides consistent improvements over existing attention-based and multi-response baselines across two hallucination-detection benchmarks, while achieving competitive performance across diverse LLM architectures. Further analysis reveals that impaired context sharing among tokens during causal generation is strongly associated with hallucination occurrences in LLMs. In particular, hallucinated responses are consistently characterized by an over-reliance on self-attention, diffused context retrieval from earlier tokens, or information over-squashing, especially in the final transformer layer.
Figures & tables
| Temp | Benchmark | Model | AUC | ||
| LapEigvals | EigenScore | Ours - setting (a) | |||
| 0.1 | TruthfulQA | LLaMA 3.1 8B Instruct | 80.52 | 83.79 | 85.34 |
| 0.1 | TruthfulQA | Phi 4 | 78.43 | 81.62 | 81.75 |
| 0.1 | TruthfulQA | Mistral 7B Instruct v0.3 | 78.80 | 81.69 | 80.00 |
| 0.1 | TruthfulQA | Qwen3-32B | 77.36 | 72.17 | 80.17 |
| 1.0 | TruthfulQA | LLaMA 3.1 8B Instruct | 78.26 | 80.22 | 80.73 |
| Benchmark | Temp | Model | q10 | + q50 | + q90 | + att_entropy |
| TruthfulQA | 0.1 | LLaMA 3.1 8B Instruct | 83.10 | 84.05 | 84.15 | 85.34 |
| Phi 4 | 79.30 | 80.20 | 80.10 | 81.75 | ||
| Mistral 7B Instruct v0.3 | 77.50 | 78.20 | 78.35 | 80.00 | ||
| Qwen3-32B | 78.00 | 78.85 | 78.90 | 80.17 | ||
| 1.0 | LLaMA 3.1 8B Instruct | 78.50 | 79.60 | 79.50 | 80.73 | |
| Phi 4 | 82.10 | 82.70 | 82.85 | 84.00 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Accuracy | Gwet’s AC1 |
| LLaMA 3.1 8B Instruct | 0.92 | 0.86 |
| Mistral 7B Instruct v0.3 | 0.88 | 0.76 |
| Qwen3-32B | 0.87 | 0.82 |
| Phi-4 | 0.91 | 0.85 |
LLM Hallucination Detection
Large language model hallucination detection identifies unsupported, incorrect, or fabricated claims in model outputs and traces.
See all 198 papers