Abstract
Neural language models frequently suffer from "degeneration," a phenomenon where the model enters repetitive, nonsensical loops during text generation. While previous research has attributed this to the likelihood objective or specific model architectures, this paper proposes a simpler explanation: models are faithfully mimicking the natural repetitions present in their training data. By introducing Repetition Dropout—a mechanism that randomly masks attention to repetitive $n$-grams during training—the authors demonstrate a significant reduction in text degeneration across various model scales and datasets.
Introduction
When utilizing greedy decoding, standard language models (LMs) often fall into pathological loops (e.g., "The Army was not aware of the Army's role in the conflict, and the Army was not aware..."). This behavior, known as neural text degeneration, undermines the utility of LMs in long-form generation.
Existing theories have blamed the "likelihood objective," "high-inflow words," or "self-reinforcement" mechanisms. However, applying Ockham’s Razor, the authors of this study suggest a more fundamental "data perspective." They hypothesize that because human language contains valid repetitions for grammatical or thematic reasons, models over-learn these patterns and amplify them into infinite loops during inference. This leads to the core thesis: "Repetition In, Repetition Out."
Methodology: Repetition Dropout
To address this, the authors propose Repetition Dropout, a plug-and-play modification to the standard Transformer attention mechanism that requires no architectural changes. The process follows three steps:
- Identify Repetitions: During training, the algorithm identifies $n$-grams that have already appeared earlier in the same sequence.
- Random Masking: Instead of allowing the model to attend to all previous tokens, it randomly masks the attention to these repetitive $n$-grams with a probability $p$ (e.g., 0.6).
- Forced Contextual Learning: By masking these tokens, the model is forced to predict the next word based on the broader context rather than simply relying on the existence of a prior repetitive pattern.
Experimental Setup
The study utilizes a diverse range of datasets to ensure generalizability:
- Wikitext-103: A benchmark for long-term dependency modeling.
- The Pile Subsets: Including OpenWebText2, FreeLaw, PubMed, and ArXiv to test various linguistic styles.
- Alpaca & WT-103 50K: Used to evaluate the impact of instruction tuning versus raw data formats.
Key Insights
The Correlation of Repetition
The authors found a strikingly strong correlation between the repetition rate in a training dataset and the repetition rate of the resulting model's output. This suggests that the model is not "broken" but is instead performing its training task too well—replicating the statistical distribution of the data, including its flaws.
Scaling and Instruction Tuning
While larger models (up to 66B parameters) repeat themselves less frequently than smaller models, scaling is not a complete cure. Even massive models exhibit high repetition scores under greedy decoding. Interestingly, the study found that instruction-tuned models (like Llama-2-chat) degenerate less primarily because instruction-response datasets are naturally less repetitive than raw web-crawled data.
A Unified Theory
The paper argues that previous interventions, such as Unlikelihood Training or SCALEGRAD, are essentially indirect methods of penalizing data repetitions. By focusing directly on the data perspective via Repetition Dropout, the authors provide a simpler, unified explanation for the success of these prior methods.
Results
Repetition Dropout proved highly effective at "breaking the loop":
- Quantitative Success: On Wikitext-103, a standard GPT-2 model's 4-gram repetition rate (Rep-4) was 32.64%. With Repetition Dropout, this dropped to 2.14%, nearing the human baseline of 0.28%.
- Comparison to Baselines: The method outperformed SCALEGRAD (4.44% Rep-4) and Unlikelihood Training (22.88% Rep-4).
- Qualitative Impact: Case studies using GPT-XL (1.5B parameters) showed that while the vanilla model fell into infinite sentence-level loops, the version trained with Repetition Dropout produced diverse and informative continuations.
Limitations and Trade-offs
The primary trade-off is a "perplexity tax." Because the model is forced to ignore some valid repetitions during training, its predictive accuracy (Perplexity) on real-world data decreases slightly (e.g., from ~22 to ~28 on Wikitext-103). This suggests the model may lose some nuances of natural language where repetition is grammatically or stylistically necessary.
Conclusion
By shifting the focus from model objectives to data characteristics, this research provides a clear path forward for mitigating text degeneration. Future work may involve applying Repetition Dropout to massive-scale pre-training to determine if cleaning repetition at the source can eliminate the need for complex decoding hacks in frontier models.
Summary updated