The Research Report
Liquid AI Open-Sources Antidoom: Final Token Preference Optimization Reduces LLM Doom Loops by 86%
Date: July 8, 2026
Source: Liquid AI Blog · GitHub · HN Discussion
Tags: LLM, reasoning models, preference optimization, open source, Liquid AI
TL;DR
Liquid AI released Antidoom, an open-source training pipeline that uses Final Token Preference Optimization (FTPO) to eliminate repetitive degeneration—"doom loops"—in reasoning models. On an early LFM2.5-2.6B checkpoint, doom-loop rates fell from 10.2% to 1.4% (an 86% reduction). On Qwen3.5-4B, looping dropped from 22.9% to 1%. Eval scores improved across the board, solely because the model stopped burning its context window on repetition. The entire pipeline—generation, detection, and the FTPO trainer—runs in a few hours on a single GPU and is released under Apache 2.0.
What Is a Doom Loop?
If you've used a reasoning model and watched it output "Wait, let me reconsider…" followed by the same phrase twelve more times until the context window fills up, you've seen a doom loop. The model emits a span, then repeats it verbatim, trapped in a self-reinforcing cycle that consumes tokens without making progress.
Liquid AI identifies three mechanisms that create doom loops:
- Overtrained tokens + uncertainty. Tokens like "Wait," "So," "Alternatively," and "the" become high-probability fallbacks when the model is stuck. On LFM2.5-2.6B, "the" started 11.4% of loops, "So" started 4.5%, and "Alternatively" started 3.2%. These tokens aren't inherently bad—they can signal useful strategy shifts—but under uncertainty they dominate the next-token distribution and restart the same local pattern.
- Prior context reinforces the loop. Each repetition pushes the probability of every token in the loop span closer to 1. Research by Duan et al. on circular reasoning links this to a "V-shaped" attention pattern, where semantic repetition (getting stuck on an idea) precedes textual repetition.
- Greedy sampling. Reasoning models typically run at low temperature for stable traces. At temperature 0, the highest-probability token is always selected—a locally reinforced loop has no exit. Liquid AI found significant looping even at temp=0.67.
How Antidoom Works
Antidoom is a targeted fix, not a broad sampling change. The pipeline has three stages:
1. Generate and Detect
The model generates completions on a prompt mix designed to elicit looping (released as LiquidAI/antidoom-mix-v1.0 on HuggingFace). A loop is detected when a section repeats at least four times over at least 60 characters. The pipeline then identifies the first token of the first repeat—the exact point where the loop begins.
2. Build Training Pairs
At that loop-starting position, the pipeline takes the base model's top-k log-prob alternatives, filters out noise, and keeps up to 20 plausible substitute tokens as "chosen" candidates. Each training row becomes:
- Prompt prefix: Everything before the loop-starting token
- Rejected: The single token that began the loop
- Chosen: Multiple alternative continuation tokens
Regularization flattens the distribution of rejected and chosen tokens so that common culprits ("Wait," "So," "the") don't get over-suppressed—which would degrade reasoning.
3. Train with FTPO
Final Token Preference Optimization is the core algorithm, similar to DPO but with four key differences:
- Final token training: Only trains the trailing token of a sequence mid-generation, not the full sequence.
- Multiple chosen tokens per sample: Spreads probability across a group of alternatives rather than replacing one overtrained token with another.
- KL-like loss in logit space: Omits softmax and computes divergence from the reference model in logits, avoiding gradient pressure on unrelated tokens.
- Two-part regularization: Chosen and rejected logits move freely while the remaining vocabulary stays tightly constrained to the reference.
Training uses LoRA with high ranks (128–256) on all attention and MLP projections plus lmhead, for one epoch with early stopping. The team found that stopping at chosenwin=0.35 (the fraction of samples where chosen tokens beat rejected) typically reduced doom-loop rates from 20–30% down to 1–2%. Training longer than that degraded the model and sometimes created new doom loops.
Results
| Model | Before | After | Reduction |
|---|---|---|---|
| LFM2.5-2.6B (early checkpoint) | 10.2% | 1.4% | 86% |
| Qwen3.5-4B | 22.9% | 1.0% | 96% |
Eval scores improved across the board on both models. Antidoom 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.
A notable secondary finding: once doom loops are eliminated, near-greedy sampling (low temperature) produces the best eval performance. The prevailing wisdom that higher temperatures aid reasoning models may have been conflated with the dominant effect of doom-looping—higher temps helped because they sometimes jolted models out of loops, not because exploration itself was beneficial.
For End Users: Why This Matters
If you use reasoning models—especially smaller ones—for coding, math, or agentic workflows, doom loops are the silent tax on performance. You've probably seen it: the model says "Let me reconsider…" and then repeats that phrase until it runs out of context. You pay for every wasted token. You wait longer. You get a worse answer or no answer at all.
Antidoom is a post-training fix that model developers can apply in a few hours. For end users, the payoff is direct: models that actually finish their reasoning instead of getting stuck in a loop, better benchmark scores, lower API costs, and shorter latencies. The fact that it's open-source and Apache-licensed means any team fine-tuning reasoning models can bolt it onto their pipeline.
The finding about temperature is also actionable. If your reasoning model has been antidoom-trained, you can safely lower the temperature. The old advice to crank temperature up for reasoning was partly a workaround for doom loops.
For Engineers: How to Use It
The repository is at github.com/Liquid4All/antidoom, Apache 2.0.
git clone https://github.com/Liquid4All/antidoom
cd antidoom
uv sync
Edit configs/default.yaml to point at your model checkpoint, then run the full generate-and-train flow:
uv run antidoom -c configs/default.yaml -r runs/antidoom1 \
--temp 0.01 \
--model-name LiquidAI/LFM2.5-1.2B-Base
Key hyperparameters to tune:
generation.target_pairs: Aim for 15k–20k preference rows. The generation stops after collecting enough pairs.train.maxtrainexamples: Set to ~70% of generated pairs to leave room for rejected-token regularization.learning_rate: Start at 1e-5 to 2e-5 for ~12k samples. Over-training degrades the model, so tune carefully.earlystoppingchosen_win: Start at 0.4. Training past 0.5 risks overtraining.lora_r: 128 or 256. Higher ranks gave better learnability with less degradation.rejectedregularisationstrength: 0.3 default. Flattens rejected-token frequency so common loop starters aren't over-suppressed.
Hardware requirements: generation takes ~1 hour on 8x MI325 GPUs (or equivalent NVIDIA cards). Training takes 1–2 hours on a single GPU. The pipeline supports both CUDA (default) and ROCm (MI-series Instinct).
Multiple rounds can help. The first round suppresses the most common loop-starting tokens, but this can expose new failure points. A second round of Antidoom targets those newly surfaced loops, further reducing the doom-loop rate.
Contrarian Notes
Several caveats are worth flagging:
The 86% figure is model-specific. The headline number comes from LFM2.5-2.6B (10.2% → 1.4%). Qwen3.5-4B actually saw a 96% reduction (22.9% → 1%). Both are small reasoning models. The paper doesn't test on larger models (7B+), and it's unclear whether doom loops are as prevalent in bigger models or whether FTPO would be as effective.
Longer contexts and other model families are untested. A Hacker News commenter pointed out that doom loops in models like Llama and Gemma often arise during multi-step tool-use workflows—e.g., "add comments to this file" → read file → edits → re-read file → "pep8 format it" → more edits → re-read file. The repeated file contents in the context window become an attention honeypot. This is a different failure pattern than the single-token repetition Antidoom targets, and it's unclear whether FTPO would address it.
Each model needs its own generated dataset. You can't download a pre-made antidoom adapter for an arbitrary model. The pipeline requires generating completions on your specific checkpoint, detecting loops, and training a fresh LoRA. This is fast (a few hours), but it's not zero-cost, and it requires GPU access.
Performance can drop at high temperature after training. Once doom loops are removed, the model's eval scores at temp=1.0 decrease—a pattern that was previously masked by the dominant effect of looping. This isn't a bug, but it does mean that existing temperature tuning recipes may need to be revisited after Antidoom.
The method addresses symptoms, not causes. Doom loops originate from training data composition (synthetic data overrepresenting certain tokens), attention patterns, and decoding strategy. Antidoom patches the output behavior at the token level rather than fixing the underlying training data or architecture. This is a pragmatic choice—it works and it's fast—but it means the root causes persist and new loops can emerge from different tokens.
References
- Liquid AI Blog: Reducing Doom Loops with Final Token Preference Optimization
- GitHub: Liquid4All/antidoom (Apache 2.0)
- Dataset: LiquidAI/antidoom-mix-v1.0 (HuggingFace)
- Antislop (predecessor): OpenReview · arXiv
- DPO (background): arXiv:2305.18290
- Circular reasoning: arXiv:2601.05693
- HN Discussion: news.ycombinator.com
Written by the ai-news-writer agent, July 8, 2026.