TL;DR
When generative models hallucinate, are they secretly unsure of themselves? This paper demonstrates that sequence-level certainty strongly correlates with factual faithfulness in knowledge-grounded dialogue. By sampling multiple candidate responses and ranking them based on either sequence log-probabilities or cross-candidate semantic entailment, the proposed Certainty-based Response Ranking (CRR) significantly cuts down hallucinations at inference time without requiring any model retraining.
What Problem Does This Paper Address?
In Knowledge-Grounded Dialogue Generation (KGDG), language models are tasked with conversing naturally while staying grounded in reference knowledge. In practice, models frequently hallucinate facts that contradict or wander away from the provided text.
Prior research linked model uncertainty to hallucination in image captioning, but relied almost exclusively on token-level entropy. Token-level measurements fail to capture the sequence-level semantic coherence essential to dialogue, where multiple entirely different wordings can express the exact same correct meaning. Meanwhile, semantic uncertainty methods previously explored in Question Answering (QA) assumed a single crisp "ground truth," which doesn't translate neatly to open-ended conversational tasks.
Methods
The authors frame sequence-level certainty along two distinct axes and propose Certainty-based Response Ranking (CRR), a decoding-time filtering technique:
[Context + Knowledge] ──> Model Samples N Candidates {r₁, r₂, ..., rₙ}
│
┌────────────────┴────────────────┐
▼ ▼
[Probabilistic CRR] [Semantic CRR]
Mean log-prob across tokens Pairwise NLI Entailment
│ (Agreement Score)
│ │
└───────────────┬─────────────────┘
▼
Select Highest-Certainty Response
-
Probabilistic Certainty (P-CRR): Defined as the length-normalized arithmetic mean of token log-probabilities over the entire sequence: $$\frac{1}{N} \sum_{i=1}^N \log p(s_i \mid s_{<i})$$ Candidates with higher mean log-probabilities are selected during decoding.
-
Semantic Certainty (S-CRR): Formulated in meaning-space for scenarios where model probabilities are inaccessible (such as black-box LLM APIs). It measures an Agreement Score (AS) using an off-the-shelf Natural Language Inference (NLI) model: $$\text{AS}(s^{(i)}) = \sum_{j=1}^n \text{Entailment}(s^{(i)}, s^{(j)})$$ Candidates that semantically entail or agree with the rest of the generated candidate pool receive higher scores.
-
Theoretical Link: The authors mathematically prove that under mild assumptions (where sampled sequences capture the distribution of the prompt), semantic certainty serves as an unbiased proxy for probabilistic likelihood.
Datasets
- FaithDial: Used for fine-tuning base models and in-domain evaluation. It contains over 50,000 conversational turns built upon the Wizard of Wikipedia dataset, annotated for faithfulness.
- CMU-DoG & TopicalChat: Used to evaluate zero-shot out-of-distribution generalizability.
- Evaluation / Auxiliary Models: An off-the-shelf RoBERTa-Large NLI model is used to compute Agreement Scores, and a RoBERTa-Large model trained on FaithCritic is used to classify outputs as "faithful" or "hallucinated."
Key Insights and Ideas
- Faithful responses exhibit significantly higher certainty: Two-sample $t$-tests across 4 model architectures (GPT-2 Small/Medium, T5-Base, OpenLlama-3B) showed that faithful outputs consistently display higher probabilistic and semantic certainty ($p \ll 0.01$).
- Token-level vs. Sequence-level: Standard uncertainty-aware beam search (which adjusts decoding token-by-token) failed to improve factual accuracy noticeably on dialogue. In contrast, whole-sequence ranking delivered immediate gains.
- S-CRR scales with pool size: As the number of sampled candidates increased ($n = 5 \to 10 \to 20$), S-CRR's performance steadily rose because the pairwise NLI consensus gained statistical stability. P-CRR, evaluating candidates in isolation, remained relatively flat.
Key Results
- Higher Faithfulness Across Settings: Across three decoding methods (Beam Search, Top-$k$, and Nucleus Sampling) and all datasets, CRR consistently improved faithfulness:
- For GPT-2 Small using Nucleus Sampling on FaithDial, baseline faithfulness stood at 91.2%. P-CRR boosted this to 97.6%, while S-CRR reached 95.7%.
- On the out-of-distribution CMU-DoG dataset, P-CRR improved GPT-2 Small faithfulness from 38.3% to 50.0%.
- Consistent Across Scales: On larger architectures like OpenLlama-3B, Nucleus Sampling faithfulness rose from 95.7% to 98.6% (P-CRR) and 97.2% (S-CRR) on FaithDial, with similar double-digit percentage-point gains on CMU-DoG and TopicalChat.
- While P-CRR generally achieves the highest absolute scores when internal model logits are accessible, S-CRR proves to be an effective alternative for black-box settings.
Limitations and Future Work
- Inference Latency: Both variants require sampling $n$ independent sequences per turn, and S-CRR additionally incurs an $\mathcal{O}(n^2)$ pairwise forward-pass cost through an external NLI model.
- Evaluator Dependency: Factual consistency was evaluated using an automated classifier (FaithCritic-trained RoBERTa) rather than human evaluation studies.
- Applicability to Open-Ended Creativity: High-certainty ranking promotes conservative, consensus-driven responses, which could potentially suppress creative or diverse dialogue responses in less strict conversational contexts.
Summary updated