English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Liquid AI Open-Sources Antidoom: A Surgical Fix for AI Coding Doom Loops

Forum topic · 小凯 · 2026-07-08

Summary

Liquid AI has open-sourced Antidoom, a post-training method that eliminates 'doom loops'—a failure mode where reasoning models repetitively emit tokens like 'Wait' or 'So' until the context window fills and the session crashes. Rather than retraining or changing sampling strategies, Antidoom identifies the single token position where looping begins and applies a novel preference optimization algorithm, Final Token Preference Optimization (FTPO), teaching the model to choose from a set of alternative tokens at that exact position. Key engineering choices include single-token training, multiple chosen tokens per sample, and KL regularization in logit space, preserving the model's other capabilities. Results are dramatic: loop rates on hard math and coding prompts dropped from 10.2% to 1.4% on LFM2.5-2.6B and from 22.9% to 1.0% on Qwen3.5-4B, with overall benchmark scores improving. The full pipeline—detection, data generation, and training—runs in hours on AMD MI325 GPUs. Antidoom outperforms repetition penalties, RL, and standard DPO for targeted fixes at low cost. Limitations include per-model dataset generation requirements and unverified effectiveness on larger closed models. Code and the antidoom-mix-v1.0 dataset are available on GitHub.

> 2026-07-07 · Liquid AI · AI coding infrastructure > Source: https://www.marktechpost.com/2026/07/07/liquid-ai-antidoom-doom-loops-ftpo > Technical details: https://www.liquid.ai/blog/antidoom > Open-source repo: https://github.com/Liquid4All/antidoom

If you've used any reasoning model for coding, you've likely hit an infuriating failure mode: the model writes some code, then suddenly starts repeating a phrase—"Wait", "So", "Alternatively"—over and over until the context window fills, cutting off mid-sentence and ruining the whole session.

The industry calls this a doom loop.

On July 7, Liquid AI open-sourced Antidoom, a surgical patch for this problem. It doesn't change training data, doesn't re-pretrain, and doesn't alter sampling strategy. It does exactly one thing: find the first token where the loop begins, and teach the model to choose differently at that single position.

The numbers are hard: LFM2.5-2.6B's loop rate on hard math and coding prompts dropped from 10.2% to 1.4%; Qwen3.5-4B's loop rate fell from 22.9% straight to 1.0%. And it's not just trimming a couple of long-tail cases—verification confirmed this was the patch's effect. Overall scores went up too, because problems the model could already answer correctly—previously blocked by loops—now get answered.

The value here goes far beyond "fixed a bug."

How Doom Loops Happen: Three Mechanisms Conspiring

Liquid AI breaks the doom loop into three independent but compounding mechanisms—an insight worth noting on its own.

First, over-trained tokens plus uncertainty. Certain tokens have extremely high linguistic prior probability, typically "Wait", "Alternatively", "So", "the", "But". In synthetic reasoning trajectories in training data, these words often act as strategy-switch signals—"let me look at this differently" is a good thing. But when the model is stuck and doesn't know the next step, they become the natural fallback. In LFM2.5-2.6B's loop-start token distribution, "the" accounts for 11.39%, "So" for 4.51%, "Alternatively" for 3.22%—this isn't the model "thinking"; it's reverting to a default channel.

Second, context reinforces the loop. Each repetition makes the model more confident in the local probability of those tokens (the paper calls this a V-shaped attention pattern). So once a loop isn't truncated the first time, the second comes easier, and the third is harder to stop.

Third, greedy sampling has no exit. Reasoning models generally run at low temperature for stability and reproducibility. But temperature 0 means "always pick the most likely token." Once the loop start gets locally reinforced, the model can never escape. Liquid AI tested it: even at temperature 0.67 there's significant looping. The problem isn't sampling—it's that the distribution is contaminated.

The combined effect: the model actually knows the answer, but gets interrupted at some moment—then anxiously backtracks with "Wait", enters the loop, and dies there.

How Antidoom Fixes It: Preference Optimization on the First Loop Token

Antidoom's idea sounds suspiciously simple. Generate a batch of prompts deliberately designed to trigger loops, run low-temperature sampling, locate the position of the loop's first token, pair the "rejected token" at that position (e.g., "Wait") with a "chosen token set" (e.g., any of "So", "Since", "The", "Therefore"), and train with a preference optimization algorithm.

But several careful engineering decisions make it different from "plain DPO", "plain repetition penalty", or "plain RL":

  • It trains on a single token position, leaving the overall distribution essentially untouched. This means it doesn't contaminate other capabilities. Ordinary DPO trains on whole passages and can change the model's "personality"; Antidoom only modifies probability at that one position, minimizing side effects.
  • Each sample can have multiple chosen tokens. The model learns "any of these is fine", not "must pick this one"—avoiding the common trap of replacing one over-trained token with another.
  • It skips the softmax and does KL regularization in logit space, which prevents unintentionally adjusting probabilities of tokens that shouldn't change.
  • Its preference optimization algorithm is called Final Token Preference Optimization (FTPO), similar to DPO but with four differences: single final-token training, multiple chosen tokens, logit-space KL, and more aggressive regularization.
On an early checkpoint of LFM2.5-2.6B, generating training data took about 1 hour on 8×MI325 GPUs; training took about 1–2 hours on 1×MI325. The whole pipeline takes hours.

The repo also includes a dataset, LiquidAI/antidoom-mix-v1.0—a set of prompts designed to trigger loops. What's open-sourced is the full detection, generation, and training pipeline, not just weights.

Comparison with Other Doom-Loop Fixes

repetition_penalty is the most common quick patch, reweighting the output distribution at inference. Cheap, but the authors explicitly call it a "band-aid" that degrades performance in other contexts.

Reinforcement learning is the heavier option: it needs reward shaping and online rollouts—expensive to build, slow to tune.

DPO has seen similar attempts, but it's one-for-one swapping—too coarse-grained; and standard DPO trains full passages, with hard-to-tune β.

Antidoom's winning scenario: you have a looping problem, want to touch other capabilities as little as possible, and your budget is "hours, not days". For each model you must generate your own loop dataset—that's the limitation, but also the cost of leaving other capabilities intact.

A Quick Back-of-Envelope: What's This Patch Worth?

Over a few days I watched AI coding engineers complain: in a 1M-context session, the model often starts repeating "Hmm", "Let me think again", "Actually wait" after some long Python traceback, and the entire invocation is wasted.

For an API-billed coding agent company, this failure pattern means every broken session burns a full context window of tokens for nothing. Assume an average session of 80k tokens; shaving even 5 percentage points off broken-session rates could save enough in API costs to cover a three-person team's quarterly salary.

And Antidoom isn't a new model—it's a "patch pack" that can be layered on after model release. It's conceptually similar to Anthropic's earlier Reveal reasoning hack: not replacing the model, but strapping a correction band on the outside.

Limitations and Uncertainties

The authors are candid: multiple iterations may be needed, because fixing one batch of loop-start tokens may expose the next. Both LFM2.5-2.6B and Qwen3.5-4B are small reasoning models; effectiveness on larger closed models (e.g., Fable 5, Opus 4.7) is unverified—an uncertainty that must be honestly acknowledged.

At temperatures near 1.0, the patched model performs worse, as expected (high temperature favors non-preferred tokens). But this means the patch is best suited to the low-temperature, stability-seeking inference scenarios that dominate coding workloads anyway.

Each model needs its own loop dataset, meaning a "universal Antidoom model" doesn't exist—it's a post-training tool, not a deliverable.

Why This Matters

What actually blocks engineers in AI coding today? Not 70% scores on SWE-bench, but long-tail failures: sessions crashing mid-run, requiring humans to take over. Tools like Antidoom target exactly this: the model's capability is sufficient, but "not crashing at the wrong moment" remains unsolved.

If Liquid AI's open-source approach is validated—and borrowed internally by Anthropic/OpenAI/Google-scale labs—the next six months of AI coding products should see far fewer "kill and restart" incidents. Long-running agents and "loops that don't persist" are two sides of the same problem.

My personal take: this is one of the few engineering paths this quarter that meaningfully improves AI coding experience without any model upgrade. Worth trying on your internal coding agent tonight.

Tags

#liquid-ai#antidoom#ai-coding#doom-loops#ftpo#preference-optimization#open-source#post-training

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178346233