cs.CLOct 17, 2026

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

Authors: Yichuan Chen, Xin Wang

Organizations: School of Art and Design, Zhejiang Sci-Tech University, Hangzhou, China

Abstract

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 nn times, when is escape still possible? Along the loop the context is deterministic, so loop survival under any sampler can be computed exactly from one forward pass. Pure sampling leaves a positive escape probability at every step; top-pp with threshold π>1/2π>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-pp. The same analysis predicts a blind spot in the widely deployed DRY sampler: its sequence breakers cap the penalty at λbg−1−aλb^{g-1-a} for loops whose longest breaker-free run has gg tokens. On eleven open models, 66% of locked units with g=6g=6 stay locked under DRY and 1% with g=8g=8. In free generation with llama.cpp, all 109 loops that survive DRY have g≤7g\le 7. We propose DRY-C, which adds a term that grows exponentially with the number of verbatim recurrences, up to its look-back window. With it, none of 720 structured-output generations looped to the length limit, and task completion stayed close to DRY's.

Figures & tables

Appendix figures & tables10 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Don't Repeat Yourself: Stopping Verbatim Loops at Sampling Time

    Aug 24, 2026Philipp Emanuel Weidmann, Allen Roush, Judah Goldfeder +2Repetition in Language Generation

  2. Wait, Wait, Wait... Why Do Reasoning Models Loop?

    Dec 15, 2025Charilaos Pipis, Shivam Garg, Vasilis Kontonis +3Large Reasoning Models

  3. Monitoring latent reasoning in looped language models

    Oct 13, 2026Pawel Olszowiec, Paulina Tomaszewska, Maciej Żelaszczyk +2Implicit Reasoning in Language ModelsRecursive Language Models