Liquid AI open-sources Antidoom to stop small reasoning models from getting stuck in loops
The method retrains only the token that starts a repeat, and reports doom-loop rates on two small models falling from roughly 10 to 23 percent down to about 1 percent.

Janet Torvalds
July 9, 2026Anyone who has run a small reasoning model locally has seen the failure. The model starts a thought, writes a sentence, then writes it again, then again, and keeps going until it runs out of context. Liquid AI calls this a doom loop, and on July 7 it open-sourced a training method named Antidoom that goes after it directly. The code for generation, loop detection, and the trainer is on GitHub under Liquid4All/antidoom.
The pitch is narrow, which is the interesting part. Antidoom does not teach the model anything new about math or code. It clears the looping that was blocking answers the model could already produce.
What a doom loop actually is
A doom loop is a span of text that repeats. Liquid AI's detector flags one when a unit repeats at least four times and covers at least 60 characters. Small reasoning models are the worst offenders, especially on long thinking traces and hard problems, because those are exactly the moments where the model gets stuck and reaches for a filler continuation.
Liquid AI traces the behavior to three things stacking up.
The first is high-prior tokens. Some tokens are likely to be picked regardless of context. In reasoning traces those tend to be discourse markers like "Wait," "Alternatively," and "So." They are not bad tokens. They can mark a real change of strategy or a verification step. But when the model is uncertain, they turn into an easy fallback. On an early checkpoint of Liquid's own LFM2.5-2.6B, the tokens that most often started a loop were " the" (11.4% of loop starts), " So" (4.5%), "Alternatively" (3.2%), and "Wait" (2.6%).
The second is context reinforcement. Once a span repeats, every token in it climbs toward probability one, so each copy makes the next copy more likely. Liquid AI points to work by Duan et al. on "circular reasoning" that ties this to a V-shaped attention pattern, where the model gets stuck on an idea before the same words show up in the output.
The third is greedy sampling. Reasoning models usually run at low temperature for reproducible traces, and at temperature 0 the most likely token always wins, so a loop that has reinforced itself has no exit. Higher temperature is the textbook escape, but once the loop token sits near probability one there is almost nothing left for sampling to reach. Liquid reports meaningful looping even at temperature 0.67.
The fix is to retrain one token
Most repetition fixes work at inference time. A repetition penalty reweights the output distribution on the fly. It is cheap, it is a band-aid, and it can drag down quality. Reinforcement learning can target looping too, but it wants calibrated rewards and expensive online rollouts. Antidoom instead does an offline training pass, and a very targeted one.
It generates completions on a prompt mix built to trigger loops (shipped as the antidoom-mix-v1.0 dataset), finds the first token of the first repeat, and treats that single position as the thing to fix. At that position it takes the base model's top-k alternatives, throws out the short and non-alphanumeric noise, and keeps up to 20 plausible substitutes. The token that started the loop becomes the "rejected" choice. The substitutes become "chosen."
The training algorithm is Final Token Preference Optimization, or FTPO, a relative of DPO. Four things separate it from standard DPO. It trains only the trailing token of a sequence that is midway through generation. It spreads probability across many chosen tokens instead of swapping one culprit for another, so you do not just teach the model to loop on a different word. It computes its loss in logit space rather than after a softmax, which keeps it off unrelated tokens. And it uses a two-part regularization that lets the chosen and rejected logits move while pinning the rest of the vocabulary in place.
Training runs one epoch with LoRA at high rank (128 to 256), across all attention and MLP projections plus the lm_head, at learning rates around 4e-6 to 2e-5. It stops early on a metric Liquid calls chosen_win, the share of samples where the chosen tokens beat the rejected one. Stopping at a chosen_win of about 0.35 took loop rates from 20 to 30 percent down to 1 to 2 percent. Training past that point started degrading the model and creating new loops.
The numbers
On the early LFM2.5-2.6B checkpoint, the doom-loop rate on hard math and coding prompts fell from 10.2% to 1.4%. Liquid also ran the pipeline on Qwen3.5-4B, a model it says is known to loop, and reports its rate under greedy sampling dropping from 22.9% to 1%. Eval scores rose in both cases, and Liquid credits the entire gain to the removed looping rather than any new capability.
One result should interest anyone who tunes sampling settings. Liquid argues the common belief that higher temperatures help reasoning may be partly a workaround for doom loops. In its tests, once the loops were gone, near-greedy sampling gave the best scores, and both models actually got worse near temperature 1.0.
The pipeline is cheap to run. Generating the training set took about an hour on eight MI325 GPUs, and training about one to two hours on a single one.
What it does not fix
Liquid is direct about the limits, which is more than most release posts manage. Killing one set of loop-starting tokens can expose new ones, so the method sometimes needs a second round. Over-training degrades the model, which is why the early stopping is not optional. The reported results cover small reasoning models only, the LFM2.5 family and Qwen3.5-4B, so there is no evidence yet on how it behaves at 70B or at frontier scale. And each model needs its own generated looping dataset, so this is a per-checkpoint cleanup pass rather than a universal switch.
That framing is the honest one. Antidoom is a repair tool for a specific, measurable defect in small reasoning models, it runs in an afternoon, and Liquid shipped the whole stack instead of a screenshot and a claim. The writeup credits Sam Paech, who also built the Antislop method Antidoom adapts. For anyone fine-tuning their own reasoning checkpoints and watching them stall mid-proof, it is a useful thing to have on the shelf.
Sources (5)
- Reducing Doom Loops with Final Token Preference Optimizationwww.liquid.ai
- Liquid4All/antidoom (GitHub)github.com
- antidoom-mix-v1.0 datasethuggingface.co
- Liquid AI Open-Sources Antidoomwww.marktechpost.com
- Circular Reasoning: Understanding Self-Reinforcing Loops in Large Reasoning Modelsarxiv.org