Source-linked AI summary
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
TL;DR
Maximization-based decoding can trap neural language models in consecutive sentence-level loops, despite such repetitions being rare in human text. The paper quantifies the probability dynamics behind this behavior and proposes DITTO, which reduces repetition while maintaining or improving generation quality across generation and summarization tasks.
Problem
Neural language models can become trapped in consecutive sentence-level repetition under maximization-based decoding, unlike human text.
Source: §1 · p. 1Method
Results
DITTO reduces repetitions without sacrificing perplexity and improves generation quality across Wikitext-103 open-ended generation and CNN/DailyMail summarization.
Source: §1 · p. 3, §4.2 · p. 7, §4.3 · p. 8Takeaways & Limitations
The findings identify previous-sentence preference and self-reinforcement as key mechanisms behind repetition loops, motivating probability decay during training.
Source: §1 · pp. 2–3, §6 · p. 10The analysis does not examine deeper causes of repetition from model embeddings, neural architectures, or intrinsic language characteristics.
Source: §6 · p. 10
Abstract
from arXiv · showhide
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 (\textit{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 \textit{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 \textbf{DITTO} (Pseu\underline{D}o-Repet\underline{IT}ion Penaliza\underline{T}i\underline{O}n), 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.
1 Introduction
Maximization-based decoding can produce consecutive sentence-level loops because repetition probabilities reinforce prior repetitions. The paper analyzes this behavior and introduces DITTO, which trains models to penalize repetitive sentences while preserving or improving generation quality.
1 Introduction
- Language models prefer consecutive sentence-level repetition more strongly than word- or phrase-level repetition, unlike human language.Greedy decoding on Wikitext-103 gets stuck in sentence-level repetition, whereas human corpora contain substantially fewer such repetitions.Source: §1 · p. 1, Figure 1 · p. 2
- Repetition probability rises with prior repetitions, and sentences with higher initial probabilities usually show stronger self-reinforcement.The probability can increase almost monotonically and eventually stabilize near a ceiling.Source: §1 · p. 2, Figure 2 · p. 3
- Self-reinforcement creates sentence-level loops because each generated repetition further increases the probability of continuing that sentence.The mechanism links high-likelihood generated sentences to progressively stronger copying behavior.Source: §1 · p. 3
- DITTO trains on pseudo-repetitive data to make repetition probabilities decay as sentence-level repetitions accumulate.The method targets both the tendency to repeat previous sentences and their self-reinforcement effect.Source: §1 · p. 3
- DITTO reduces repetitions without sacrificing perplexity and improves generation quality across Wikitext-103 generation and CNN/DailyMail summarization.The reported gains include lower perplexity and higher MAUVE than strong competitors in open-ended generation, with best overall performance on summarization.Source: §1 · p. 3
2 Analyzing Repetition
The analysis measures how token probabilities change when sentences are manually repeated in context. Across corpus types, repetition is favored immediately, strengthened by additional repetitions, and especially pronounced for sentences with high initial probability.
2.1 Experiment Design
- The experiment repeats each sentence N = 100 times and computes average token probability, increased-probability rate, and winner rate across three corpora.The corpora are Drandom, Dbook, and Dwiki, each containing 1,000 sentences.Source: Figure 3 · p. 4, §2.1 · p. 4
- A winner is a token whose probability exceeds its initial value and is maximal under the current context, making winner rate relevant to greedy decoding.The setup defines sentence-level context repetition by matching token positions and preceding within-sentence context across repetitions.Source: §2.1 · p. 4
2.2 Results and Analyses
- IP1 exceeds 90% across corpus types, showing that one sentence-level context repetition usually raises the next repetition’s probability.The model can copy the next token after recognizing the same sentence-level context, even before the token itself has repeated at the current step.Source: §2.2 · p. 4
- TP, IP, and WR increase monotonically with repetition count before converging near ceiling values, demonstrating self-reinforcement.More historical sentence repetitions make the model more likely to continue generating that sentence.Source: §2.2 · p. 5
- Sentences with high initial probability grow faster in TP and WR and reach high ceilings after fewer repetitions.Such sentences are therefore more likely to be repeatedly generated by maximization-based decoding.Source: §2.2 · p. 5
- The analysis attributes repetition loops to high-likelihood prior sentences, context-based copying, and subsequent self-reinforcement during maximization-based decoding.Stochastic sampling may reduce the risk by lowering prior-sentence likelihoods and avoiding maximum-probability token selection.Source: §2.2 · p. 5
3 Pseudo-repetition Penalization Training
DITTO trains models on pseudo-repetitive sentences to penalize sentence-level repetition while preserving useful repetition behavior.
Sentence-level Repetition Penalization
- The method explicitly teaches the model to avoid redundant sentences by applying a sentence-level repetition penalization loss to tokens in repeated sentences.This training targets the tendency to repeat previous sentences and the resulting self-reinforcement effect.Source: §3 · p. 5
Pseudo Repetitive Data Construction
- DITTO constructs pseudo-repetitive data by repeating a randomly sampled training sentence until the model’s maximum input length is reached.The method may use sequences such as 1,536 tokens for open-ended generation.Source: §3 · p. 5
Sentence-level Repetition Penalization
- When λ < 1, DITTO makes token probabilities decay across repetitions, whereas λ = 1 prevents self-reinforcement without requiring probability decay.The penalization factor controls how strongly later repetitions are suppressed.Source: §3 · p. 5
Training Procedure
- DITTO fine-tunes a standard maximum-likelihood baseline by mixing repetition-penalization updates with normal MLE updates.Appending the repetitive sentence’s previous context as a prefix produced better and more stable performance than omitting it.Source: §3 · p. 5
Discussion
- Unlike hard repetition constraints, DITTO treats necessary token- and phrase-level repetitions as useful positives while targeting over-repetition as negative behavior.This objective is intended to reduce over-penalization of repetitions that are appropriate in context.Source: §3 · p. 6
4 Experiments
Experiments evaluate DITTO across open-ended generation, summarization, human judgments, and robustness analyses. DITTO reduces repetition while improving generation quality and remains effective across decoding lengths, tasks, and hyper-parameter settings.
4.2 Results of Open-ended Generation
- DITTO reduces phrase- and sentence-level repetition while achieving the best MAUVE score of 0.77 on Wikitext-103 open-ended generation.Compared with standard MLE, DITTO also achieves lower perplexity and higher accuracy rather than sacrificing language-modeling quality.Source: §4.2 · pp. 6–7, Table 1 · p. 7
- DITTO achieves the highest MAUVE of 0.96 with top-k or nucleus sampling and produces repetition metrics closest to human text.The method reduces repetitions relative to the MLE baseline under both stochastic decoding strategies.Source: §4.2 · p. 7, Table 2 · p. 7
- DITTO consistently and significantly outperforms competing methods in human evaluations across different decoding strategies.Crowdworkers compare grammaticality, relevance, coherence, and informativeness on generations from shared test prefixes.Source: §4.2 · p. 7, Table 3 · p. 7
- DITTO overcomes self-reinforcement: TP, IP, and WR drop rapidly as repetitions grow, unlike UL and SG where they increase almost monotonically.These analyses directly test whether training-based methods address the repetition mechanism identified earlier.Source: §4.2 · pp. 7–8, Figure 4 · p. 8
4.3 Results of Directed Generation
- On CNN/DailyMail summarization, DITTO consistently outperforms UL, SG, and other competitive baselines on ROUGE scores while remaining compatible with n-gram blocking.The directed-generation setup uses BART-large and standard beam search with tri-gram blocking.Source: §4.3 · p. 8, Table 4 · p. 8
4.4 Analyses
- DITTO remains effective across decoding lengths, consistently and significantly outperforming MLE under the tested length constraints.The decoding-length analysis reports robustness across the evaluated settings.Source: §4.4 · p. 8, Figure 5 · p. 9
- The recommended mix ratio is γ = 0.5, while the preferred penalization factor differs by task: λ = 0.5 for Wikitext-103 and λ = 0.9 for summarization.The authors conjecture that repetition is more severe in the more unconstrained open-ended generation task.Source: §4.4 · p. 9, Figure 5 · p. 9
5 Related Work
Prior work documents repetition in neural text generation, but the causes of consecutive sentence-level repetition remain insufficiently analyzed. This paper distinguishes its quantitative analysis from earlier theoretical and mitigation-focused approaches.
- Neural language models generate consecutive word-, phrase-, and sentence-level repetitions, with sentence-level repetition producing redundant, non-informative text unlike human language.Source: §5 · p. 9
- Unlike self-recovery results obtained with ancestral sampling, this paper studies why maximization-based decoding increases repetition when tokens share the same sentence-level context.Source: §5 · pp. 9–10
- Earlier work proposes training- and decoding-based mitigation methods, including unlikelihood training, straight to gradient, n-gram blocking, top-k, and nucleus sampling.Source: §5 · p. 9
- Prior analyses identify positive feedback loops and long-range contextual relationships, but provide limited detailed numeric and statistical evidence across sentences.Source: §5 · p. 10
6 Conclusion and Future Work
The paper explains consecutive sentence-level repetition through preference for previous sentences and self-reinforcement, then proposes DITTO and evaluates it across generation and summarization. It also identifies deeper architectural and representational explanations as future work.
- The analysis identifies previous-sentence preference and self-reinforcement as the mechanisms underlying consecutive sentence-level repetition.Source: §6 · p. 10
- DITTO constructs pseudo-repetitive data and trains models to gradually decay repetition probability as sentence repetitions increase.Source: §6 · p. 10
- Experiments on Wikitext-103 open-ended generation and CNN/DailyMail summarization demonstrate the method’s superiority.Source: §6 · p. 10
- The work does not analyze deeper causes from model embeddings, neural architectures, or intrinsic language characteristics, leaving those questions for future research.Source: §6 · p. 10
Checklist
The checklist reports that the paper addresses contributions, limitations, reproducibility, training details, error bars, compute, and asset documentation. It marks consent, participant-risk, compensation, licensing, and new-asset items as not applicable where relevant.
- The paper reports that it describes its contributions and scope and discusses limitations in Section 6.Source: Checklist · p. 14
- The paper marks potential negative societal impacts as not applicable and states that ethics review guidelines were followed.Source: Checklist · p. 14
- The paper states that code, data, instructions, training details, error bars, and compute information are provided or documented.Source: Checklist · p. 14
- The paper cites existing assets and marks licensing and inclusion of new assets as not applicable.Source: Checklist · p. 14
- The checklist marks consent, personally identifiable or offensive content, participant instructions, participant risks, and compensation as not applicable or addressed as specified.Source: Checklist · p. 14
A Consecutive Repetitions and Statistics of Beam Search Results
The paper measures consecutive repetition at word, phrase, and sentence levels and shows that maximization-based decoding produces substantially more sentence-level repetition than human language. It then examines how repetition probability changes as repeated context accumulates.
A Consecutive Repetitions and Statistics of Beam Search Results
- The paper defines repetition statistics separately for adjacent words, repeated k-word phrases, and consecutive sentences, averaging each measure over the corpus.Source: A Consecutive Repetitions and… · p. 15
- Beam search and greedy decoding produce substantially more sentence-level repetition than human language, extending the phenomenon beyond greedy search.Source: A Consecutive Repetitions and… · p. 15, Figure 6 · p. 15
B Self-reinforcement in Model Generated Texts
- The probability of the token ‘located’ increases almost monotonically with the number of historical repetitions, demonstrating self-reinforcement in autoregressive sentence loops.Source: B Self-reinforcement in Model… · p. 15, Figure 7 · p. 16
- Manual sentence repetition isolates the relationship between repetitive-token probabilities and repeated context, avoiding irregular generated sequences and testing whether the effect is intrinsic to language modeling.Source: B Self-reinforcement in Model… · pp. 15–16
C Loss Function of DITTO
DITTO penalizes token probabilities across repeated sentences, with λ controlling whether repetition probabilities stay equal or decrease. Margin-based variants can over-penalize repetition and perform worse.
- DITTO minimizes its loss when the current token probability equals λ times the previous repetition's probability, while stopping gradients through the reference value.Source: C Loss Function of DITTO · p. 16
- λ < 1 makes the probability of a token in the current repetition lower than in the previous repetition, countering self-reinforcement.Source: C Loss Function of DITTO · p. 16
- MSE is an alternative loss, but it achieves inferior performance in practice on Wikitext-103.Source: C Loss Function of DITTO · p. 16, Table 5 · p. 17
- LDITTO-margin performs worse because it can reduce repetition probability nearly to zero after one repetition, regardless of the previous probability.Source: C Loss Function of DITTO · p. 16, Figure 8 · p. 17
- Over-penalizing repetitions may forbid necessary repetitions, hurt language modeling ability, and lead to inferior performance.Source: C Loss Function of DITTO · p. 16
D Additional Analyses and Experiments
Additional analyses show that initial sentence probability predicts self-reinforcement strength, while shorter pseudo-repetitive training sequences are evaluated through averaged Dwiki results.
D.1 Self-reinforcement at sentences with different initial probabilities
- Higher initial-probability sentences reach higher TP and WR as repetitions increase, indicating stronger self-reinforcement and greater repeatability under greedy decoding.Source: §D.1 · p. 17
- Figure 10 averages results across Dwiki sentences to compare training-based methods when repetitive inputs are limited to 150 tokens.Source: Figure 10 · p. 18
D.2 Study of Pseudo Repetitive Data
DITTO remains effective with alternative pseudo-repetitive constructions, but short training sequences lose effectiveness during long decoding, supporting long-sequence penalization.
- Repeating two consecutive sentences as a group achieves results similar to repeating one sentence as pseudo data.Source: §D.2 · p. 18
- DITTO-short reduces TP, IP, and WR for short decoding but these metrics rise during long decoding, unlike full-length DITTO.Source: §D.2 · p. 18
- With equal 150-token penalization length, DITTO is more effective than UL-token+seq and avoids its autoregressive generation requirement.Source: §D.2 · p. 18
E Human Evaluation Details
Human evaluation compares DITTO with baselines using pairwise judgments of generations, while supplementary examples illustrate outputs from greedy and nucleus sampling.
E Human Evaluation Details
- Three fluent English speakers compare continuations from 100 Wikitext-103 prefixes on grammar, relevance, coherence, and informativeness.Source: E Human Evaluation Details · p. 18, Figure 11 · p. 19
- The evaluation win rate is DITTO's number of wins divided by the total number of pairwise comparisons.Source: E Human Evaluation Details · p. 18
F Examples
- Examples are provided for different training methods under greedy and nucleus sampling decoding.Source: F Examples · p. 19, Table 7 · p. 20, Table 8 · p. 21
Related papers
This paper cites
- Attention Is All You Need2017
- Language Models are Few-Shot Learners2020
- PyTorch: An Imperative Style, High-Performance Deep Learning Library2019
- BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension2019
- Pointer Sentinel Mixture Models2016
- Teaching Machines to Read and Comprehend2015
Cited by
- GenAI as an 'Invisible Hand' in Opinion Dynamics: Evidence from a Group-Level Simulation Study2026
- Why Full-Duplex Speech Models Collapse in Long Conversations2026
- Feedback That Backfires in Games: Do LLM Players Repeat the Move They Just Watched Fail?2026
- DeLoop: Repeated Actions as Self-Supervision for Long-Horizon Agents2026
- Visible but Not Avoided: State-Dependent Re-Proposal of Rejected Candidates in Catalog-Based LLM Optimization Loops2026
- UniData: Universal Multimodal Instruction Generation Pipeline2026