No Free Lunch: Fundamental Limits of Learning Non-Hallucinating Generative Models

Changlong Wu, Ananth Grama, Wojciech Szpankowski

Generative models, such as Large Language Models (LLMs), have demonstrated impressive capabilities in synthesizing high-quality text, images, and code. However, a persistent and critical challenge remains: "hallucinations." These occur when a model generates plausible-sounding but factually incorrect information. While the AI industry has deployed empirical fixes like Reinforcement Learning from Human Feedback (RLHF) or factual data augmentation, a rigorous mathematical understanding of why this happens—and whether it is fundamentally solvable—has been elusive.

This paper investigates a fundamental question: Can a learner, given a finite set of truthful examples, guarantee the production of a model that does not hallucinate? By applying computational learning theory, the authors reveal a "No Free Lunch" theorem for generative models, proving that truthful data alone is statistically insufficient to prevent hallucinations.

Defining Hallucination in Generative Models

To study this theoretically, the authors frame the problem using Distribution Probably Approximately Correct (PAC) Learning. In this framework, there is a natural tension: we want models to generate novel insights rather than just memorizing and retrieving training data, but we strictly want to avoid generating "falsifiable" artifacts.

Visualizing Hallucination

As illustrated above, hallucination can be defined geometrically. Within the space of all possible instances $\mathcal{X}$, there is a subset of true Facts $\mathcal{T}$. A generative model learns a distribution $\hat{p}_n$ based on independent and identically distributed (i.i.d.) sampling from a faithful demonstrator (a source that only provides true facts). Hallucination occurs in the red shaded region—the probability mass where the support of the learned model generates instances that fall outside the set of true Facts $\mathcal{T}$.

The "No Free Lunch" Impossibility

The most striking insight from this research is that the "truth" is insufficient. Even if a training dataset is 100% truthful and perfect, a learner cannot distinguish between multiple underlying "fact sets" that could have plausibly produced that data.

The authors prove this via an impossibility theorem (Theorem 1): Agnostic proper learning of non-hallucinating models is statistically impossible relying solely on the training set. Even for a trivially small hypothesis class containing only two possible models, a learner cannot guarantee a low hallucination rate without additional assumptions. Without a prior bias, the learner will eventually select a model that places probability mass on a non-fact.

The Path Forward: Inductive Biases and VC-Dimension

If truthful data isn't enough, how do we stop hallucinations? The paper proves that developers must incorporate inductive biases—prior knowledge about the structure of facts—into the learning process.

The key to achieving "generalizable" non-hallucination lies in the complexity of the fact set itself, measured by its VC-dimension.

  • Possibility through VC-Dimension (Theorems 2 & 3): If the set of all possible facts can be restricted to a concept class with a finite VC-dimension $d$, non-hallucinating learning becomes mathematically possible. The authors establish that an improper learner can achieve a hallucination rate $\epsilon$ with a sample complexity of roughly $O(\frac{d \log(1/\epsilon)}{\epsilon})$, and they provide a matching lower bound proving VC-dimension is the correct complexity measure for this problem.
  • The Power of Improper Learning: Surprisingly, avoiding hallucinations is easier if the learner is "improper"—meaning it is not forced to output a model from a specific architectural class (like a specific Transformer setup). An improper learner can simply output the empirical distribution of the data, which never hallucinates against the training set (though it may fail to generalize well).

Limitations and Future Directions

While this paper provides a crucial theoretical foundation, it is primarily conceptual. The proposed learning rules—which involve maximizing a model's information while constraining it to a "version space" consistent with training data—are computationally inefficient and not immediately applicable to training massive real-world LLMs.

Furthermore, defining a strict concept class for "facts" in the real world is an open challenge. The space of all true human sentences is vastly more complex than the abstract mathematical constructions used to prove these theorems.

Future work must bridge this theoretical-practical divide. The authors suggest exploring how current empirical methods—like logical rule enforcement, synthetic data generation, or RLHF—can be mathematically modeled as the very "inductive biases" their theory identifies as necessary for a hallucination-free future.

Summary updated

BibTeX
@inproceedings{wu2025no,
  author = {Changlong Wu and Ananth Grama and Wojciech Szpankowski},
  title = {{No Free Lunch: Fundamental Limits of Learning Non-Hallucinating Generative Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=OwNoTs2r8e},
}
Figure