Learning to Break the Loop: Analyzing and Mitigating Repetitions for Neural Text Generation
Jin Xu, Xiaojiang Liu, Jianhao Yan, Deng Cai, Huayang Li, Jian Li
Abstract
While large-scale neural language models, such as GPT2 and BART, have achieved impressive results on various text generation tasks, they tend to get stuck in undesirable sentence-level loops with maximization-based decoding algorithms (e.g., greedy search). This phenomenon is counter-intuitive since there are few consecutive sentence-level repetitions in human corpora (e.g., 0.02% in Wikitext-103). To investigate the underlying reasons for generating consecutive sentence-level repetitions, we study the relationship between the probabilities of the repetitive tokens and their previous repetitions in the context. Through our quantitative experiments, we find that 1) Language models have a preference to repeat the previous sentence; 2) The sentence-level repetitions have a self-reinforcement effect: the more times a sentence is repeated in the context, the higher the probability of continuing to generate that sentence; 3) The sentences with higher initial probabilities usually have a stronger self-reinforcement effect. Motivated by our findings, we propose a simple and effective training method DITTO (PseuDo-RepetITion PenalizaTiOn), where the model learns to penalize probabilities of sentence-level repetitions from pseudo repetitive data. Although our method is motivated by mitigating repetitions, experiments show that DITTO not only mitigates the repetition issue without sacrificing perplexity, but also achieves better generation quality. Extensive experiments on open-ended text generation (Wikitext-103) and text summarization (CNN/DailyMail) demonstrate the generality and effectiveness of our method. Code is released at https://github.com/Jxu-Thu/DITTO .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
38 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Neural Text Generation With Unlikelihood Training cites The Curious Case of Neural Text Degeneration
- The Curious Case of Neural Text Degeneration cites Neural Text Generation With Unlikelihood Training
- From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformers cites Neural Text Generation With Unlikelihood Training
- From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformers cites Language Models are Few-Shot Learners
- From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformers cites The Curious Case of Neural Text Degeneration
- MAUVE: Measuring the Gap Between Neural Text and Human Text using Divergence Frontiers cites Neural Text Generation With Unlikelihood Training
- MAUVE: Measuring the Gap Between Neural Text and Human Text using Divergence Frontiers cites Language Models are Few-Shot Learners
- MAUVE: Measuring the Gap Between Neural Text and Human Text using Divergence Frontiers cites The Curious Case of Neural Text Degeneration
- DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language Models cites Language Models are Few-Shot Learners
- Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
- PLANNER: Generating Diversified Paragraph via Latent Language Diffusion Model cites Neural Text Generation With Unlikelihood Training
- PLANNER: Generating Diversified Paragraph via Latent Language Diffusion Model cites The Curious Case of Neural Text Degeneration
- PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization cites Neural Text Generation With Unlikelihood Training
- Repetition In Repetition Out: Towards Understanding Neural Text Degeneration from the Data Perspective cites Neural Text Generation With Unlikelihood Training
- Repetition In Repetition Out: Towards Understanding Neural Text Degeneration from the Data Perspective cites MAUVE: Measuring the Gap Between Neural Text and Human Text using Divergence Frontiers
- Repetition In Repetition Out: Towards Understanding Neural Text Degeneration from the Data Perspective cites The Curious Case of Neural Text Degeneration
Cited by top-tier papers38
- DoLa: Decoding by Contrasting Layers Improves Factuality in Large Language ModelsYung-Sung Chuang, Yujia Xie, Hongyin Luo, Yoon Kim et al.ICLR 2024 · 354 citations
- PLANNER: Generating Diversified Paragraph via Latent Language Diffusion ModelYizhe Zhang, Jiatao Gu, Zhuofeng Wu, Shuangfei Zhai et al.NeurIPS 2023 · 65 citations
- Repetition In Repetition Out: Towards Understanding Neural Text Degeneration from the Data PerspectiveHuayang Li, Tian Lan, Zihao Fu, Deng Cai et al.NeurIPS 2023 · 54 citations
- From Self-Attention to Markov Models: Unveiling the Dynamics of Generative TransformersMuhammed Emrullah Ildiz, Yixiao Huang, Yingcong Li, Ankit Singh Rawat et al.ICML 2024 · 45 citations
- CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based VerificationYuchen Tian, Weixiang Yan, Qian Yang, Xuandong Zhao et al.AAAI 2025 · 41 citations
Builds on14
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
- PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive SummarizationJingqing Zhang, Yao Zhao, Mohammad Saleh, Peter J. LiuICML 2020 · 2,453 citations
- Neural Text Generation With Unlikelihood TrainingSean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan et al.ICLR 2020 · 683 citations
- MAUVE: Measuring the Gap Between Neural Text and Human Text using Divergence FrontiersKrishna Pillutla, Swabha Swayamdipta, Rowan Zellers, John Thickstun et al.NeurIPS 2021 · 606 citations
Related papers
- Mitigating the Learning Bias towards Repetition by Self-Contrastive Training for Open-Ended GenerationJian Guan, Minlie HuangACL Findings 2023 · 1 citation
- Rethinking Repetition Problems of LLMs in Code GenerationYihong Dong, Yuchen Liu, Xue Jiang, Bin Gu et al.ACL 2025
- FOCUS & RePAIR: Mitigating Text Degeneration via Token-Level Guidance For Pruned Large Language ModelsJunyoung Lee, Sehyeon Park, Shinhyoung Jang, Seonha Ryu et al.ICML 2026
- The Hyperfitting Phenomenon: Sharpening and Stabilizing LLMs for Open-Ended Text GenerationFredrik Carlsson, Fangyu Liu, Daniel Ward, Murathan Kurfali et al.ICLR 2025 · 1 citation
- A Contrastive Framework for Neural Text GenerationYixuan Su, Tian Lan, Yan Wang, Dani Yogatama et al.NeurIPS 2022 · 349 citations
