AIRI Taught Qwen3.5-0.8B to Stop Looping: Loops Drop From 25.1% of Answers to 3.1%
Small reasoning models often find the right answer and then keep repeating "Wait, wait, wait..." until they run out of tokens. The user gets no answer, but the bill still arrives. AIRI fine-tuned four Qwen3.5 models (0.8–9B parameters) to stop at the right moment. For the smallest, 0.8B, the share of looping answers dropped from 25.1% to 3.1%. Across seven benchmarks, answers are 12–50% shorter, and no presence_penalty is needed. For production, that means fewer wasted tokens and more stable latency.
AI-processed from Habr AI; edited by Hamidun News
Imagine asking a small reasoning model to solve a problem. It reaches the correct answer, then starts repeating "Wait, wait, wait..." endlessly or re-checks a result it has already found for the tenth time. The token limit burns out, the user never sees the answer, and the generation has already been paid for. Such "loops" are one of the most frustrating problems in small models. The AIRI team (part of the Optimal Cognitive Core project) released Unloop versions of four Qwen3.5 models with 0.8, 2, 4, and 9 billion parameters (named 0.8B, 2B, 4B, and 9B). For the smallest one, the share of looping answers fell from 25.1% to 3.1%.
Why a repetition penalty doesn't solve the problem
The standard remedy for looping is the presence_penalty parameter, a penalty for repeating tokens. For Qwen's reasoning mode, the recommended value is 1.5. But the penalty applies to every generation, including the ones that were never going to loop. It hinders the model from repeating the numbers, variables, and names it needs: in a long math solution, each subsequent "x" becomes less likely to be written. Moreover, the penalty does not change the weights: remove it, and the model loops again.
The scale is clear from the numbers. On a sample of 6,000 real prompts, Qwen3.5-0.8B loops in a quarter of its answers, and a third of its answers hit the token limit. If the penalty is removed and the temperature is lowered to 0.6, results on GPQA Diamond, MATH-500, and IFBench collapse to nearly zero: 1.5, 1.6, and 0.7 points, versus 34.9, 22.0, and 20.3 with the recommended parameters.
How to tell a loop from reasoning
First, the authors agreed on what counts as a loop. Repetition alone does not qualify: a model may legitimately reread the prompt, quote a source, or produce tables with similar-looking values. A loop is substantial repetition that gets stuck and no longer moves the answer forward. To detect it, the team wrote a detector called LoopScore. It measures two signals: how many times the most frequent token sequence occurs, and what the longest contiguous stretch made of repetitions is. An answer is flagged as a loop if a fragment is repeated 15 or more times, or if there is a long repeating block and at least five repetitions.
On 272,000 answers from seven small models, LoopScore found 74% of the loops that an LLM judge had labeled. The criterion from Pipis et al. found 42%, and LoopGuard found 33%. LiquidAI's detector finds loops in 0.38% of answers from the base Qwen3.5-4B, while LoopScore finds them in 4.78%. The takeaway for practitioners: the share of looping answers reported across different studies depends on the detector at least as much as on the model.
The model already knows the answer
An analysis of 23,818 looping answers from Qwen3.5-4B showed that in 76% of cases, the correct answer appears before the loop begins. The median position of the answer is 6% into the response, while the loop starts at 25%. The model hasn't lost its way; it found the solution and can't stop.
This led to the method. A looping answer is cut right after the correct answer first appears, the reasoning block is closed, and the model is allowed to briefly write the conclusion. This produces a pair for DPO (Direct Preference Optimization, fine-tuning on pairs of "preferred and rejected responses"). The chosen response is the truncated beginning plus the completion; the rejected response is the original answer with the loop. Both halves start with the same tokens and differ only in the decision to stop or not. That is why the model learns precisely that decision, rather than incidental habits.
The first version of the approach backfired: on 4B, GPQA Diamond dropped by 7 points and AIME by 16. It turned out that in 37% of pairs, the rejected response was not a loop at all: the model had simply reasoned longer and honestly arrived at the answer. Filtering fixed this: only pairs were kept where the rejected response hit the token limit without an answer and its tail consists of repetitions.
Results and how to try it
The comparison used BF16 with each model's recommended settings: for Unloop, that means temperature 0.6 and presence_penalty 0. The 0.8B model has 8 times fewer loops, the 2B has 2.3 times fewer, and the 4B and 9B have roughly 40% fewer. The 9B has 3.5 times fewer answers that hit the token limit.
Across seven benchmarks (MMLU-Pro, GPQA Diamond, MATH-500, AIME 2026, IFBench, BFCL MT, and τ²-bench), the average score is no lower than the baseline, and for the smaller models it is noticeably higher. The 0.8B model rose from 22.0 to 50.8 on MATH-500 while using 60% fewer tokens. The 2B gained 14 points on MATH-500 and 8.6 on AIME 2026. The 4B and 9B kept their quality, with answers 12% and 29% shorter. At temperature 0, the base 0.8B scores about 4% on GPQA and 1% on MATH-500, while Unloop scores 36% and 48%.
There are drawbacks too: the 9B loses 2.0 points on BFCL, and the 4B loses 2.1 points on τ²-bench. The method has been validated only on the Qwen3.5 lineup, the detailed paper has not yet been published, and agentic scenarios with tool calls require a different approach, which the authors are only beginning to work on.
These are full Qwen3.5 checkpoints that run wherever the original does: through llama.cpp, vLLM, and other runtimes. GGUF builds are available from BF16 to Q4_0. Recommended parameters: temperature 0.6, top_p 0.95, top_k 20, presence_penalty 0. For anyone running small models locally or in production, the benefit is clear: fewer wasted tokens, more predictable latency, and no penalty that degrades good answers too.
- Nov 23, 2026DeepSeek API from Russia: Resellers Charge 94% to 244% of the Price for Input Tokens
- Nov 23, 2026Notable Capital's Anthropic Bet Rose 15x on Paper After IPO
- Nov 22, 2026A Backend Developer With No Unity Experience Built a 3D Game With an AI Agent: Subscriptions Cost $112
- Nov 22, 2026DeepSeek Veteran Open-Sources Linger: A Local AI Agent That Responds Up to 5x Faster
Key Questions Answered
Why a repetition penalty doesn't solve the problem?
The standard remedy for looping is the presence_penalty parameter, a penalty for repeating tokens. For Qwen's reasoning mode, the recommended value is 1.5. But the penalty applies to every generation, including the ones that were never going to loop. It hinders the model from repeating the numbers, variables, and names it needs: in a long math solution, each subsequent "x" becomes less likely to be written. Moreover, the penalty does not change the weights: remove it, and the model loops again.
How to tell a loop from reasoning?
First, the authors agreed on what counts as a loop. Repetition alone does not qualify: a model may legitimately reread the prompt, quote a source, or produce tables with similar-looking values. A loop is substantial repetition that gets stuck and no longer moves the answer forward. To detect it, the team wrote a detector called LoopScore. It measures two signals: how many times the most frequent token sequence occurs, and what the longest contiguous stretch made of repetitions is.
What are the key details on The model already knows the answer?
An analysis of 23,818 looping answers from Qwen3.5-4B showed that in 76% of cases, the correct answer appears before the loop begins. The median position of the answer is 6% into the response, while the loop starts at 25%. The model hasn't lost its way; it found the solution and can't stop. This led to the method. A looping answer is cut right after the correct answer first appears, the reasoning block is closed, and the model is allowed to briefly write the conclusion.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.