Revisiting Hallucination Detection with Effective Rank-based Uncertainty
Rui Wang, Zeming Wei, Guanzhang Yue, Meng Sun
TL;DR
This work tackles hallucination detection in large language models by proposing Effective Rank-based Uncertainty, a training-free detector that leverages spectral analysis of internal embeddings. By assembling an embedding matrix from multiple sampled responses and middle-layer representations, and computing its erank via $\mathrm{erank}(A) = \exp(H(A))$ with $H(A) = -\sum_i p_i \log p_i$ and $p_i = \sigma_i / \sum_j \sigma_j$, the method links internal representation dispersion to external semantic variation. Empirically, the detector achieves robust AUROC performance across TriviaQA, BioASQ, NQ, and SQuAD with open-source, off-the-shelf use and demonstrates resilience to generation count and layer choices; ablations reveal the role of temperature and the trade-offs across tasks. The paper also provides theoretical analysis of uncertainty decomposition, arguing that aleatoric uncertainty dominates single-pass signals, and highlights a unified perspective that combines internal dispersion with external semantics to enhance interpretability and reliability in LLM truthfulness.
Abstract
Detecting hallucinations in large language models (LLMs) remains a fundamental challenge for their trustworthy deployment. Going beyond basic uncertainty-driven hallucination detection frameworks, we propose a simple yet powerful method that quantifies uncertainty by measuring the effective rank of hidden states derived from multiple model outputs and different layers. Grounded in the spectral analysis of representations, our approach provides interpretable insights into the model's internal reasoning process through semantic variations, while requiring no extra knowledge or additional modules, thus offering a combination of theoretical elegance and practical efficiency. Meanwhile, we theoretically demonstrate the necessity of quantifying uncertainty both internally (representations of a single response) and externally (different responses), providing a justification for using representations among different layers and responses from LLMs to detect hallucinations. Extensive experiments demonstrate that our method effectively detects hallucinations and generalizes robustly across various scenarios, contributing to a new paradigm of hallucination detection for LLM truthfulness.
