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
- N. Pavithra (ORCID: https://orcid.org/0000-0003-1941-4409)
- Preethi Preethino Srivathsa (ORCID: https://orcid.org/0009-0007-1226-5945)
- Nandeesh S Mysore Matt
Institutions
- Manipal Academy of Higher Education (IN)
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