AI
New compression-based technique eliminates repetitive text in AI language models
Researchers introduce an information-theoretic penalty that stops language models from repeating themselves during generation without sacrificing reasoning ability.
A team of computer scientists has developed a novel method to combat one of the persistent flaws in how large language models generate text: the tendency to get stuck in repetitive loops. The approach, grounded in information theory and data compression principles, shows promise for improving the quality of AI-generated reasoning without requiring probabilistic sampling techniques.
The Problem with Current Models#
Language models often fall into degenerate patterns during generation, especially when using deterministic decoding—where the model always picks the highest-probability next token. Existing safeguards like frequency and repetition penalties have proven inadequate; industry-standard approaches reportedly fail to prevent repetitive output in up to 4% of cases.
A Compression-Based Solution#
The researchers' LZ penalty draws inspiration from the LZ77 lossless compression algorithm. The method works by measuring how easily different portions of generated text can be compressed, then penalizing sequences that are highly compressible. This approach connects to a deeper principle in information theory: the duality between prediction and compression. When text is highly compressible, it contains little novel information—so the penalty effectively steers the model away from recycled or redundant patterns.
Performance and Applications#
Testing on state-of-the-art open-source reasoning models reveals that the LZ penalty enables greedy (temperature-zero) decoding—the most deterministic form of generation—while maintaining full model capability and virtually eliminating degenerate repetition. This is significant for applications where consistent, deterministic behavior is valuable, such as complex problem-solving or formal reasoning tasks.
Why It Matters#
The technique bridges two concepts often kept separate in machine learning: compression-based analysis and practical decoding. By leveraging fundamental information-theoretic principles rather than heuristic adjustments, the method offers a principled way to improve language model outputs at generation time.

