Retrieval augmented consistency scoring for model agnostic hallucination detection in large language models

Abstract Large language models (LLMs) are increasingly deployed in high-stakes domains such as healthcare, law, education, and scientific research, where factual accuracy is paramount. However, LLMs frequently generate plausible-sounding but factually incorrect statements, a phenomenon widely known as hallucination. Existing detection approaches are constrained by significant practical limitations: white-box methods require access to model internals that are inaccessible from commercial APIs; self-consistency sampling incurs prohibitive inference overhead ($k\times$ additional LLM calls); and perplexity-based signals fail to distinguish factual errors from genuinely novel correct statements. In this paper, we propose RAG-CS (Retrieval-Augmented Consistency Scoring), a post-hoc, model-agnostic hallucination detection framework requiring no access to LLM logits, weights, or sampling distributions. Given any LLM-generated response, RAG-CS first sentence-segments the output, then retrieves the top-$k$ evidence passages per sentence from a knowledge corpus using a dense bi-encoder retriever indexed with FAISS. A cross-encoder natural language inference (NLI) model computes pairwise semantic consistency scores between each response sentence and its retrieved evidence. Finally, a lightweight logistic regression classifier aggregates these scores, including statistical features over the score distribution, into a binary hallucination label and per-sentence fine-grained indicators. We conduct comprehensive evaluations on four hallucination benchmarks (TruthfulQA, HaluEval, FEVER, and FaithDial) and demonstrate that RAG-CS achieves F1 scores of 87.3\%, 84.6\%, 89.1\%, and 83.7\%, respectively, outperforming strong baselines including SelfCheckGPT-NLI, SAPLMA, and FActScore by 4.1--9.8 percentage points. Crucially, RAG-CS generalizes across generating models (GPT-3.5, GPT-4, LLaMA-2-7B/13B, Mistral-7B) with no model-specific tuning, and requires only a single LLM inference call plus under 300~ms of retrieval and scoring overhead per query. Ablation studies rigorously confirm the complementary, indispensable contributions of dense retrieval and cross-encoder NLI scoring. Qualitative analysis reveals interpretable per-sentence hallucination patterns. We release all code, retrieval indices, and model checkpoints to support reproducible research.

Authors

Institutions

Publication Details

Journal
Research Square
Published
2026-11-13
DOI
https://doi.org/10.21203/rs.3.rs-11187042/v1
Primary Topic
Topic Modeling
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Retrieval augmented consistency scoring for model agnostic hallucination detection in large language models

N. Pavithra, Preethi Preethino Srivathsa, Nandeesh S Mysore Matt
1 links
Research Square
Topic Modeling
preprint

Retrieval augmented consistency scoring for model agnostic hallucination detection in large language models

N. Pavithra, Preethi Preethino Srivathsa, Nandeesh S Mysore Matt
preprint en

Abstract

Abstract Large language models (LLMs) are increasingly deployed in high-stakes domains such as healthcare, law, education, and scientific research, where factual accuracy is paramount. However, LLMs frequently generate plausible-sounding but factually incorrect statements, a phenomenon widely known as hallucination. Existing detection approaches are constrained by significant practical limitations: white-box methods require access to model internals that are inaccessible from commercial APIs; self-consistency sampling incurs prohibitive inference overhead ($k\times$ additional LLM calls); and perplexity-based signals fail to distinguish factual errors from genuinely novel correct statements. In this paper, we propose RAG-CS (Retrieval-Augmented Consistency Scoring), a post-hoc, model-agnostic hallucination detection framework requiring no access to LLM logits, weights, or sampling distributions. Given any LLM-generated response, RAG-CS first sentence-segments the output, then retrieves the top-$k$ evidence passages per sentence from a knowledge corpus using a dense bi-encoder retriever indexed with FAISS. A cross-encoder natural language inference (NLI) model computes pairwise semantic consistency scores between each response sentence and its retrieved evidence. Finally, a lightweight logistic regression classifier aggregates these scores, including statistical features over the score distribution, into a binary hallucination label and per-sentence fine-grained indicators. We conduct comprehensive evaluations on four hallucination benchmarks (TruthfulQA, HaluEval, FEVER, and FaithDial) and demonstrate that RAG-CS achieves F1 scores of 87.3\%, 84.6\%, 89.1\%, and 83.7\%, respectively, outperforming strong baselines including SelfCheckGPT-NLI, SAPLMA, and FActScore by 4.1--9.8 percentage points. Crucially, RAG-CS generalizes across generating models (GPT-3.5, GPT-4, LLaMA-2-7B/13B, Mistral-7B) with no model-specific tuning, and requires only a single LLM inference call plus under 300~ms of retrieval and scoring overhead per query. Ablation studies rigorously confirm the complementary, indispensable contributions of dense retrieval and cross-encoder NLI scoring. Qualitative analysis reveals interpretable per-sentence hallucination patterns. We release all code, retrieval indices, and model checkpoints to support reproducible research.

Research Square
Manipal Academy of Higher Education (IN)
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon