Liquid AI が推論モデルの無限ループを防止する新手法「Antidoom」をオープンソース化
Liquid AI は、推論モデルの致命的な欠陥である「ドゥームループ」を解消するオープンソース手法 Antidoom を公開し、特定トークンへの再学習によりループ発生率を劇的に低下させることに成功した。
キーポイント
Antidoom と FTPO の概要
Liquid AI が公開した Antidoom は、推論モデルのドゥームループ(無限ループ)を解消する手法で、最終トークン選好最適化(FTPO)を用いてループ開始の唯一のトークンを再学習させる。
劇的な効果と数値的改善
LFM2.5-2.6B モデルにおいて、ハードな数学・コーディング問題でのループ発生率が 10.2% から 1.4% に低下し、Qwen3.5-4B でも同様に大幅な改善が確認された。
ドゥームループの三つのメカニズム
過学習したトークンと不確実性、文脈による確率の強化、低温度での貪欲サンプリングという 3 つの要因が組み合わさってループが発生すると分析されている。
既存能力の回復に焦点
この手法は数学やコードの新しい知識を教えるものではなく、モデルが既に持っている答えへのアクセスを阻害していたループ現象を除去することに特化している。
ドームループの検出基準
60文字以上のセクションが最低4回繰り返されることを検出し、その最初の繰り返し部分の先頭トークンを特定します。
FTPO の学習データ構成
ループを引き起こす「拒否されたトークン」に対し、20 個までの代替候補を「選択されたトークン」として登録し、確率分布を分散させます。
DPO との決定的な違い
FTPO は生成途中の末尾トークンのみに焦点を当て、複数の選択肢を同時に学習することで特定の単語への過集中を防ぎます。
影響分析・編集コメントを表示
影響分析
推論能力を必要とする大規模言語モデルの実用化において、最も深刻な障害の一つであった「無限ループ」の問題に対し、軽量かつ効果的な解決策を提供する画期的な成果です。特に小規模モデルや複雑な推論タスクにおける信頼性を劇的に向上させるため、開発現場でのデプロイメントリスクを大幅に低減し、LLM の安定稼働を加速させる重要なマイルストーンとなります。
編集コメント
推論モデルの安定性を脅かす「ドゥームループ」という具体的な問題を、モデル全体の再学習ではなく最小限の修正で解決するアプローチは非常に賢明です。オープンソース化により即座にコミュニティ全体での検証と適用が可能になるため、今後の推論モデル開発の標準的なプラクティスとなる可能性があります。
Liquid AI は、推論モデルに共通する失敗モードである「ドゥームループ(破滅的ループ)」を対象としたオープンソース手法「Antidoom」を公開しました。ドゥームループとは、モデルが特定のトークン列を生成した後、その同一の列を延々と繰り返し出力し続ける現象です。この出力はコンテキストウィンドウが尽きるまで続きます。特に小規模な推論モデルにおいて、長い思考トレースや困難な問題に対してこの傾向が見られやすいです。
LFM2.5-2.6B の初期チェックポイントでは、難しい数学およびコーディングプロンプトに対する生成結果の 10.2% が反復ループを発生させていました。Antidoom によるトレーニング後、この割合は 1.4% に低下しました。評価スコアは全体的に向上し、これはすべてループ回数の減少によるものです。
TL;DR(要約)
Antidoom は、最初のループ開始トークンだけを再訓練することでドゥームループを削減します。
FTPO(Final Token Preference Optimization:最終トークン選好最適化)は、単一の置換トークンではなく、複数の整合性のある代替案に対して確率を広げます。
LFM2.5-2.6B のループ発生率は 10.2% から 1.4% に低下し、Qwen3.5-4B も 22.9% から 1% に低下しました。
このパイプラインは数時間で完了し、フルスタックがオープンソースとして公開されています。
Antidoom とは何か?
Antidoom は広範なサンプリング変更ではなく、標的を絞った修正手法です。ループを開始する正確なトークンを特定し、その単一位置において整合性のある代替案をモデルに選好させるようにトレーニングを行います。確率分布の他の部分はほとんど手つかずのまま維持されます。
この手法は Antislop を応用したもので、単一の生成結果トークンに対応する「選択されたペア」と「拒否されたペア」を用いてトレーニングを行います。使用されるトレーニングアルゴリズムは Final Token Preference Optimization(FTPO)であり、これは DPO と類似しています。
トレーニングは、モデルに対して数学やコードに関する新しい知識を教えるものではありません。それは、モデルがすでに生成可能な回答を妨げていたループを解消するものです。
ドゥーム・ループの解剖学
Liquid AI チームは、ドゥーム・ループの原因を、3 つのメカニズムが連携して働くことに帰因しています。
メカニズム 1:過学習したトークンと不確実性。一部のトークンは一般的に選択されやすい傾向があります。野外でのよく知られた例には「delve」や「testament」があります。Liquid AI チームは、これがトレーニングセット内の合成データに起因する可能性があると指摘しています。推論の追跡において、高い事前確率を持つ継続文には、「Wait(待って)」や「Alternatively(あるいは)」といった談話マーカーが含まれることがよくあります。これらのトークン自体が悪いわけではありません。それらは戦略の変更、検証ステップ、または分岐を示す有用な役割を果たし得ます。しかし、モデルが不確実性を感じたり行き詰まったりした際、これらが魅力的なフォールバック継続文として機能してしまいます。
初期の LFM2.5-2.6B チェックポイントにおいて、最も一般的なループ開始トークンは以下の通りでした。
トークン | ループ開始の割合
the | 11.39%
So | 4.51%
Alternatively | 3.22%
Wait | 2.56%
But | 2.46%
メカニズム 2:事前文脈がループを強化する。各反復は、Duan らが循環推論に関する研究で調査している確率へと、そのスパン内のすべてのトークンを押しやります。彼らはこれを「V 字型」の注意(attention)パターンに結びつけています。彼らの発見によれば、意味的な反復がテキスト上の反復に先行します。
メカニズム 3:貪欲サンプリング。推論モデルは通常、安定した再現可能なトレースを得るために低い温度(temperature)で実行されます。温度が 0 の場合、最も確率の高いトークンが常に選択されるため、一度ローカルに強化されたループには出口が存在しません。Liquid AI は、温度が 0.67 の場合でも著しいループ現象が発生していると報告しています。さらに低い温度ではこの問題が悪化します。
Antidoom が故障を検出する方法
Antidoom は、ループを引き起こすように設計されたプロンプトの混合データを用いて、低い温度で補完(completion)を生成します。この混合データセットは「LiquidAI/antidoom-mix-v1.0」として提供されています。あるセクションが少なくとも 60 文字にわたって 4 回以上繰り返される場合にループとして検出されます。
その後、手法は最初の繰り返し部分の最初のトークンを対象とします。その位置において、ベースモデルのトップ k の対数確率(log-prob)を持つ代替候補を取得します。短すぎるものや非英数字のノイズをフィルタリングし、最大 20 個の妥当な置換候補を選択トークンとして保持します。
各トレーニング行は、「プロンプトプレフィックス」「1 つの拒否されたトークン」、および「1 つ以上の選択されたトークン」からなるタプルです。選択分布と拒否分布は、トレーニング前に正則化(regularisation)されます。これを怠ると、「Wait(待て)」や「So(だから)」、「the(定冠詞)」といった特定の単語が支配的となり、過度な抑制によって推論能力が低下する恐れがあります。
検出ルール自体はコードで記述すると非常に単純です。以下のスニペットは例示目的です。
Copy CodeCopiedUse a different Browser
ループとは、4 回以上繰り返され、60 文字以上にわたる単位のことです。
最初の繰り返し(ターゲット)の最初のトークンのインデックスを返すか、見つからない場合は None を返します。
def find_loop(text, min_repeats=4, min_chars=60):
n = len(text)
for span in range(1, n // min_repeats + 1):
start = 0
while start + span * min_repeats <= n:
unit = text[start:start + span]
repeats = 1
pos = start + span
while text[pos:pos + span] == unit:
repeats += 1
pos += span
if repeats >= min_repeats and span * repeats >= min_chars:
return start + span # 最初の繰り返し(ターゲット)の最初のトークン
start += 1
return None
検出された各ループは、1 つのトレーニング行となります。構造は単純なタプルです。
Copy CodeCopiedUse a different Browser
投稿の [prefix, rejected, chosen] フォーマットに基づく FTPO トレーニング行 1 つ。
row = {
"prompt": prefix_up_to_the_loop, # 最初の繰り返しまでのテキスト
"rejected": " Wait", # ループを開始した単一のトークン
"chosen": [" So", " Since", " The", " Therefore"], # 最大 20 の代替案
}
最終トークン選好最適化 (FTPO)
FTPO は DPO に似た選好最適化アルゴリズムです。トレーニングサンプルには、プロンプト、選択された継続文、拒否された継続文が含まれます。これはモデルへの影響を最小限に抑えつつ、少数のトークンを変更するために構築されています。
FTPO は DPO と以下の 4 つの点で異なります:
最終トークンのトレーニング:これは、生成途中のシーケンスにおける末尾のトークンのみを訓練します。
サンプルごとの複数の選択トークン:確率を代替案のグループに分散させるため、過剰学習した単一のトークンが別のトークンに単純に置き換わるのを防ぎます。
ロジット空間での KL 類似損失:ソフトマックスを省略し、参照からの発散をロジットで計算することで、無関係なトークンへの圧力を回避します。
2 つの部分からなる正則化:選択されたロジットと拒否されたロジットはより自由に動き、残りの語彙は厳密に制約されます。
Antidoom の実装では、モデルは LoRA を用いて 1 エポック訓練されます。LoRA ランクを 128〜256 と高く設定すると最も良い結果が得られました。訓練にはすべてのアテンションと MLP プロジェクション、および lm_head が含まれます。学習率は 4e-6 から 2e-5 の範囲になります。
トレーニングでは、選択されたトークンが拒否されたトークンを上回るサンプルの割合である chosen_win(勝率)に基づいて早期打ち切りを行います。chosen_win=0.35 で停止させることで、ドゥームループ(無限ループ)発生率が 20〜30% から 1〜2% に低下しました。訓練を長く続けるとモデル性能が劣化する傾向がありました。
初期の LFM2.5-2.6B チェックポイントでは、トレーニングセットの生成に 8x MI325 GPU で約 1 時間かかりました。その後、単一の MI325 GPU で約 1〜2 時間の訓練が行われました。20k ペアの収集が完了すると生成は停止します。
Antidoom と一般的な修正手法との比較
アプローチ | 変更内容 | コストプロファイル | 報告された欠点
repetition_penalty(反復ペナルティ) | 出力分布の再重み付け | インフェレンス時、低コスト | 応急処置的;性能が低下する可能性あり
Reinforcement learning(強化学習) | 報酬によるポリシー | 適切に調整された報酬、高コストなオンラインロールアウト | セットアップと計算オーバーヘッド
DPO(最終トークン):1 サンプルあたり選択されるトークン 1 つ。オフライン学習。粗いベータ値を使用し、単一のトークンを更新。
Antidoom (FTPO):最初のループトークンから多数の選択トークンへ生成。約 1 時間の生成(MI325 8 基)+ 1〜2 時間の学習(MI325 1 基)。新しいループを露呈させる可能性があり、追加ラウンドが必要になる場合がある。
結果
学習後、初期の LFM2.5-2.6B チェックポイントにおけるドゥーム・ループ発生率は 10.2% から 1.4% に低下した。評価スコアは全体的に向上し、これはすべてループの減少によるものである。
Liquid AI チームは、推論時にループが発生することが知られている Qwen3.5-4B でも同様のパイプラインを実行した。その結果、グリーディサンプリング下でのドゥーム・ループ発生率は 22.9% から 1% に低下し、評価スコアも顕著に向上した。
温度を上げると評価スコアはドゥーム・ループ率と逆相関を示す。学習後、両モデルとも温度が約 1.0 の付近で性能が低下する傾向を示した。これは予想される結果であり、高温サンプリングでは好ましくないトークンが選ばれる可能性があるためである。一度ループが除去されれば、テストされたモデルにおいてほぼグリーディなサンプリングが最も高いスコアをもたらす。
Liquid AI チームは、一般的な慣行に関する関連する点も指摘している。「温度を高くすると推論に役立つ」という考え方は、ドゥーム・ループの影響と混同されている可能性がある。彼らのテストでは、ループが除去された後は、ほぼグリーディなサンプリングが最も良好な結果を示す。
複数のラウンドを行うことで改善が見込める。最初のラウンドでループを引き起こすトークンを拒否し、代替案へ重み付けをシフトさせる。これにより新たな失敗点が露呈することがあり、2 番目のラウンドではその点を対象とする。
インタラクティブ解説
(function(){
window.addEventListener('message', function(e){
if(e.data && e.data.antidoomHeight){
var f = document.getElementById('antidoom-embed');
if(f){ f.style.height = e.data.antidoomHeight + 'px'; }
}
});
})();
使用例と具体例
オンデバイス推論モデル:LFM2.5 ファミリーのような 1GB 未満の推論モデルは、難しいプロンプトで証明の途中で停止することがあります。Antidoom は、そのループによって失われていた精度を回復します。
小規模コーディングエージェント:4B のコーディングモデルは、難しいデバッグトレースでループし、コンテキストウィンドウを枯渇させることがあります。ループを取り除くことで、すでに知っていた修正に到達できるようになります。
エージェントパイプラインのコスト制御:ループはトークンが尽きるまで消費され続けます。これらを削減することで、長時間のエージェント実行全体で無駄なトークンとレイテンシを減らすことができます。
トレーニング後の修復:ファインチューニングされた推論チェックポイントをリリースするチームは、数時間で Antidoom をクリーンアップパスとして実行できます。
強みと課題
強み:
ターゲット型:最初のループトークンを編集し、残りの分布の大部分をほぼそのままに保ちます。
高速:全体のパイプラインは数時間で完了します。
測定可能:LFM2.5-2.6B は 10.2% から 1.4% に低下し、Qwen3.5-4B は 22.9% から 1% に低下しました。
オープンソース:生成、検出、および FTPO トレーナー(Final Token Preference Optimization)のすべてが公開されています。
教えるのではなく回復する:モデルがすでに生成できた回答を復元します。
課題:
新たな失敗点を露呈させる可能性があるため、複数のラウンドが必要な場合があります。
過学習はモデルを劣化させるため、chosen_win における早期停止が必要です。
報告された結果は、LFM チェックポイントと Qwen3.5-4B の両方を含む、小規模な推論モデルを対象としています。
トレーニング後、性能が temp=1.0 付近で低下する可能性があります。
各モデルには、それぞれ独自の生成ループデータセットが必要です。
技術詳細や GitHub リポジトリもご覧ください。また、Twitter でフォローしていただくことも歓迎です。さらに、15 万人以上の ML サブレッドに参加し、ニュースレターを購読することを忘れないでください。待ってください!Telegram をご利用ですか?今なら Telegram でも私たちに参加できます。
GitHub リポジトリや Hugging Face ページ、製品リリース、ウェビナーなどのプロモーションのためにパートナーシップをご検討の場合は、ぜひご連絡ください。
本記事「Liquid AI が Antidoom をオープンソース化:推論モデルにおけるドゥームループを削減する最終トークン選好最適化(FTPO)手法」は、MarkTechPost で最初に公開されました。
原文を表示
Liquid AI has released Antidoom, an open-source method that targets a common failure mode in reasoning models. That failure mode is the doom loop. In a doom loop, a model emits a span. It then repeats that span again and again. The output continues until the context window is exhausted. Small reasoning models are more prone to this, especially on long thinking traces and hard problems.
On an early checkpoint of LFM2.5-2.6B, 10.2% of completions on hard math and coding prompts produced repetitive loops. After Antidoom training, that rate fell to 1.4%. Eval scores improved across the board, attributable entirely to the reduced looping.
TL;DR
Antidoom reduces doom loops by retraining only the first loop-start token.
FTPO spreads probability across multiple coherent alternatives, not one replacement.
LFM2.5-2.6B looping fell 10.2% to 1.4%; Qwen3.5-4B fell 22.9% to 1%.
The pipeline runs in a few hours, and the full stack is open source.
What is Antidoom?
Antidoom is a targeted fix, not a broad sampling change. It finds the exact token that begins a loop. It then trains the model to prefer coherent alternatives at that single position. The rest of the distribution stays largely untouched.
The method adapts Antislop. It trains on chosen/rejected pairs that represent a single completion token. The training algorithm is Final Token Preference Optimization (FTPO), which is similar to DPO.
The training teaches the model nothing new about math or code. It clears the looping that blocked answers the model could already produce.
Anatomy of a Doom Loop
Liquid AI team attributes doom loops to three mechanisms working together:
Mechanism 1: overtrained tokens plus uncertainty. Some tokens are more likely to be selected in general. Well-known examples in the wild include ‘delve’ and ‘testament.’ Liquid AI team notes this can trace back to synthetic data in the training set. In reasoning traces, high-prior continuations often include discourse markers such as ‘Wait’ or ‘Alternatively.’ These tokens are not inherently bad. They can mark a useful change of strategy, a verification step, or a branch. When the model is uncertain or stuck, they instead become attractive fallback continuations.
For an early LFM2.5-2.6B checkpoint, the most common loop-starting tokens were the following.
TokenShare of loop starts
the11.39%
So4.51%
Alternatively3.22%
Wait2.56%
But2.46%
Mechanism 2: prior context reinforces the loop. Each repetition pushes every token in the span toward probability that Duan et al. study this in their work on circular reasoning. They link it to a “V-shaped” attention pattern. They find that semantic repetition precedes textual repetition.
Mechanism 3: greedy sampling. Reasoning models usually run at low temperature for stable, reproducible traces. At temperature 0, the most likely token is always selected. A locally reinforced loop then has no exit. Liquid AI reports significant looping even at temp=0.67. Lower temperatures exacerbate the problem.
How Antidoom Locates the Failure
Antidoom generates completions on a prompt mix designed to elicit looping, at low temperature. That mix ships as the LiquidAI/antidoom-mix-v1.0 dataset. A loop is detected when a section repeats at least four times, over at least 60 characters.
The method then targets the first token of the first repeat. At that position, it takes the base model’s top-k log-prob alternatives. It filters short or non-alphanumeric noise. It keeps up to 20 plausible substitutes as chosen tokens.
Each training row is a tuple of prompt prefix, one rejected token, and one or more chosen tokens. The chosen and rejected distributions are regularised before training. Otherwise a few culprits like Wait, So, and the would dominate and over-suppression would degrade reasoning.
The detection rule itself is simple to state in code. The snippet below is illustrative.
Copy CodeCopiedUse a different Browser
A loop = a unit repeating >=4 times, spanning >=60 characters.
Returns the index of the first token of the first repeat (the target), else None.
def find_loop(text, min_repeats=4, min_chars=60):
n = len(text)
for span in range(1, n // min_repeats + 1):
start = 0
while start + span * min_repeats <= n:
unit = text[start:start + span]
repeats = 1
pos = start + span
while text[pos:pos + span] == unit:
repeats += 1
pos += span
if repeats >= min_repeats and span * repeats >= min_chars:
return start + span # first token of the first repeat
start += 1
return None
Each detected loop then becomes one training row. The structure is a simple tuple.
Copy CodeCopiedUse a different Browser
One FTPO training row, per the post's [prefix, rejected, chosen] format.
row = {
"prompt": prefix_up_to_the_loop, # text before the first repeat
"rejected": " Wait", # the single token that started the loop
"chosen": [" So", " Since", " The", " Therefore"], # up to 20 alternatives
}
Final Token Preference Optimization (FTPO)
FTPO is a preference-optimization algorithm similar to DPO. A training sample has a prompt, a chosen continuation, and a rejected continuation. It is built to change a handful of tokens, with minimal disturbance to the model otherwise.
FTPO differs from DPO in four ways:
Final token training: It trains only the trailing token of a sequence that is midway through generation.
Multiple chosen tokens per sample: It spreads probability across a group of alternatives, so one overtrained token is not simply replaced by another.
KL-like loss in logit space: It omits the softmax and computes divergence from reference in logits, avoiding pressure on unrelated tokens.
Two-part regularization: Chosen and rejected logits move more freely, while the remaining vocab stays tightly constrained.
In the Antidoom implementation, the model trains for one epoch with LoRA. High LoRA ranks of 128-256 gave the best results. Training covers all attention and MLP projections, plus lm_head. Learning rates land around 4e-6 to 2e-5.
Training uses early stopping on chosen_win, the share of samples where chosen tokens beat rejected. Stopping at chosen_win=0.35 cut doom-loop rates from 20-30% down to 1-2%. Training longer tended to degrade the model.
For the early LFM2.5-2.6B checkpoint, training-set generation took about one hour on 8x MI325 GPUs. Training then took about one to two hours on a single MI325 GPU. Generation stops after collecting 20k pairs.
How Antidoom Compares to the Usual Fixes
ApproachWhat it changesCost profileReported drawback
repetition_penaltyReweights the output distributionInference-time, cheapBand-aid; can degrade performance
Reinforcement learningPolicy via rewardsCalibrated rewards, costly online rolloutsSetup and compute overhead
DPO (final-token)One chosen token per sampleOffline trainingCoarse beta; updates a single token
Antidoom (FTPO)First loop token → many chosen tokens~1h gen (8x MI325) + 1-2h train (1x MI325)Can expose new loops; may need extra rounds
Results
After training, the doom-looping rate on the 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.
Liquid AI team also ran the pipeline on Qwen3.5-4B, which is known to loop during reasoning. Its doom-looping rate dropped from 22.9% to 1% under greedy sampling. Eval scores increased markedly.
The eval score changed inversely with the doom-loop rate as temperature rose. After training, both models showed a performance drop near temp=1.0. This is expected, since higher-temperature sampling can favor less-preferred tokens. Once looping is removed, near-greedy sampling gave the strongest scores in the models tested.
Liquid AI team flags a related point about common practice. The belief that higher temperatures aid reasoning may be conflated with the effect of doom-looping. In their tests, once loops are gone, near-greedy sampling performs best.
Multiple rounds can help. The first round rejects loop-causing tokens and reweights toward alternatives. That can expose new failure points, which a second round then targets.
Interactive Explainer
(function(){
window.addEventListener('message', function(e){
if(e.data && e.data.antidoomHeight){
var f = document.getElementById('antidoom-embed');
if(f){ f.style.height = e.data.antidoomHeight + 'px'; }
}
});
})();
Use Cases with Examples
On-device reasoning models: Sub-1GB reasoning models like the LFM2.5 family can stall mid-proof on hard prompts. Antidoom recovers the accuracy those loops were costing.
Small coding agents: A 4B coding model can loop on a hard debugging trace and burn its context window. Removing the loop lets it reach the fix it already knew.
Agent pipeline cost control: Loops consume tokens until context exhaustion. Cutting them reduces wasted tokens and latency across long agent runs.
Post-training repair. Teams shipping fine-tuned reasoning checkpoints can run Antidoom as a cleanup pass in a few hours.
Strengths and Challenges
Strengths:
Targeted: it edits the first loop token and leaves the rest of the distribution largely intact.
Fast: the whole pipeline runs in a few hours.
Measured: LFM2.5-2.6B fell 10.2% to 1.4%; Qwen3.5-4B fell 22.9% to 1%.
Open source: generation, detection, and the FTPO trainer are all released.
Recovers, not teaches: it restores answers the model could already produce.
Challenges:
It can expose new failure points, so multiple rounds are sometimes needed.
Over-training degrades the model, so early stopping on chosen_win is required.
Reported results cover LFM checkpoints and Qwen3.5-4B, both small reasoning models.
Performance can drop near temp=1.0 after training.
Each model needs its own generated looping dataset.
Check out the Technical details and GitHub Repo. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.? Connect with us
The post Liquid AI Open-Sources Antidoom: A Final Token Preference Optimization (FTPO) Method that Reduces Doom Loops in Reasoning Models appeared first on MarkTechPost.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み