Why LLMs loop on long outputs: top-p ends up picking the #1 token every step

ziv_ravid · x · 2026-09-28

Explanation of the mechanism: at each step you can check where the chosen word ranks. Normal writing picks from a handful of good options, but with top-p sampling, by the end of a long generation the model takes its #1 choice every single time — which is exactly what a loop is. Adaptive samplers never reach that state.

Related event: Long-text repetition loops traced to sampler, not model(3 posts)→

Original post →

More from Research

Research channel →