Talk to our team
Menu

Learned Hallucination Detection in Black-Box LLMs using Token-level Entropy Production Rate

Authors
  • Charles Moslonka
  • Hicham Randrianarivo
  • Arthur Garnier
  • Emmanuel Malherbe
Affiliations
  • Artefact Research Center
  • MICS, CentraleSupélec, Université Paris-Saclay
  • Ardian
Accepted at
ECIR 2026
Date
arXiv
2509.04492

Abstract

Hallucinations in Large Language Model (LLM) outputs for Question Answering (QA) tasks can critically undermine their real-world reliability. This paper introduces a methodology for robust, one-shot hallucination detection, specifically designed for scenarios with limited data access, such as interacting with black-box LLM APIs that typically expose only a few top candidate log-probabilities per token. Our approach derives uncertainty indicators directly from these readily available log-probabilities generated during non-greedy decoding. We first derive an Entropy Production Rate (EPR) that offers baseline performance, later augmented with supervised learning. Our learned model leverages the entropic contributions of the accessible top-ranked tokens within a single generated sequence, without multiple re-runs per query. Evaluated across diverse QA datasets and multiple LLMs, this estimator significantly improves token-level hallucination detection over state-of-the-art methods. Crucially, high performance is demonstrated using only the typically small set of available log-probabilities (e.g., top-10 per token), confirming its practical efficiency and suitability for API-constrained deployments. This work provides a lightweight technique to enhance the trustworthiness of LLM responses, at the token level, after a single generation pass, for QA and Retrieval-Augmented Generation (RAG) systems. Our experiments confirmed the performance of our method against existing approaches on public dataset as well as for a financial framework analyzing annual company reports.

Cite this paper

@inproceedings{moslonka2026learned,
  title = {Learned Hallucination Detection in Black-Box LLMs using Token-level Entropy Production Rate},
  author = {Charles Moslonka and Hicham Randrianarivo and Arthur Garnier and Emmanuel Malherbe},
  booktitle = {European Conference on Information Retrieval (ECIR 2026)},
  year = {2026},
  doi = {10.1007/978-3-032-21289-4_8},
  url = {https://doi.org/10.1007/978-3-032-21289-4_8}
}

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities across a wide range of tasks (1, 2, 3). However, a significant and persistent challenge is their propensity to generate hallucinations (4, 5). These are defined as LLM-generated content that is factually incorrect, nonsensical, or unfaithful to a provided source, despite often appearing plausible and coherent (6, 7). The impact of hallucinations can be severe, particularly in safety-critical applications such as medicine or infrastructure engineering (8, 9), leading to the propagation of misinformation and erosion of user trust. Therefore, detecting and quantifying the uncertainty associated with LLM outputs is paramount to building trust and enabling responsible deployment.

The practical deployment of Uncertainty Quantification (UQ) (10) and hallucination detection methods is often constrained by limited access to LLM internals. These limitations are especially true when interacting with proprietary models through APIs, which may expose only a small number of top- K log-probabilities per token (where K might be around 15). This black-box setting restricts the applicability of techniques requiring access to full logits, hidden states, or architectural modification (11). Moreover, many real-world applications require one-shot (or “single-round” (12)) detection—the ability to assess the reliability of a single generated sequence without the need for multiple, often costly, model inferences for the same input query to measure output variability.

This paper introduces a UQ methodology rooted in information theory, tailored for these black-box, one-shot scenarios. Our approach leverages the accessible log-probabilities to derive entropic measures of model hesitation during the generation process. We define and evaluate a metric termed the Entropy Production Rate (EPR) of a generated sequence. We show that EPR, calculated as the average entropy of the token probability distributions across the entire sequence, serves as an initial, unsupervised estimator of the degree of hesitation exhibited by the model during inference.

Our second contribution is a supervised learning model that adapts entropy measures to a dataset of annotations. By training on the entropic contributions of top-ranked tokens across the sequence, we learn an estimator that more accurately distinguishes between faithful and hallucinatory responses. This estimator can also highlight high-uncertainty tokens in a generated sequence, as displayed in Figure 1.

We detail the entropic framework, its theoretical and practical underpinnings under limited log-probability access, and its empirical validation. We showcase its potential as a practical tool for improving the reliability of LLM systems, using RAG in a financial scenario as an example. To facilitate adoption and future research, we release our methods (EPR and WEPR) as an open-source Python package available at https://github.com/artefactory/artefactual/.

Illustration of token-level uncertainty detection in a financial RAG pipeline.
Figure 1. Illustration of token-level uncertainty detection in a financial RAG pipeline. We show the token-level scores of a LLM asked what is Emerson's net sales in 2023, in two different cases. Without retrieved contents, the generated answer has low uncertainty on all tokens except on the digits of the answer (false answer). With retrieved context, all tokens have a low score, and the digits returned are correct.

Related Work

The primary goal of UQ in LLMs is to enable them to signal their confidence — to “know what they do not know” (13, 14). LLM uncertainty arises from traditional aleatoric (data-inherent) and epistemic (model-based) sources (15), and additionally from their generative characteristics like divergent multi-step reasoning paths and decoding stochasticity (12). Traditional neural network UQ approaches, such as training modifications for aleatoric uncertainty (16) or dropout-based methods for epistemic uncertainty (17, 18), are often ill-suited or prohibitively costly for LLMs due to training expense or architectural differences. Developing UQ techniques tailored to LLM intricacies remains an active research area (19).

Information-theoretic entropy has emerged as a cornerstone for assessing LLM uncertainty and hallucinations, based on the hypothesis that higher output distribution entropy often correlates with a greater likelihood of error (20). Researchers have employed diverse entropy measures to capture different facets of LLM uncertainty (21). Predictive entropy (22) assesses overall output distribution uncertainty. Semantic Entropy (23) quantifies uncertainty over semantic meaning by clustering multiple generated responses, with Discrete Semantic Entropy (24, 25) using frequency-based cluster probabilities. Answer Entropy (26), common in QA, measures variability in complete answer strings from multiple trials, sometimes enhanced with noise injection. Particularly relevant to our work, token-level entropy (13) measures per-step uncertainty from the next-token probability distribution and has been used to predict errors in QA and mathematical reasoning (11, 27).

Direct application of entropy scores, often via thresholding, is a common approach for hallucination detection or calibration (11, 23, 13). More sophisticated techniques include Semantic Entropy Probes (SEPs) (28)—learned models predicting Semantic Entropy from single-pass hidden states for efficiency—or Shifting Attention to Relevance (SAR) (29), which weights tokens by relevance. However, entropy-based methods face challenges like high-certainty hallucinations (30), where LLMs produce low-entropy incorrect outputs, necessitating strategies beyond simple thresholds. Moreover, the computational cost of multi-sample methods (e.g., for Answer or Semantic Entropy) can be prohibitive, highlighting the need for efficient single-shot techniques such as SEPs (28), Logit-induced Token Uncertainty (LogTokU) (31), and ours.

Theoretical Framework for Entropic Uncertainty

Our approach to estimate uncertainty in LLM generations is rooted in information theory (32, 33). The core idea is to derive an entropic score reflecting the model’s hesitation when generating tokens. Unlike methods requiring multiple model runs to assess output variability, our method is a one-shot analysis, leveraging the probabilistic information from a single generated sequence.

Entropy computation during token generation.

For a standard classification task with Nc classes, given an input q, a model outputs probabilities pi=p(classi|q) for each class i∈{1,…,Nc}. The uncertainty can be quantified by the Shannon entropy (in bits) of this distribution:

H(q)=−∑i=1Ncpilog2⁡(pi)≥0.(1)

This entropy H(q) is minimized to zero when the distribution is sharply peaked (high certainty) and maximized at Hmax(q)=log2⁡(Nc) for a uniform distribution (maximum uncertainty).

Extending this to LLM sequence generation, let V={vi}i=1|V| denote the model’s vocabulary, with size |V|. For a given input query q, the LLM generates a sequence of tokens 𝒯={t1,t2,…,t|𝒯|} (∀j,tj∈V). The generated sequence 𝒯 depends on q, but we omit this dependency for clarity. At each generation step j, the LLM internally computes a probability distribution {p(vi|q,t<j)}i=1|V| for the next token tj, conditioned on the preceding tokens t<j:={t1,…,tj−1} and the input q. The complete entropy for the j -th token’s distribution is:

H(q,t<j)=−∑i=1|V|p(vi|q,t<j)log2⁡p(vi|q,t<j).(2)

Note that this quantity does not depend on the sampled token tj.

In black-box scenarios involving proprietary LLMs accessed via APIs, only the log-probabilities (or probabilities) for a small number, denoted by K, of top-ranked candidate tokens are exposed (e.g., K≤20). Thus, we estimate the per-token entropy based on these top K probabilities. Let r:{1,…,|V|}→{1,…,|V|} be the ranking operator on the vocabulary indices, meaning r(k) is the index i of the k -th token in decreasing order of p(vi|q,t<j). The estimator can then be written as:

H~K(q,t<j)=−∑k=1Kpr(k),jlog2⁡(pr(k),j),(3)

where pr(k),j:=p(vr(k)|q,t<j) is the probability of the k -th ranked token at generation step j.

Sufficiency of Top- K Log-Probabilities for Entropy Estimation

A critical question is whether H~K(q,t<j), calculated from only the top K probabilities, is a reliable proxy for the true entropy H(q,t<j). The discrepancy arises from the missing tail of the distribution:

ΔHK(q,t<j)=H(q,t<j)−H~K(q,t<j)=−∑k=K+1|V|pr(k),jlog2⁡pr(k),j.(4)

We can establish an upper bound for this missing entropy by assuming the remaining probability mass QK(q,t<j)=1−∑k=1Kpr(k),j is distributed uniformly among the remaining tokens considered sampleable. When the LLM generation uses a cutoff parameter Ksamp≪|V| (e.g., Ksamp=50), probabilities beyond Ksamp are set to zero. In that case:

ΔHK,max(q,t<j)=−QK(q,t<j)[log2⁡(QK(q,t<j))−log2⁡(Ksamp−K)](5)

The quality of H~K(q,t<j) as an estimator of the entropy within the relevant token pool (either full vocabulary or Ksamp limited) can be assessed by comparing H~K(q,t<j) and ΔHK,max(q,t<j); a large ratio H~K/ΔHK,max suggests that H~K(q,t<j) captures most of the relevant uncertainty.

Empirically, we observe a concentration in the log-probabilities of lower-ranked tokens (e.g., for ranks i≈10−15), as illustrated in Figure 2. Differences between successive pr(k),j tend to diminish for larger k within the accessible K. When combined with Ksamp sampling, this supports the idea that H~K(q,t<j) captures the dominant portion of the uncertainty within the set of practically sampleable tokens, especially if K is reasonably close to Ksamp.

Influence of Sampling Temperature

In practice, at j -th generation step, a LLM first predicts raw logits lj,i and converts them to probabilities pj,i by a softmax function with a temperature parameter Tsamp, such that: pj,i(Tsamp)=elj,i/Tsamp/∑m=1|V|elj,m/Tsamp. The per-token information entropy H(q,t<j;Tsamp) thus depends on Tsamp, verifying:

As Tsamp→0+, pj,i(Tsamp) approaches 1 for the token with the highest logit (assuming a unique maximum) and 0 for others. Consequently, H(q,t<j;Tsamp)→0, reflecting high certainty.

As Tsamp→∞, pj,i(Tsamp) approaches 1/|V| for all tokens, leading to a uniform distribution. Therefore, the entropy H(q,t<j;Tsamp)→log2⁡|V|, its maximum possible value, reflecting maximum uncertainty.

However, a critical distinction exists between the distribution used for sampling tokens and the log-probabilities returned by modern inference engines. Systems like vllm, or the OpenAI API, typically expose log-probabilities computed from raw logits (equivalent to fixing T=1 for calculation), regardless of the Tsamp used to select the token tj. Consequently, while Tsamp dictates the trajectory of the generated sequence 𝒯, our entropic features (defined in the following sections) measure the model’s intrinsic hesitation based on its unscaled raw distribution. This decoupling ensures that our estimator remains mathematically well-defined and stable even if the user employs conservative decoding settings (e.g., low Tsamp).

Entropy Production Rate (EPR) of the sequence

Based on the per-token entropy estimate H~K(q,t<j), we define the Entropy Production Rate (EPR) for a generated sequence 𝒯 of length |𝒯| in response to query q. It is the average estimated entropy over the top K accessible log-probabilities, across all tokens in the sequence:

EPRK(q,𝒯)=1|𝒯|∑j=1|𝒯|H~K(q,t<j)(6)
=−1|𝒯|∑j=1|𝒯|∑k=1Kpr(k),jlog2⁡(pr(k),j).

This EPRK may serve as a global measure of hesitation or uncertainty for the generated sequence, given the black-box constraints (see Fig. 3) In the following, we improve its alignment with ground-truth annotations via supervised learning.

Supervision on Entropic Contributions by Rank

We consider a dataset 𝒟 where each entry is a query q, the generated sequence 𝒯, and an annotation Y∈{0,1} indicating whether 𝒯 is a correct (therefore considered non-hallucinatory) answer to q. Note that this annotation depends on the LLM used to generate 𝒯. A realistic dataset size is on the order of hundreds to thousands of entries.

To build a more nuanced supervised detector, we define features based on the entropic contributions of tokens at specific ranks. For the j -th token generation and given k∈{1,…,K}, the entropic contribution of the k -th ranked token is

sk,j=−pr(k),jlog2⁡(pr(k),j).

Note that the actually sampled token at step j may not be the highest-ranked token (k=1), especially with high Tsamp. Our estimation leverages the probabilities of the tokens at fixed ranks k, regardless of which token was sampled. We consider weighing each term of H~K(q,t<j) (Eq. (3)) according to its rank k:

Sβ(q,t<j)=β0+∑k=1Kβksk,j,(7)

where β∈ℝK+1 are weights that aim to adapt the entropy measure and are learned using the annotations of 𝒟, as described in the following. This token-wise quantity Sβ(q,t<j) is close to H~K(q,t<j), but can be negative.

We aggregate the token-wise scores to learn the parameters β at the sequence level. A simple average of Sβ(q,t<j) across the sequence captures the overall model hesitation. However, a single moment of high uncertainty (a "spike") can often be indicative of a hallucination, even if the rest of the sequence is generated confidently, and in such case sk,j values will be high for the uncertain generation, even at high ranks k. To capture these critical tokens, we also consider the maximum entropic contribution sk,j for each rank across the sequence. This leads to our final scoring function, the Weighted Entropy Production Rate (WEPR):

WEPRβ,γ(q,𝒯)=1|𝒯|∑j=1|𝒯|Sβ(q,t<j)+∑k=1Kγkmaxj⁡sk,j(8)

where γ∈ℝK are parameters to be learned along with β by maximizing on the annotations of the dataset 𝒟:

maxβ,γ⁡∑q,𝒯,Y∈𝒟Ylog⁡[σ(WEPRβ,γ(q,𝒯))](9)
+(1−Y)log⁡[σ(1−WEPRβ,γ(q,𝒯))]

where σ is the sigmoid function. This corresponds to a logistic regression loss, without regularization, on the averaged contributions Sβ(q,t<j) across tokens and the maximal sk,j values. This way, the signal provided by the entropy along the sequence is aligned to the ground truth annotations.

Beyond this supervision, σ(WEPRβ,γ(q,𝒯))∈[0,1] can be interpreted as a confidence score for the generated sequence 𝒯 to be valid, with no hallucination. In particular, contrary to EPRK(q), this quantity is scaled and can easily be displayed as a normalized score to the user. Moreover, while the annotations are at the sequence level, we can also consider a token-level measure, computed on the entropic contributions features of each token:

σ(Sβ(q,t<j))∈[0,1].(10)

This score can be interpreted as the localized risk of hallucination associated with the j -th token, allowing users to identify specific parts of a less reliable response. A significant advantage of this token-level score is its suitability for online estimation: it can be computed and displayed in real-time as the sequence is generated, token by token, without waiting for the full output 𝒯.

Analysis of probability mass concentration on 180 k tokens generated by Mistral-Small-3.1-24B (Tsamp=1.0).
Figure 2. Analysis of probability mass concentration on 180 k tokens generated by Mistral-Small-3.1-24B (Tsamp=1.0). (a) Distribution of log-probabilities for the token at rank k, showing a rapid decay in likelihood. (b) Distribution of the missing probability mass QK (log scale) when truncating at cutoff K. The median QK drops below 10−4 by K=10, validating the Top- K approximation. Two box-plots of token log-probability distributions.
Distributions of EPR scores on Falcon-10B responses.
Figure 3. Distributions of EPR scores on Falcon-10B responses. The separation between the Hallucinated (red) and Non-hallucinated (green) distributions illustrates the discriminative power of the metric. On one plot, two distributions of the EPR scores, colored differently according to their label/judgment, hallucinated or not. The mean EPR score is higher for hallucinated answers.

Experiments

Experimental Setup

Models and Datasets

We evaluated our methods on a suite of contemporary instruction-finetuned LLMs, including Mistral-Small-3.1-24B-Instruct-2503 (34), Falcon3-10B-Instruct (35), Phi-4 (36), and Ministral-8B-Instruct-2410 (37). For Question Answering (QA) tasks, we primarily utilized the TriviaQA (38) (Wikipedia domain) and WebQuestions (39) datasets. We also explored the applicability of our entropic measures in a Retrieval-Augmented Generation (RAG) (40) context using a specialized dataset based on financial reports from the ArGiMi-Ardian Finance dataset (41) to observe how entropy varies with the provision of relevant context (we detail this particular application below). We focused on models generating relatively short answers, typical of non-extended reasoning QA.

Answer Generation and Log-probability Extraction

LLMs were served using the vllm inference library (42). To ensure variability and access to meaningful probability distributions for entropy calculation, we used non-greedy decoding with Tsamp=1.0. The top_p parameter was set to 1.0, while the sampling cutoff was set to Ksamp=50. This truncation allows us to compute the theoretical upper bound on missing entropy defined in Eq. (5). For each generated token, we extracted the accessible top- K log-probabilities (typically K≤15 or K≤20 depending on the API/model).

Hallucination Annotation Protocol

Generated answers for the QA tasks were labeled as hallucinated or non-hallucinated (as displayed in Figure 3) using an LLM-as-a Judge (43, 44, 45, 46) approach, employing Gemma-3-12b-it (47). The judge LLM semantically compared the generated answer to the ground-truth answer (and any available aliases). If both answers were judged similar, the generated answer was labeled as non-hallucinated. This automated annotation is scalable and suitable for one-shot analysis. However it may mislabel random correct guesses with high uncertainty or fail to flag confident but incorrect statements (high-certainty hallucinations). To validate its reliability, we conducted a human evaluation. A group of 15 annotators, comprising Ph.D. and graduate students in Machine Learning from our laboratory, hand-labeled a sample set of 1,333 output/ground-truth pairs. The human-machine agreement was exceptionally high: they matched on 1,275 instances (95.7%), yielding a Cohen’s Kappa of κ=0.898 (see Table 2). This strong alignment confirms that the automated labels used for our large-scale training and evaluation are reliable proxies for human judgment.

RAG Uncertainty Analysis

Beyond general QA, we explored the applicability of our entropic methods for analyzing outputs in RAG pipelines. The premise is that uncertainty, as captured by EPR or WEPR, might increase when an LLM generates an answer without sufficient supporting context. We demonstrated this capability using the ArGiMi-Ardian Finance 10k dataset (41). This open-source resource comprises 52,000 financial annual reports, written in English and extracted from their original PDF format, covering the period from the late 90s to 2024. For our evaluation, we focused on a specific 81-page report from this corpus, from which we manually constructed 50 question/answer/source-page triplets. Answers were generated both with and without the retrieval of the relevant context pages. The task was framed as detecting “missing context” hallucinations—instances where the model hallucinates facts due to the specific absence of the retrieved information—based solely on the entropic signature of the answer.

Evaluation Protocol

Metrics

The primary metrics used to evaluate the performance of our hallucination detection methods are the Area Under the Precision-Recall Curve (PR-AUC) and the Area Under the Receiver Operating Characteristic Curve (ROC-AUC). As both metrics led to identical conclusions, we report only ROC-AUC scores for conciseness.

Comparison to existing methods

We benchmark our proposed methods, EPR (unsupervised) and WEPR (supervised), against two state-of-the-art black-box detection techniques:

SelfCheckGPT (11): A multi-shot method that measures the consistency across several answers generated for the same query. We used the BertScore variant with 10 generated samples.

HalluDetect (19): A single-shot method that, similar to our approach, engineers features from model probabilities to train a detector.

This selection allows for a direct comparison with a powerful multi-shot approach (SelfCheckGPT) and a closely related single-shot competitor (HalluDetect), for which we used the same number of accessible log-probabilities (K=15) to ensure a fair comparison.

Training and Evaluation Strategy

The supervised logistic regression model have been trained only on TriviaQA data (generated sequences and their labels), as being the only dataset with annotation. For evaluating these methods on TriviaQA, we generated training and testing splits by grouping the data points by their original query. This process ensures that no data points originating from the same query appear in the training and testing sets for a given fold, mitigating potential data leakage and overestimating generalization performance. To ensure stability and robust performance estimation, particularly given potential variability in smaller datasets or specific model-dataset pairings, we employed bootstrapping on 1000 iterations during model evaluation.

Results

Hallucination Classification Performance

Table 1 shows results on TriviaQA for hallucination detection. The EPR baseline demonstrates notable discriminative ability, with ROC-AUC scores ranging from 74.6 (Mistral-Small-3.1-24B) to 81.4 (Ministral-8B-Instruct-2410). For a similar computational overhead as other single-shot methods (around 80±20 μs per score) WEPR consistently matches or outperforms EPR, SelfCheckGPT, and HalluDetect across all LLMs. Note that multi-shot methods are multiple orders of magnitude more computationally costly (at least 10s for SelfCheckGPT). We also verified the robustness of our approach to sampling parameters; for instance, on Falcon-3-10B, reducing the temperature to Tsamp=0.6 resulted in a negligible change in ROC-AUC (<1.0 point difference). Since the log-probabilities used for WEPR features are derived from raw logits, this result confirms that our entropic signal remains highly discriminative even when applied to the more deterministic generation trajectories typical of conservative decoding. Regarding the generalization on WebQuestions (Table 1), we observe that although performance is generally lower on this dataset, WEPR maintains its advantage across LLMs.

The improved classification performance of the WEPR model is further illustrated by the sample Precision-Recall curves for Falcon-3-10B on TriviaQA (Figure 5), where the WEPR curve consistently dominates that of the EPR baseline and the HalluDetect (19) method.

RAG uncertainty

Table 1 presents the performance of compared methods (trained on the general TriviaQA dataset for supervised ones) for the missing context detection task. The results show that the WEPR model significantly outperforms the other methods in this domain-specific RAG scenario. This indicates that an entropic detector trained on a general QA dataset can transfer, to a notable extent, to specialized domains for identifying responses generated with insufficient context. Such a mechanism can be readily applied in RAG pipelines to flag outputs where context retrieval may have been inadequate or where the model is otherwise struggling, thereby triggering deeper information retrieval or alerting the user.

Effect of the Number of Accessible Log-probabilities (K)

We investigated the impact of K on hallucination detection performance. Figure 4 displays the evolution of the mean ROC-AUC for Falcon-3-10B on TriviaQA as K varies. The results indicate that performance generally improves with increasing ranked token contributions up to a certain point. Notably, for several models, the ROC-AUC tends to plateau when K reaches approximately 8 to 10. This suggests that incorporating entropic contributions beyond the top ∼ 10 ranks may yield diminishing returns for hallucination detection. This finding has practical significance, implying that effective detection can be achieved even when API access is limited to a relatively small number of top logprobs, thereby reducing data requirements and potentially API costs.

Human adoption analysis

We wanted to measure the perceived downstream quality of our WEPR scoring methods, at the two possible granularities: sentence-wise (σ(WEPRβ,γ(q,𝒯)) and token-wise (Eq. 10). At least three independent annotators (from the same pool of researchers) rated each sample as acceptable or not (mean 3.76). The adoption score is then computed based on the majority vote, with results compiled in Table 2. The high level of satisfaction for token scores (78.1%) indicates that the learned coefficients βk from our WEPR model can be used to compute a weighted entropic contribution for each token j in a sequence, thus offering a finer-grained view of uncertainty hotspots within the generated text (see text colors of Figure 1).

Mean ROC-AUC with respect to K for Falcon-3 on TriviaQA.There is two curves.
Figure 4. Mean ROC-AUC with respect to K for Falcon-3 on TriviaQA.There is two curves. The one corresponding to WEPR has its performance increasing with $K$, and seems to reach a plateau around $K=10$—$12$.
Precision-Recall curves of 3 methods for Falcon-3 on TriviaQA.A sample PR curve, for the 3 methods.
Figure 5. Precision-Recall curves of 3 methods for Falcon-3 on TriviaQA.A sample PR curve, for the 3 methods. The curve corresponding to WEPR is consistently above the HalluDetect one, which is consistently above the EPR one.

Limitations

While our methods demonstrate promising results for one-shot, black-box hallucination detection, several limitations warrant acknowledgment. First, our experiments were conducted on mid-sized LLMs (approximately 8B–24B parameters). Performance on bigger models (e.g., 100B+ parameters or closed-source APIs like GPT-5) remains to be tested. Second, the current study focuses on QA tasks that yield relatively short, factual answers. We did not study tasks requiring extensive multi-step reasoning or lengthy outputs, where the aggregated entropy signal might become less distinct or different types of uncertainty could dominate. Moreover, the method may produce false positives by flagging model hesitation related to stylistic choices or sentence formulation, as opposed to uncertainty about the factual content of the answer. This effect was observed to be more pronounced at the beginning of generated sequences. Finally, our approach, like many other uncertainty-based methods, is inherently limited in its ability to detect "high-certainty hallucinations" (30)—instances where the model generates incorrect information with low output entropy (i.e., high confidence) due to memorization errors. If an LLM has strongly learned erroneous facts during its training, entropic measures based on output probabilities may not flag such confident fabrications.

Conclusion

We addressed one-shot hallucination detection in black-box LLMs by introducing a methodology rooted in information-theoretic principles, leveraging only the top- K token log-probabilities typically exposed by APIs. Our primary contribution is a supervised approach that utilizes features representing individual top-ranked tokens mean and maximal entropic contributions. Experiments across QA datasets and multiple LLMs show that the learned estimator outperforms a baseline Entropy Production Rate (EPR). Notably, strong detection performance is achieved even with as few as K≤10 accessible log-probabilities, underscoring practical efficiency under API constraints. We also showcased utility in a specialized financial setting for RAG and highlighted token-level uncertainty visualization.

This work provides a practical technique for enhancing the trustworthiness of LLM responses in both general QA and RAG from a single generation pass. Future work may extend this approach to more complex reasoning tasks and study the interpretability of the learned entropic weights.

Next step

A problem worth researching?

Tell us what you are trying to solve, and we will put you in touch with the people who work on it.