# When Do Repetition Loops Lock? Truncation Sampling, Bounded Penalties, and a Blind Spot in DRY

arXiv: https://arxiv.org/abs/2610.24715 · HTML: https://mlsanity.com/paper/2610.24715/

## Key facts

- Cited by 1 papers in the map (data through 26 Nov 2026).
- Builds on 29 of its 42 references that are in the map.
- Submitted 17 Oct 2026.

## Builds on (most cited first, 29 of 29)

- [The Llama 3 Herd of Models](https://mlsanity.com/paper/2407.21783/) (2024)
- [Pointer Sentinel Mixture Models](https://mlsanity.com/paper/1609.07843/) (2016)
- [The Curious Case of Neural Text Degeneration](https://mlsanity.com/paper/1904.09751/) (2019)
- [Gemma 2: Improving Open Language Models at a Practical Size](https://mlsanity.com/paper/2408.00118/) (2024)
- [CTRL: A Conditional Transformer Language Model for Controllable Generation](https://mlsanity.com/paper/1909.05858/) (2019)
- [Phi-4-Mini Technical Report: Compact yet Powerful Multimodal Language Models via Mixture-of-LoRAs](https://mlsanity.com/paper/2503.01743/) (2025)
- [Neural Text Generation with Unlikelihood Training](https://mlsanity.com/paper/1908.04319/) (2019)
- [A Deep Reinforced Model for Abstractive Summarization](https://mlsanity.com/paper/1705.04304/) (2017)
- [OpenNMT: Open-source Toolkit for Neural Machine Translation](https://mlsanity.com/paper/1709.03815/) (2017)
- [A Contrastive Framework for Neural Text Generation](https://mlsanity.com/paper/2202.06417/) (2022)
- [Turning Up the Heat: Min-p Sampling for Creative and Coherent LLM Outputs](https://mlsanity.com/paper/2407.01082/) (2024)
- [Truncation Sampling as Language Model Desmoothing](https://mlsanity.com/paper/2210.15191/) (2022)
- [Learning to Break the Loop: Analyzing and Mitigating Repetitions for Neural Text Generation](https://mlsanity.com/paper/2206.02369/) (2022)
- [A Theoretical Analysis of the Repetition Problem in Text Generation](https://mlsanity.com/paper/2012.14660/) (2020)
- [Repetition In Repetition Out: Towards Understanding Neural Text Degeneration from the Data Perspective](https://mlsanity.com/paper/2310.10226/) (2023)
- [Wait, Wait, Wait... Why Do Reasoning Models Loop?](https://mlsanity.com/paper/2512.12895/) (2025)
- [Closing the Curious Case of Neural Text Degeneration](https://mlsanity.com/paper/2310.01693/) (2023)
- [Repetitions are not all alike: distinct mechanisms sustain repetition in language models](https://mlsanity.com/paper/2504.01100/) (2025)
- [Feedback That Backfires: Why Small Language Model Agents Repeat the Call They Just Watched Fail](https://mlsanity.com/paper/2608.23651/) (2026)
- [Word Salad Chopper: Reasoning Models Waste A Ton Of Decoding Budget On Useless Repetitions, Self-Knowingly](https://mlsanity.com/paper/2511.00536/) (2025)
- [Antislop: A Comprehensive Framework for Identifying and Eliminating Repetitive Patterns in Language Models](https://mlsanity.com/paper/2510.15061/) (2025)
- [Breaking the Likelihood Trap: Variance-Calibrated Modulation for Large Language Model Decoding](https://mlsanity.com/paper/2606.22511/) (2026)
- [Solving LLM Repetition Problem in Production: A Comprehensive Study of Multiple Solutions](https://mlsanity.com/paper/2512.04419/) (2025)
- [When Can One Neuron Fix Repetition Loops in LLMs?](https://mlsanity.com/paper/2606.13705/) (2026)
- [XTC: Head-Aware Sampling by Excluding Top Choices](https://mlsanity.com/paper/2608.22758/) (2026)
- [Don't Repeat Yourself: Stopping Verbatim Loops at Sampling Time](https://mlsanity.com/paper/2608.22761/) (2026)
- [LZ Penalty: An information-theoretic repetition penalty for autoregressive language models](https://mlsanity.com/paper/2504.20131/) (2025)
- [Gauge dependence and structured-output corruption in sign-branched repetition penalties: measurements across models, inference stacks, and alternative repetition controls](https://mlsanity.com/paper/2607.09791/) (2026)
- [Calibrated e-CUSUM Decoding for Quantized Reasoning Models: Why Token Log-Probability Is the Wrong Observable for Decoding Monitors](https://mlsanity.com/paper/2607.11317/) (2026)

## Built on by (most cited first, 1 of 1)

- [Large Language Models as Nonlinear Dynamical Systems: The Three Clocks of Depth, Training, and Generation](https://mlsanity.com/paper/2611.21983/) (2026)

## Abstract (arXiv)

Language models sometimes repeat verbatim until the generation limit. We study the exit rather than the entrance: given that a span has already been repeated n times, when is escape still possible? Along the loop the context is deterministic, so the probability that a loop survives m more repetitions is, under any sampler, a product of per-step continuation probabilities computable from one forward pass. A lock, where this probability stays exactly one, is its limiting case. Pure sampling never locks; top-p with threshold π>1/2 locks a position exactly when the continuation probability reaches π. A bounded penalty can leave a position locked; a penalty that outgrows the model's preference for the loop over unseen tokens guarantees escape under top-p. The same analysis shows a blind spot in the widely deployed DRY sampler: its sequence breakers cap the penalty at λ bg-1-a for loops whose longest breaker-free run has g tokens. On eleven open models, 61% of locked units with g=6 stay locked under DRY and 0.2% with g=8. In free generation with llama.cpp, all 199 loops that survive DRY, on six models, have g≤ 7. We propose a count term that grows exponentially with the number of verbatim recurrences, up to its look-back window, and closes this blind spot. Added to DRY (DRY-C), it cuts loops in 1,800 structured generations on five models from 167 to 34, and loops reaching the length limit from 150 to 0, with reasoning accuracy and item coverage on par with DRY. DRY's own length term costs 2.5 to 14.2 points of accuracy on GSM8K and MATH-500; used in its place, the count term keeps the default sampler's accuracy and leaves one of the 1,800 generations at the limit.
