arXiv:2610.22615cs.CLOct 2026

Manuscript Offprint

arXiv:2610.22615

When Does Uncertainty Measure RAG Hallucination Risk?

Rajeel Ahmad Ansari, Tautik Agrahari

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Uncertainty can measure hallucination risk in retrieval-augmented generation (RAG), but only when retrieved evidence constrains the answer. When evidence is present, unsupported factual claims become less likely; when retrieval coverage is poor, the model can answer from internal knowledge and assign high probability to unsupported claims. We test this across four instruction-tuned models on HotpotQA and SQuAD. After matching faithful and hallucinated answers within word-count bins, length-only classifiers fall near chance, while perplexity reaches 0.81–0.91 AUROC on targeted unsupported edits. Varying retrieval depth shows why the score changes meaning: detection can weaken with only the top-ranked passage, then recover after adding a second passage. A combined uncertainty and semantic-drift score improves calibration, and measurements remain above chance on RAGTruth QA. Results support a conditional view of uncertainty as a useful measure of RAG hallucination risk.

1 Introduction

Retrieval-augmented generation (RAG) systems (Lewis et al., 2020) are meant to ground language-model answers in retrieved evidence. They can still produce answers that sound plausible while making claims not supported by that evidence (Ji et al., 2023). Token probabilities offer an appealing measurement: if an answer is poorly supported by the retrieved context, the model may assign lower probability to its tokens. Likelihood measures compatibility with the model's conditioning context, so its connection to faithfulness depends on what that context contains.

This distinction matters because retrieval changes the meaning of uncertainty. When retrieved evidence is adequate, unsupported factual edits should be harder to predict from the context, and token uncertainty can expose that mismatch. When retrieval coverage is poor, the model may answer from internal knowledge. The answer can then be unsupported by the retrieved passage while still receiving high probability under the model. The same low perplexity that looks reassuring under good retrieval can be misleading when the retrieved passage is incomplete.

The central question is therefore when uncertainty has the right evidential meaning for hallucination risk. Experiments use Phi-3-mini-4k-instruct (Phi-3-mini), Gemma-3-4B-IT (Gemma-3-4B), Llama-3.1-8B-Instruct (Llama-3.1-8B), and Qwen2.5-14B-Instruct (Qwen2.5-14B) on HotpotQA and SQuAD (Yang et al., 2018; Rajpurkar et al., 2016). The controlled benchmark first removes a length-based shortcut by matching faithful and hallucinated answers within word-count bins. This selection step preserves answer text and compares examples from both classes at matched lengths. The experiments then test whether token uncertainty remains informative, how retrieval depth changes the measurement, and whether the resulting probabilities are usable at thresholds.

The main testable claim is that uncertainty can measure RAG hallucination risk, while retrieval coverage determines what the measurement means. On controlled answers with targeted unsupported factual edits, perplexity is a strong single-feature discriminator after length control. Under sparse retrieval, the same likelihood score can fail because unsupported answers may still receive high model probability. This makes uncertainty a conditional measurement of evidence support.