Measuring the Impact of Lexical Training Data Coverage on Hallucination Detection in Large Language Models

Shuo Zhang, Fabrizio Gotti, Fengran Mo, Jian-Yun Nie
11/22/2025
cs.CLcs.AI

Official code: WWWonderer/ostd (0 stars, last commit 2025-05-17).

Abstract

Hallucination in large language models (LLMs) is a fundamental challenge, particularly in open-domain question answering. Prior work attempts to detect hallucination with model-internal signals such as token-level entropy or generation consistency, while the connection between pretraining data exposure and hallucination is underexplored. Existing studies show that LLMs underperform on long-tail knowledge, i.e., the accuracy of the generated answer drops for the ground-truth entities that are rare in pretraining. However, examining whether data coverage itself can serve as a detection signal is overlooked. We propose a complementary question: Does lexical training-data coverage of the question and/or generated answer provide additional signal for hallucination detection? To investigate this, we construct scalable suffix arrays over RedPajama's 1.3-trillion-token pretraining corpus to retrieve $n$-gram statistics for both prompts and model generations. We evaluate their effectiveness for hallucination detection across three QA benchmarks. Our observations show that while occurrence-based features are weak predictors when used alone, they yield modest gains when combined with log-probabilities, particularly on datasets with higher intrinsic model uncertainty. These findings suggest that lexical coverage features provide a complementary signal for hallucination detection. All code and suffix-array infrastructure are provided at https://github.com/WWWonderer/ostd.

View on arXivView PDF

Code Implementations(1)

WWWonderer/ostdOfficial100%
00Rust, ShellDec 3, 20241 years ago

Similar Papers

Cite this paper

@article{zhang2025measuring,
  title  = {Measuring the Impact of Lexical Training Data Coverage on Hallucination Detection in Large Language Models},
  author = {Shuo Zhang and Fabrizio Gotti and Fengran Mo and Jian-Yun Nie},
  year   = {2025},
  eprint = {2511.17946},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2511.17946v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2511.17946.svg)](https://codeofpaper.com/paper/2511.17946)

Discussion