(Im)possibility of Automated Hallucination Detection in Large Language Models

Amin Karbasi, Omar Montasser, John Sous, Grigoris Velegkas

TL;DR

This paper tackles the fundamental question of whether automated hallucination detection in Large Language Models (LLMs) is even possible. They establish that without explicit negative examples (i.e., knowing what's wrong), detecting hallucinations is as hard as language identification, which is generally impossible. However, with the addition of labeled incorrect statements, detection becomes feasible.

What Problem Does This Paper Address?

Large Language Models (LLMs) are incredibly powerful, but they have a critical flaw: they often "hallucinate," producing fluent but factually incorrect outputs. This makes them unreliable for many applications. While humans can often spot these errors, automatically detecting them is a significant challenge. Existing empirical approaches show LLMs struggle as detectors and often require human feedback. This paper seeks to provide a theoretical understanding of why this is the case and under what conditions automated hallucination detection might be possible. They frame this problem using a theoretical model inspired by classical learning theory, specifically language identification and generation.

Methods

The authors introduce a formal theoretical framework to study hallucination detection. Their model is based on the Gold-Angluin framework for language identification and its extension to language generation by Kleinberg & Mullainathan.

Here's how it works:

  • The Setup: An "adversary" chooses a target language $K$ (representing correct statements) from a collection of languages $\mathcal{L}$. A "learner" (the hallucination detector) interacts with an LLM, whose outputs are represented by a set $G$. The goal is for the learner to determine if $G$ is a subset of $K$ (no hallucinations) or if $G$ contains elements outside of $K$ (hallucinations).
  • Two Scenarios:
    1. Positive Examples Only: The learner only sees examples of correct statements (i.e., elements of $K$). This is analogous to standard LLM pre-training.
  • Positive and Negative Examples: The learner also receives explicitly labeled incorrect statements (i.e., elements not in $K$). This is akin to having expert feedback.

The core of their method involves proving theoretical equivalences and impossibilities between hallucination detection and language identification under these different training regimes. They use a "black-box" approach, transforming algorithms from one task to another.

Datasets

Not discussed in the paper. The paper focuses on a theoretical framework and does not involve empirical evaluation on specific datasets.

Key Insights and Ideas

  • Hallucination Detection is Hard (Without Negative Examples): The most striking insight is that if a detector only learns from correct examples, it faces the same fundamental limitations as language identification. This explains why current LLM detectors struggle without external validation.
  • The Power of "Falsification": The paper strongly emphasizes that the ability to detect hallucinations hinges on having signals that indicate incorrectness. Simply seeing more correct examples isn't enough to guarantee reliable detection.
  • Bridging Theory and Practice: The theoretical results directly explain the empirical success of methods like Reinforcement Learning from Human Feedback (RLHF). RLHF, by incorporating human-labeled feedback (which includes negative examples), provides the crucial signal needed for effective hallucination detection.
  • Equivalence is Key: The formal proof of equivalence between hallucination detection and language identification is a major theoretical contribution. It shows that any progress in one directly translates to the other.

Key Results

  • Informal Result I (Impossibility): Automated hallucination detection, when trained only on correct examples (positive examples), is inherently difficult and typically impossible for most collections of languages. This is formally proven by showing an equivalence between hallucination detection and language identification in the limit, which is known to be a hard problem.
  • Informal Result II (Possibility): Automated hallucination detection becomes achievable when the detector is trained using both correct (positive) and explicitly labeled incorrect (negative) examples. This holds for any countable collection of languages.

Limitations and Future Work

  • Adversarial Setting: The current model uses an adversarial enumeration, which simplifies the problem. While the authors suggest their results likely carry over to probabilistic settings, this is an area for further exploration.
  • Promptless Generation: The framework assumes a promptless generation setting. Extending this to prompted generation, as seen in many real-world LLM applications, is a promising future direction.
  • Computational Restrictions: The model does not impose computational restrictions on the learning algorithm. Future work could explore how these limitations might affect detectability.
  • Quantifying Negative Examples: The paper highlights the importance of negative examples but doesn't quantify how many are needed. Future work could investigate the precise amount of negative feedback required for reliable detection.
  • Noisy Negative Examples: The current framework assumes perfectly labeled negative examples. Investigating detectability with noisy negative examples is another important avenue.
  • Relaxed Notions: The authors suggest exploring more relaxed notions of hallucination detection, such as detecting if the frequency of hallucinations exceeds a certain threshold.

Summary updated

BibTeX
@inproceedings{karbasi2025im,
  author = {Amin Karbasi and Omar Montasser and John Sous and Grigoris Velegkas},
  title = {{(Im)possibility of Automated Hallucination Detection in Large Language Models}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=e5jWdZIX0Q},
}
Figure