Table of Contents
Fetching ...

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.

Revisiting Hallucination Detection with Effective Rank-based Uncertainty

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 with and , 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.

Paper Structure

This paper contains 35 sections, 3 theorems, 31 equations, 2 figures, 8 tables, 1 algorithm.

Key Result

Lemma 1

For a fixed parameter $\theta$, the variance of the hidden state $h_t$ can be bounded from below recursively. Assuming the transformation $f$ exhibits representational expansion in deep Transformers wang2022antischoenholz2016deep, the conditional variance satisfies: where $J_{y} = \frac{\partial f}{\partial y}$ is the Jacobian of the transformation with regard to the input token embedding, $| \cd

Figures (2)

  • Figure 1: Examples of detecting hallucinations using Effective Rank-based Uncertainty.
  • Figure 2: Visualization of Effective Ranks

Theorems & Definitions (6)

  • Lemma 1: Variance Propagation with Expansion Property
  • Lemma 2: Epistemic Uncertainty Bound
  • Proposition 1
  • proof
  • proof
  • proof