Liquid AI released AntidoomThis open-source technique targets a failure mode that is common in reasoning model. This failure mode is called doom loop. A model will emit a span in a doom cycle. The model then repeatedly repeats the span. It continues to output until all context windows are exhausted. It is especially common in small reasoning models.
Early checkpoints of LFM2.5-2.6BAfter Antidoom training, this rate dropped to 1.4%. This rate dropped to just 1.4% after Antidoom. Eval scores increased across the board. This is due to the reduction in looping.
TL;DR
- Antidoom can reduce doom-loops by only retraining the loop’s first token.
- FTPO distributes probabilities across multiple alternatives and not just one.
- LFM2.5-2.6B Looping dropped 10.2% to 1%; Qwen3.5-4B declined 22.9%.
- It runs within a few minutes, and all the software components are open source.
Antidoom: What Is It?
It is not intended to be a general change. It determines the token with which a cycle begins. This then trains the model so that it prefers coherent alternatives in a specific position. It leaves the rest of the distribution largely intact.
The Method adapts Antislop. The algorithm trains using pairs of completion tokens that are either chosen or rejected. It is based on a training algorithm. Final Token Optimization (FTPO).It is similar to DPO.
It does not teach the model anything new in terms of math or codes. This removes looping from the code that was preventing the model’s answers.
The Anatomy Of A Doom Loop
Three mechanisms are working in concert to create dooms loops, according to the Liquid AI Team.
Mechanism 1: Excessively trained tokens and uncertainty In general, some tokens tend to be chosen more often. Well-known examples in the wild include ‘delve’ and ‘testament.’ The Liquid AI Team notes that this is due to the synthetic data used in training. In reasoning traces, high-prior continuations often include discourse markers such as ‘Wait’ or ‘Alternatively.’ They aren’t necessarily bad. These tokens can be used to indicate a change in strategy, an important verification or branch. They become appealing fallbacks when the model becomes uncertain or is stuck.
The most commonly used loop-starting tokens for an early LFM2.5 or 2.6B checkpoint were:
| Token | Share the loop begins |
|---|---|
You can also find out more about the following: |
11.39% |
The same applies to the other way around. |
4.51% |
Alternatives |
3.22% |
Wait |
2.56% |
The following are some of the ways to get in touch with each other |
2.46% |
Mechanism 2 : The context prior to the loop strengthens it The probability of every coin in the range increases with each repetition. Duan et al. study They use this to explain circular reasoning. It is linked to the “V-shaped” Attention patterns The researchers found that textual repetition is preceded by semantic repetition.
Mechanism 3: Gluttonous sampling For reproducible, stable traces, reasoning models are usually operated at low temperatures. The most probable token is selected at temperature 0. The loop is then locally reinforced and has no exit. LiquidAI reports looping, even when temperature is as low at 0.67. The problem is worsened by lower temperatures.
Antidoom locates failure
Antidoom produces completions for a low-temperature prompt mix. The mix comes as the LiquidAI/antidoom-mix-v1.0 dataset. When a loop occurs, a particular section is repeated at least four time over 61 characters.
This method targets both the First token of first repetition. It takes top-k alternatives of the log-prob base model at that position. The filtering is done to remove short, non-alphanumeric noise. The system can keep up to twenty plausible alternatives. Choose your own tokens.
Every training row is made up of a pair of prefixes, one rejected Tokens and at least one Choose your own tokens. Before training, the chosen and rejected distributions will be regularised. Then, a small number of people like Wait, The same applies to the other way around.” You can also find out more about the following: Over-repression and dominance would undermine reasoning.
Code is used to specify the rule. Below is an example.
# A loop = a unit repeating >=4 times, spanning >=60 characters.
# Returns the index for the first token (the target) of the repeated first loop, else none.
def find_loop(text, min_repeats=4, min_chars=60):
Text = n
For span in range (1, n // max_repeats plus 1)
Start = 0,
while start + span * min_repeats = min_repeats and span * repeats >= min_chars:
Return start + span # First token of the repeat
Start += 1
Return No
The detected loops are then turned into one row of training. Structure is simple tuple.
The post specifically states that there is one row of FTPOs for training.Row = [prefix, rejected, chosen] format.
row = {
"prompt": prefix_up_to_the_loop, # text before the first repeat
"rejected": " Wait"The token which started the loop
"chosen": [" So", " Since", " The", " Therefore"]Number up to 20 possible alternatives
}
Final Token Optimization (FTPO).
FTPO is a preference-optimization algorithm similar to DPO. In a training sample, there is a selected continuation, an unchosen continuation, and the prompt. This model can be modified to alter a small number of tokens with little disruption to the rest of the model.
FTPO and DPO are different in four key ways.
- Training for final tokensThe trailing token is only trained in a generation that has reached the mid-point.
- Multiple chosen tokens per sampleThe probability is spread across several alternatives so that one overtrained token will not be replaced by another.
- KL-like loss in logit spaceThis method omits softmax, and calculates divergence in logits. It avoids pressure on tokens that are not related.
- Regularization in two partsThe chosen and rejected logits can move around more, while remaining vocab is restricted.
Antidoom implements the LoRA model for an entire epoch. The best results were achieved with LoRA rankings between 128 and 256. The training covers MLP, attention and all other projections. lm_head. Learner rates are between 4e-6 and 2e-5.
Early stopping is used in training chosen_winThe share of the samples that were chosen over those rejected. Stopping at chosen_win=0.35 Cut dooms-loop rate from 20-30% and down to 1-2%. The model degraded when training was prolonged.
The generation of the training sets for early LFM2.5-2.6B took around an hour using 8xMI325 GPUs. The training took between one and two hours with a single MI325 graphics card. The generation ends after 20k pairs.
Antidoom: How does it compare to other fixes?
| The Right Approach | It changes | Cost profiles | Reportable drawback |
|---|---|---|---|
repetition_penalty |
The output distribution is reweighted | Inference-time, cheap | Band-aid; can degrade performance |
| Reinforcement learning | Rewarding policy through rewards | Online rollouts are expensive and require calibrated rewards | Overhead for setup and computation |
| DPO (final-token) | One chosen token per sample | Online training | Coarse The following are examples of how to use the word "youthfulness"The token is updated. |
| Antidoom (FTPO) | First loop token → many chosen tokens | ~1h gen (8x MI325) + 1-2h train (1x MI325) | You may need to add extra rounds |
You can find out more about the results by clicking here.
The doom looping rate at the LFM2.5/2.6B early checkpoint decreased from 10,2% to 1,4% after training. Eval scores have improved in all areas, largely due to the decrease in looping.
Liquid AI Team also managed the pipeline Qwen3.5-4BIt is well known that loops occur during reasoning. Under greedy sampling, its doom looping rate fell from 22,9% to 1%. Scores on evaluative tests increased significantly.
As the temperature increased, the eval scores changed in an inverse relationship with doom loop rate. Both models displayed a drop in performance near temp=1.0 after training. The performance drop is to be expected since high-temperature samples can lead to the selection of tokens that are less preferred. After looping has been removed, the near-greedy sample gave the highest scores for the models.
The Liquid AI Team brings up a similar point regarding common practices. It is possible that the belief in higher temperatures assisting reasoning has been confused with doom looping. Once loops have been removed, the near-greedy sample performed best in their tests.
Multiple rounds can help. First, the looping tokens are rejected and they’re shifted to alternatives. This can reveal new points of failure, and a subsequent round will target them.
Interactive Explainer
The escape probability is only significant when P (loop) has a high value. Reflects the point made in this post.
The sampling temperature can be higher even if there is a high probability that the loop token will get stuck.
function escapes(pLoop){
if(temp 0 && escapes(pLoop)){
statusEl.textContent=”Escaped via sampling”;
type(‘ ‘+answer, ‘pick’, finishAnswer);
return;
}
if(count >= 8){
statusEl.textContent=”Context window exhausted”;
ctxEl.textContent=”u00b7 context 100% used”;
RunBtn.disabled=false; running = true
return;
}
Type(loopSpan, “loop”, function(){
var next = Math.min(0.985, pLoop + (1-pLoop)*0.45); // climbs toward 1 each repeat
setTimeout(function(){ beginLoop(count+1, next); }, 120);
});
}
Answer to function Finish(){
statusEl.textContent=”Answer reached”;
statusEl.className=”ad-badge”;
ctxEl.textContent=””;
var cur = traceEl.querySelector(‘.ad-cursor’); if(cur) cur.remove();
Running = false, runBtn.disabled is false
}
function reset(keepBars){
running = false; clearTimeout (timer);
Loops = 0; loopsEl.textContent=”Loops: 0″;
ctxEl.textContent=””;
meterFill.style.width=”0%”; meterVal.textContent=”0%”;
statusEl.textContent=”Idle”; statusEl.className=”ad-badge”;
runBtn.disabled = false;
if(!keepBars){
traceEl.innerHTML = ‘Press the button to find out more. “Run trace” to begin…‘;
}
}
runBtn.addEventListener(‘click’, run);
resetBtn.addEventListener(‘click’, function(){ reset(false); });
//
setToggle(false);
—- Auto-resize for WordPress embedded —-
Function postHeight(){
var root.offsetHeight = 40
if(window.parent){ window.parent.postMessage({ antidoomHeight: h }, ‘*’); }
}
window.addEventListener(‘load’, postHeight);
window.addEventListener(‘resize’, postHeight);
var mo = new MutationObserver(postHeight);
mo.observe(root, {subtree:true, childList:true, attributes:true});
setInterval(postHeight, 1000);
})();

