Source-linked AI summary
The First Token Knows: Single-Decode Confidence for Hallucination Detection
Mina Gabriel
TL;DR
Existing self-consistency approaches estimate hallucination uncertainty through repeated sampling, while semantic variants add NLI-based clustering overhead. The paper evaluates first-token confidence, a normalized top-K logit entropy from one greedy decode, and finds comparable or better performance at substantially lower generation cost. Its results support reporting ϕfirst as a low-cost baseline before sampling-based estimation.
Problem
Sampling-based and semantic self-consistency methods require repeated decoding, and semantic clustering adds external inference overhead for hallucination detection.
Method
ϕfirst is the normalized entropy of the top-K logits at the first content-bearing answer token of a single greedy decode, compared with sampling-based uncertainty signals.
Results
Across three 7–8B models and two benchmarks, ϕfirst achieves 0.820 mean AUROC versus 0.793 for semantic AU and 0.791 for AU-full.
Takeaways & Limitations
The findings support using ϕfirst as a default cheap baseline before invoking sampling-based hallucination-detection methods.
Takeaways & Limitations
The study is limited to English closed-book short-answer factual QA, three open 7–8B models, and two benchmarks, so transfer to other settings is uncertain.
Abstract
from arXiv · showhide
Self-consistency detects hallucinations by generating multiple sampled answers to a question and measuring agreement, but this requires repeated decoding and can be sensitive to lexical variation. Semantic self-consistency improves this by clustering sampled answers by meaning using natural language inference, but it adds both sampling cost and external inference overhead. We show that first-token confidence, phi_first, computed from the normalized entropy of the top-K logits at the first content-bearing answer token of a single greedy decode, matches or modestly exceeds semantic self-consistency on closed-book short-answer factual question answering. Across three 7-8B instruction-tuned models and two benchmarks, phi_first achieves a mean AUROC of 0.820, compared with 0.793 for semantic agreement and 0.791 for standard surface-form self-consistency. A subsumption test shows that phi_first is moderately to strongly correlated with semantic agreement, and combining the two signals yields only a small AUROC improvement over phi_first alone. These results suggest that much of the uncertainty information captured by multi-sample agreement is already available in the model's initial token distribution. We argue that phi_first should be reported as a default low-cost baseline before invoking sampling-based uncertainty estimation.
1 Introduction
The paper proposes first-token confidence as a single-decode uncertainty signal for closed-book factual QA, replacing costly sampling-based probes with information from the initial token distribution. It compares this signal with semantic and surface-form self-consistency across multiple models and benchmarks.
- Sampling-based uncertainty methods require repeated generations, while semantic self-consistency additionally clusters answers into NLI-based equivalence classes.
- First-token confidence uses the normalized entropy of top-K logits at the first content-bearing answer token from one greedy decode.
- Across PopQA and TriviaQA with three 7–8B models, ϕfirst matches or modestly exceeds semantic agreement at roughly 1/11 of the generation cost.
- ϕfirst is moderately to strongly correlated with semantic agreement, and combining both signals adds only marginal AUROC over ϕfirst alone.
- The paper finds that the apparent relationship between ϕfirst and answer length is largely explained by correctness rather than answer length itself.
2 Method
The method extracts uncertainty from the first content-bearing answer token during a single greedy decode. It uses normalized top-K probability entropy and contrasts this low-cost signal with sampling and NLI-based alternatives.
- First-token confidence: The method identifies the first content-bearing answer position by skipping whitespace, punctuation, and chat-template prefixes.
- First-token confidence: At that position, it selects the top K = 100 probabilities, renormalizes them, and computes normalized entropy as ϕfirst.
- First-token confidence: ϕfirst ranges from 0 for a uniform top-K distribution to 1 when all probability mass lies on one token.
- Baselines: Surface-form baselines compare sampled completions with the greedy answer using full-string, three-word, or one-word agreement.
- Cost: ϕfirst requires one greedy forward pass, whereas semantic AU uses 10 sampled generations and bidirectional NLI clustering.
3 Experiments
The experiments evaluate first-token confidence across two datasets, three instruction-tuned 7–8B models, and multiple uncertainty baselines. It is generally competitive with or better than sampling-based methods, while subsumption and length analyses examine what information it captures and whether answer length confounds it.
- Experimental setup: The study uses 1000 examples per dataset across three instruction-tuned 7–8B models, with paired examples across models.Evaluation covers PopQA and TriviaQA; correctness is determined by an automatic judge using questions, answers, and gold aliases.
- Main results: ϕfirst is strongest in five of six dataset–model cells and within 0.002 AUROC of the strongest method in the remaining cell.Figure 1 reports grouped bars and a heatmap across six cells and six confidence signals.
- Main results: 0.820 AUROC is achieved by ϕfirst overall, compared with 0.793 for semantic AU and 0.791 for AU-full.The overall comparison also reports 0.782 for AU-3w, 0.752 for AU-1w, and 0.700 for verbalized confidence.
- Inference cost: +2.7 AUROC points is ϕfirst’s average advantage over semantic AU, obtained with one greedy decode instead of sampled generations and NLI clustering.The per-dataset gains are +0.036 on PopQA and +0.016 on TriviaQA.
- Statistical reliability: Paired bootstrap tests find significant gains over AU-full in four of six cells and over semantic AU in three of six cells.The remaining semantic-AU differences are not statistically significant, so the paper characterizes ϕfirst as matching semantic self-consistency rather than uniformly outperforming it.
- Subsumption analysis: Pearson correlation between ϕfirst and semantic AU ranges from 0.54 to 0.76, while combining them improves AUROC by only +0.021 on average.ϕfirst alone matches or exceeds semantic AU in every cell, indicating limited additional information from semantic agreement.
- Length confound: Answer-length correlations are small overall, but TriviaQA retains a residual partial correlation of about −0.18 after controlling for correctness.On PopQA, partial correlations shrink to ranges as high as −0.02 for Llama and −0.03 for Mistral.
4 Related work
Prior hallucination-detection work uses self-consistency, including semantic clustering of sampled generations, while other approaches use single-pass probabilities, likelihoods, probes, or verbalized confidence. The paper positions first-token entropy as a standalone signal evaluated against these alternatives.
- Sampling-based uncertainty: Self-consistency estimates uncertainty from disagreement among multiple sampled responses, while semantic uncertainty clusters generations into NLI-based equivalence classes.These sampling-based methods provide strong baselines but require repeated generation; the passage truncates before stating the full cost comparison.
- Single-pass alternatives: Related single-pass alternatives include token probabilities, sequence-level likelihood, model-internal probes, and verbalized confidence.The paper states that it evaluates first-token entropy as a standalone hallucination signal against semantic self-consistency and related methods.
5 Discussion and conclusion
The study finds that first-token confidence performs comparably to semantic self-consistency at substantially lower generation cost, while capturing much of its discriminative information. The evidence is limited to a narrow factual-QA setting, with several transfer and measurement constraints.
- Roughly 1/11 of the generation cost, ϕfirst matches or modestly exceeds semantic self-consistency across three 7–8B instruction-tuned models on closed-book factual QA.
- Moderately to strongly correlated with semantic agreement, ϕfirst recovers most of its discriminative content from a single greedy decode.
- The study is restricted to English closed-book short-answer factual QA, three open 7–8B models, and two benchmarks with n = 1000 each.
- Results may not transfer to long-form, multi-hop, retrieval-augmented, multilingual, larger-model, proprietary-model, or black-box settings without exposed token probabilities.
- First-token confidence requires reliable identification of the first answer-token position, which depends on the chat template and tokenizer.
- Automatic-judge correctness labels may introduce label noise into the reported AUROCs.