TL;DR
When a Large Language Model (LLM) knows an answer, its internal "thoughts" stay remarkably consistent across multiple attempts; when it hallucinates, those thoughts scatter in complex ways. By treating each generated response as a cloud of token embeddings and calculating the mathematical "transport cost" required to morph one cloud into another, researchers created a training-free hallucination detector that outperforms existing baselines—and even works on closed-source, black-box models.
What Problem Does This Paper Address?
LLMs are trained to sound plausible, not to verify facts, leading to fluent hallucinations. Catching these errors without relying on complex external search engines usually involves one of two flawed approaches:
- Comparing multiple text outputs (Self-Consistency): Ask the model the same question ten times and check if the answers match. However, natural language is tricky—two sentences can look completely different on the surface while meaning the exact same thing, fooling text-based detectors.
- Inspecting internal hidden states: Looking inside the model’s neural activations captures deeper semantics than surface text. Yet, existing methods typically squash an entire variable-length paragraph down into a single vector (like taking the final token's state or averaging everything together). In long-form reasoning or summaries, uncertainty is spread across specific entities or math steps, and squashing the sequence destroys that granular signal.
The authors ask: Can we measure the consistency across multiple sampled answers inside the model's representation space without compressing away the token-level details?
Methods
Instead of collapsing a response into a single point, the authors treat each generated response as an empirical probability distribution—essentially a point cloud where every generated token is a point in the model's middle-layer hidden space (projected down to 128 dimensions for speed).
Given a prompt, they sample $K$ stochastic responses (default $K=10$) and compare every pair of token clouds using Optimal Transport—specifically, the 2-Wasserstein distance (often called "Earth Mover's Distance"). If each token cloud is a pile of dirt, the Wasserstein distance measures the minimum physical work required to shovel one response's token pile into the exact shape of another's.
Doing this for all pairs yields a $K \times K$ distance matrix, from which they extract two training-free scores:
- AvgWD (Magnitude): Simply the average pairwise transport cost. High cost means the responses drifted far apart in representation space.
- EigenWD (Structure): Converts the distance matrix into a Gaussian similarity kernel and takes the ratio of singular-value norms ($\|\sigma\|_p / \|\sigma\|_2$). This captures spectral complexity—how tangled or multi-directional the disagreements are.
The Black-Box Twist: What if you are using a proprietary API like GPT-4o-mini where hidden states are locked away? The authors feed the black-box model's text responses into an open-source "surrogate" model (like Llama-3.1-8B) via teacher forcing, extracting the surrogate's hidden states to run the exact same pipeline.
Datasets
Because the method is completely training-free, no training datasets are used. Evaluation spans two regimes:
- White-box evaluation: CoQA and SQuAD-v2.0 (extractive QA), MATH-500 (mathematical reasoning), and CNN/DailyMail (long-form summarization).
- Black-box evaluation: SciQ, NQ-open, and MATH-500. No new benchmarks are introduced.
Key Insights and Ideas
- Don't pool your tokens: Holding everything else constant, swapping simple pooled Euclidean distance for token-level Wasserstein distance jumps average detection AUROC from 0.643 to 0.726. Preserving token-level geometry matters enormously.
- Distance vs. Complexity: AvgWD and EigenWD capture complementary aspects of uncertainty. AvgWD asks how far apart the answers are, while EigenWD asks how structurally chaotic the disagreement is. Interestingly, Llama models responded slightly better to EigenWD, whereas Qwen models favored AvgWD.
- Borrowed brains still catch lies: You don't need a model's true internal geometry to spot its inconsistencies. Mapping black-box text into an open-source surrogate's representation space preserves enough semantic structure to reliably flag hallucinations.
Key Results
Across 5 open-source LLMs (Llama-3.2-3B, Llama-2-7B, Llama-3.1-8B, Qwen3-8B, and Qwen3-32B) and 4 datasets, the proposed signals consistently beat five strong training-free baselines, including Discrete Semantic Entropy and Eigenscore:
- White-box: EigenWD hits the highest average AUROC on all Llama models (0.743, 0.744, and 0.735), while AvgWD leads on Qwen3-8B (0.701) and Qwen3-32B (0.722). Using AvgWD as a single fixed default across all 20 settings yields statistically significant macro AUROC gains of +0.022 to +0.026 over top baselines.
- Black-box: Detecting hallucinations on GPT-4o-mini and DeepSeek-chat across 54 configurations, EigenWD achieves a 0.7194 macro AUROC, ranking 1st in 35/54 setups (and top-2 in 44/54).
Limitations and Future Work
- Surrogate blind spots: In black-box mode, the detector relies on a surrogate-induced proxy rather than true target geometry. Notably, using Qwen3-8B as a surrogate on MATH-500 proved to be a failure case.
- Multi-sample overhead: Like all self-consistency methods, generating $K=10$ (or $20$) responses per prompt multiplies inference latency and compute costs compared to single-pass generation.
- Theoretical boundary: While AvgWD is proven to be Lipschitz stable under token perturbations, EigenWD's stability guarantee is conditional and does not formally hold when the kernel's median bandwidth is dynamically recomputed. Future directions are not explicitly discussed in the main text.
Summary updated