Abstract
We study language generation in the limit, where an algorithm observes an adversarial enumeration of strings from an unknown target language $K$ and must eventually generate new, unseen strings from $K$. Kleinberg and Mullainathan [KM24] proved that generation is achievable in surprisingly general settings. But their generator suffers from "mode collapse," producing from an ever-smaller subset of the target. To address this, Kleinberg and Wei [KW25] require the generator's output to be "dense" in the target language. They showed that generation with density, surprisingly, remains achievable at the same generality. Both results assume perfect data: no noisy insertions and no omissions. This raises a central question: how much contamination can generation tolerate? Recent works made partial progress on this question by studying (non-dense) generation with either finite amounts of noise (but no omissions) or omissions (but no noise). We characterize robustness under contaminated enumerations:
- Generation under Contamination: Language generation in the limit is achievable for all countable collections iff the fraction of contaminated examples converges to zero. When this fails, we characterize which collections are generable.
- Dense Generation under Contamination: Dense generation is strictly less robust to contamination than generation. As a byproduct, we resolve an open question of Raman and Raman [ICML25] by showing that generation is possible with only membership oracle access under finitely many contaminated examples. Finally, we introduce a beyond-worst-case model inspired by curriculum learning and prove that dense generation is achievable even with infinite contamination provided the fraction of contaminated examples converges to zero. This suggests curriculum learning may be crucial for learning from noisy web data.
Introduction
In classical computational linguistics, Gold’s model of language identification suggests that learning a language perfectly from examples is nearly impossible. However, recent theoretical breakthroughs have shifted the focus from identification to generation. Large Language Models (LLMs) do not necessarily need to identify a language's underlying grammar perfectly; they simply need to generate new, valid strings from it.
While prior work demonstrated that "generation in the limit" is possible for any countable collection of languages, these models assumed perfect data. In reality, web-scale datasets are "contaminated" with noise (invalid strings) and omissions (missing data). This paper provides the first theoretical characterization of how much contamination a generator can tolerate before it begins to hallucinate or suffers from total mode collapse.
The Mechanics of Contamination
The authors define contamination through two lenses: noise (insertions of invalid strings) and omissions (missing valid strings). Their analysis reveals a fundamental asymmetry of errors. Generation is naturally more robust to omissions than to noise. Because the goal is to produce any valid new string, missing parts of the language does not prevent a model from generating from the parts it has observed. Conversely, noise can easily lead to "hallucinations," where the model generates invalid strings believing them to be part of the target language.
To address these challenges, the researchers introduce two primary algorithmic templates:
- Priority-Based Intersection Meta-Algorithm: This approach dynamically re-orders candidate languages based on their "empirical noise rate." If a language appears inconsistent with the data, it is penalized with a lower priority, allowing the generator to filter out bad candidates even under infinite noise, provided the noise rate eventually vanishes.
- Finite-Expansion Sub-Routine: To handle finite noise, the authors demonstrate that one can "expand" a collection of languages to include every possible version of those languages that has been slightly corrupted.
The Fragility of Dense Generation
A critical distinction in this work is between standard generation and dense generation. Dense generation requires the model to cover a significant fraction of the target language rather than merely repeating a few "safe" phrases (avoiding mode collapse).
The authors prove that dense generation is strictly less robust than standard generation. Under standard "worst-case" adversarial noise, it is impossible to achieve dense generation for all countable collections if any infinite contamination exists. This suggests that the diversity of LLM outputs is particularly vulnerable to data quality issues.
Curriculum Learning: A Mathematical Necessity?
One of the paper's most significant contributions is the theoretical justification for Curriculum Learning. By introducing a "Bounded Displacement Model"—where the data source cannot show complex examples too much earlier than simple ones—the authors show that dense generation becomes possible even with infinite contamination.
In this model, if the data arrives in a roughly "simple-to-complex" order, a generator can achieve a density of at least $1/M$ (where $M$ represents the "out-of-orderness" of the data). This suggests that the common practice of starting LLM training with simpler, cleaner data isn't just an optimization trick; it may be a fundamental mathematical requirement for learning in noisy, real-world environments.
Key Results and Implications
- The $o(1)$ Threshold: Language generation is achievable for all countable collections if and only if the fraction of noisy examples converges to zero ($o(1)$-noise).
- Resolution of Open Questions: The authors resolve a problem from Raman & Raman (2025), proving that generation is possible using only a "membership oracle" (the ability to query if a string is in the language) even with contaminated data.
- Theoretical Grounding for Hallucinations: The results provide a framework for understanding why models hallucinate when the "noise rate" of their training data exceeds certain thresholds.
Conclusion
By moving beyond worst-case analysis, this work bridges the gap between abstract learning theory and the practical realities of training LLMs on noisy web data. It highlights that while basic generation is robust, maintaining the diversity and density of language requires either near-perfect data or a structured curriculum that prioritizes simplicity and order.
Summary updated