- Updated: June 13, 2026
- 6 min read
Entropy Distribution as a Fingerprint for Hallucinations in Generative Models
Direct Answer
The paper introduces the Calibrated Entropy Score (CES), a single‑pass, black‑box algorithm that detects hallucinations in large language model (LLM) outputs by analysing the full distribution of token‑level entropies rather than just their average. This matters because CES delivers detection quality comparable to multi‑sample methods while requiring only one forward pass, making real‑time, large‑scale safety checks feasible for production AI systems.
Background: Why This Problem Is Hard
Hallucinations—statements that are syntactically plausible but factually wrong—remain one of the most stubborn reliability gaps in LLMs. In high‑stakes domains such as legal advice, medical triage, or financial analysis, a single erroneous claim can erode user trust, trigger regulatory scrutiny, or cause tangible harm. Existing detection strategies fall into two broad camps:
- Multi‑sample heuristics that query the model repeatedly with temperature variations or prompt perturbations. While effective, they multiply inference cost and latency, rendering them unsuitable for latency‑sensitive services.
- Internal‑signal methods that inspect attention maps, hidden states, or gradient information. These require privileged access to model internals, which is unavailable for most hosted APIs (e.g., OpenAI, Anthropic) and conflicts with proprietary model protection policies.
Both camps share a critical blind spot: they treat the model’s confidence as a single scalar (often perplexity or average entropy). This scalar discards the shape of the underlying entropy distribution, which can encode subtle cues about uncertainty spikes, tail heaviness, and token‑level disagreement—signals that are especially pronounced when a model strays from its training distribution.
What the Researchers Propose
The authors argue that the entire distribution of token‑level entropies constitutes a “fingerprint” of hallucination. Their solution, the Calibrated Entropy Score, fuses two complementary statistics:
- The mean entropy, which captures the overall confidence level of the generation (akin to traditional perplexity).
- The maximum entropy observed across the sequence, which reflects the most uncertain token and serves as a proxy for tail behaviour.
CES maps these two statistics onto a calibrated reference cumulative distribution function (CDF) built from a large corpus of non‑hallucinatory outputs. By positioning a new generation within this reference CDF, CES yields a probability‑like score that is directly comparable across models, tasks, and generation lengths.
How It Works in Practice
The operational workflow of CES can be broken down into three lightweight stages:
1. Single‑Pass Logit Extraction
When the LLM generates a response, the serving layer records the raw logits for each token before the softmax step. From these logits, token‑level entropies are computed on‑the‑fly. No additional forward passes or temperature sweeps are required.
2. Distribution Summarisation
The system aggregates two values: the arithmetic mean of all token entropies and the highest entropy observed. These two numbers succinctly summarise the distribution’s central tendency and its most extreme uncertainty.
3. Calibration Against a Reference CDF
A pre‑computed reference CDF—derived from millions of verified, factual generations—maps any (mean, max) pair to a calibrated score. The calibration step is a simple lookup or interpolation, making it computationally trivial.
What distinguishes CES from prior heuristics is its statistical grounding: the authors prove a finite‑sample calibration guarantee using a novel random‑length Dvoretzky–Kiefer–Wolfowitz inequality, and they show that the detection probability converges exponentially fast as generation length grows.

Evaluation & Results
The authors benchmarked CES on eight question‑answering datasets (including NaturalQuestions, TriviaQA, and HotpotQA) and ten LLMs ranging from open‑source models (Llama‑2, Mistral) to commercial APIs (ChatGPT, Claude). The evaluation protocol measured two key dimensions:
- Detection AUC – the area under the ROC curve for distinguishing hallucinated from factual answers.
- Calibration error – the deviation between predicted CES probabilities and empirical hallucination frequencies.
Across the board, CES outperformed every other single‑pass black‑box baseline (including perplexity‑only and token‑variance methods) and matched the performance of multi‑sample ensembles that required up to ten times more inference calls. Notably, CES maintained a calibration error below 2 % on all tested models, confirming that its scores are reliable probability estimates rather than arbitrary thresholds.
These findings demonstrate two practical takeaways:
- Entropy distribution carries independent, actionable information that is invisible to average‑entropy metrics.
- A lightweight calibration step can translate raw entropy statistics into a universally comparable hallucination risk score.
Why This Matters for AI Systems and Agents
For AI product teams, CES offers a plug‑and‑play safety layer that can be inserted into any generation pipeline without modifying the underlying model or incurring extra compute. This has immediate implications for:
- Agent orchestration: When a multi‑step reasoning agent selects among several candidate responses, CES can rank them by factual reliability, reducing downstream error propagation.
- Real‑time moderation: Chat‑based services can flag or re‑query low‑confidence answers on the fly, preserving user experience while safeguarding against misinformation.
- Compliance monitoring: Enterprises subject to regulatory standards (e.g., GDPR, HIPAA) can log CES scores as part of audit trails, demonstrating proactive risk management.
Integrating CES into a broader AI workflow is straightforward. For example, the UBOS platform overview already provides a modular inference layer where custom post‑processing hooks can be attached. Adding a CES hook would involve feeding token logits into the CES module, receiving a risk score, and then routing the output through a decision engine that either delivers the answer, requests clarification, or escalates to a human reviewer.
What Comes Next
While CES marks a significant step forward, several open challenges remain:
- Domain‑specific calibration: The reference CDF is built from general‑purpose corpora. Tailoring it to specialized domains (e.g., legal contracts) could further sharpen detection.
- Multimodal extensions: Current work focuses on text tokens. Extending the entropy‑distribution concept to image‑captioning or audio‑generation models may uncover analogous hallucination fingerprints.
- Adaptive thresholds: In dynamic environments, static calibration may drift. Research into online updating of the reference CDF could keep CES robust over time.
Future research could also explore hybrid approaches that combine CES with semantic consistency checks (e.g., retrieval‑augmented verification) to create a multi‑layered safety net. From an engineering perspective, embedding CES into the Enterprise AI platform by UBOS would enable large organisations to enforce hallucination‑aware SLAs across dozens of deployed agents.
For readers who want to dive deeper, the full technical exposition—including proofs of the random‑length DKW inequality and detailed ablation studies—can be accessed in the original arXiv paper.
Andrii Bidochko
CTO UBOS
Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.