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.
Source: §1 · p. 1Method
ϕ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.
Source: §1 · p. 2, §2.1 · p. 2Results
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.
Source: §3.2 · p. 3Takeaways & Limitations
The findings support using ϕfirst as a default cheap baseline before invoking sampling-based hallucination-detection methods.
Source: §5 · p. 5The 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.
Source: §5 · p. 5
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.Source: §1 · p. 1
- First-token confidence uses the normalized entropy of top-K logits at the first content-bearing answer token from one greedy decode.Source: §1 · p. 2
- Across PopQA and TriviaQA with three 7–8B models, ϕfirst matches or modestly exceeds semantic agreement at roughly 1/11 of the generation cost.Source: §1 · p. 2
- ϕfirst is moderately to strongly correlated with semantic agreement, and combining both signals adds only marginal AUROC over ϕfirst alone.Source: §1 · p. 2
- The paper finds that the apparent relationship between ϕfirst and answer length is largely explained by correctness rather than answer length itself.Source: §1 · p. 2
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.Source: §2.1 · p. 2
- At that position, it selects the top K = 100 probabilities, renormalizes them, and computes normalized entropy as ϕfirst.Source: §2.1 · p. 2
- ϕfirst ranges from 0 for a uniform top-K distribution to 1 when all probability mass lies on one token.Source: §2.1 · p. 2
Baselines
- Surface-form baselines compare sampled completions with the greedy answer using full-string, three-word, or one-word agreement.Source: §2.2 · p. 2
Cost
- ϕfirst requires one greedy forward pass, whereas semantic AU uses 10 sampled generations and bidirectional NLI clustering.Source: §2.3 · p. 2
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.Source: §3.1 · p. 2
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.Source: §3.2 · p. 3, Figure 1 · p. 3
- 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.Source: §3.2 · p. 3
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.Source: §3.2 · pp. 3–4
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.Source: §3.3 · p. 4
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.Source: §3.4 · p. 4
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.Source: §3.5 · p. 5
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.Source: §4 · p. 5
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.Source: §4 · p. 5
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.Source: §5 · p. 5
- Moderately to strongly correlated with semantic agreement, ϕfirst recovers most of its discriminative content from a single greedy decode.Source: §5 · p. 5
- The study is restricted to English closed-book short-answer factual QA, three open 7–8B models, and two benchmarks with n = 1000 each.Source: §5 · p. 5
- Results may not transfer to long-form, multi-hop, retrieval-augmented, multilingual, larger-model, proprietary-model, or black-box settings without exposed token probabilities.Source: §5 · p. 5
- First-token confidence requires reliable identification of the first answer-token position, which depends on the chat template and tokenizer.Source: §5 · p. 5
- Automatic-judge correctness labels may introduce label noise into the reported AUROCs.Source: §5 · p. 5