@Raman_bansal_: If you’ve trained an LLM, you’ve may have seen doom loop, in which a LLM endlessly repeats the same token or sentence, …
Summary
A Substack article explains the 'doom loop' problem in LLMs where models repeat tokens endlessly, and introduces Final Token Preference Optimization (FTPO) from Liquid AI as a method to detect and fix such loops during fine-tuning.
View Cached Full Text
Cached at: 07/14/26, 06:18 AM
If you’ve trained an LLM, you’ve may have seen doom loop, in which a LLM endlessly repeats the same token or sentence, wasting compute and breaking its reasoning process which why people not trusting small open source ai models Written an article on it https://open.substack.com/pub/cmdraman/p/why-your-llm-keeps-saying-the-same…
Why Your LLM Keeps Saying the Same Thing: Doom Loops
Source: https://cmdraman.substack.com/p/why-your-llm-keeps-saying-the-same?triedRedirect=true If you’ve trained an LLM, you’ve may have seendoom loop, in which a LLM endlessly repeats the same token or sentence, wasting compute and breaking its reasoning process which why people not trusting small open source ai models.
Source: Liquid AI
Liquid AI, one of the leading AI research companies, recently introducedFinal Token Preference Optimization (FTPO), a simple approach for dealing with these doom loops.
Three key reasons behind these loops.
- **First, overtrained tokens.**During synthetic data generation, certain words or phrases appear far more frequently than others. Whenever model become uncertsin, it chooses those words, thus increasing the chances of repetitive loop.
- **Second, prior context reinforcement.**Once a loop begins, every repeated token becomes part of the model’s context. Since language models condition on previous tokens, those repeated tokens further increase their own probability, creating a positive feedback loop that is difficult to escape.
- **Third, greedy or low-temperature decoding.**Reasoning models uses very low temperatures to produce deterministic reasoning traces. While this improves consistency, it also makes the model repeatedly choose the highest-probability token. If that highest-probability token is part of a developing loop, the model can become trapped.
How did they fix it?
They first detectdoom loopsby finding repeated sequences (more than four repetitions or over 60 repeated characters). Once detected, they identify thefirst tokenthat starts the loop and replace it with one or more valid alternatives. This creates a preference dataset containing theprompt,generated prefix,rejected token, andchosen token(s). They then fine-tune the model usingFTPO, teaching it to make a better next-token decision exactly where the loop begins.
1. Final-token training:Instead of optimizing the entire completion like DPO, FTPO only trains on thedecision pointwhere the doom loop begins—the prompt, generated prefix, rejected token, and chosen token(s).
**2. Multiple chosen tokens:**Rather than rewarding a single replacement token, FTPO uses multiple valid alternatives. This preserves diversity and avoids simply replacing one overtrained token with another. 3. Logit-space regularization:Instead of applying KL divergence after softmax, FTPO computes a KL-like loss directly on thelogits. This keeps updates localized, preventing changes to unrelated tokens.
**4. Two-part regularization:**The chosen and rejected tokens are allowed to change more freely, while the rest of the vocabulary is kept close to the original model. This fixes doom loops without affecting the model’s overall behavior.
After training, the doom-looping rate on our early LFM2.5-2.6B checkpoint dropped from 10.2% to 1.4%. Eval scores improved across the board, attributable entirely to the reduction in looping. The training set teaches the model nothing new about math or code; it removes the failure mode that was preventing the model from reaching answers it could already produce.
We also train Qwen3.5-4B on the Antidoom pipeline, known to produce repetitive loops during reasoning. Its doom-looping rate dropped from 22.9% to 1% under greedy sampling, with eval scores increasing markedly
Antidoom repairs degenerate repetitive behavior commonly seen after training, especially with thinking models. It selectively targets the problematic tokens that begin loops, with minimal collateral damage to the remaining distribution. Results so far demonstrate near-complete elimination of repetitive loops in internal Liquid LFM checkpoints, and also on Qwen3.5-4B.
Discussion about this post
Ready for more?
Similar Articles
Reducing Doom Loops with Final Token Preference Optimization
Liquid AI introduces Antidoom, a method using Final Token Preference Optimization to reduce repetitive doom loops in small reasoning models during inference, cutting loop rates from 10.2% to 1.4% while improving evaluation scores.
@helloiamleonie: Working with the @liquidai team on these engineering blogs is just so much fun! Here's what we've been working on: Reas…
The post explains doom loops in reasoning models where the model repeats tokens like 'Wait' until the context fills up, and introduces FTPO (Final Token Preference Optimization) as a training-time fix. The associated Antidoom tool reduces doom loop rates significantly (e.g., from 22.9% to 1% on Qwen3.5-4B).
How LLMs Actually Work
An in-depth walkthrough of how modern LLMs work, covering core mechanisms from tokenization to next-token prediction, without heavy math.
LoopUS: Recasting Pretrained LLMs into Looped Latent Refinement Models
LoopUS is a post-training framework that converts pretrained LLMs into looped architectures for improved reasoning performance via latent-refinement and adaptive early exiting. It addresses computational costs and capability preservation issues found in existing looped computation methods.
Don't let the LLM speak, just probe it (8 minute read)
The article introduces a technique that extracts hidden states from an LLM at the last prompt token to perform classification without text generation, using a small MLP to read the model's internal decision, enabling fast and cheap zero-shot classifiers.