How Quantized Reasoning Models Fail to Stop
· code
I spent the last week measuring how quantized reasoning models fail on math problems. My hunch was that low-bit models lose less from reasoning badly than from not knowing when to stop. The general version of that question has been studied this year (papers below), but almost all of that work uses GPTQ or AWQ checkpoints in research stacks. I wanted to see it on the GGUF files people actually run with llama.cpp.
Short version: a post-hoc ternary (calibrated, but not trained for ternary) fails mostly by looping, the higher-bit quants fail mostly by talking past an answer they already have, ternary also lost accuracy on one of two seeds, a reasoning budget with a wrap-up message handles the second failure but not the first, and whether one particular run loops is a weak signal on its own. PrismML’s trained ternary Bonsai 2.5 27B, run the same way on the same problems, didn’t loop at all.
Setup
The model is Qwen3.6-35B-A3B (MoE, about 3B active parameters) at three precisions:
- Q4_K_M (reference), with the experts of 16 layers on the CPU (
-ncmoe 16) because it doesn’t fit in 16 GB - IQ3_XXS, with non-expert tensors at Q6_K, all on the GPU
- Ternary Q2_0, all on the GPU: a calibrated post-hoc ternary of the routed experts (GPTQ plus a short KL refit, by russellwmy), repacked onto the Q4_K_M file’s other tensors (Q8_0 / f32). Not a model trained for ternary.
Each ran the same 60 MATH-500 problems at temperature 0.6, with a 16,384-token cap on reasoning plus answer, one request at a time and prompt caching off, on two seeds.
Caveat on the problem set: 48 of the 60 problems were chosen because they had hit the token cap in earlier runs; the other 12 are controls that always finished. That makes failures common enough to study, but the rates below are rates on a deliberately hard set, not MATH-500 rates, and anything that compares “long” and “short” runs is shaped by that selection.
When a run hit the cap while still reasoning, I put it in one of three buckets:
- Loop: verbatim repetition of the same span, caught by a repetition detector from arXiv 2611.20419 that needs at least six exact repeats.
- Stall: at some point, a forced wrap-up gives the same answer at consecutive 1,000-token checkpoints (right or wrong), and the run doesn’t loop.
- Other: long reasoning with no settled answer.
Ternary loops; Q4 and IQ3 stall
| Q4_K_M | IQ3_XXS | Ternary | |
|---|---|---|---|
| Solved (of 60), seed 1 | 38 | 35 | 35 |
| Solved (of 60), seed 2 | 41 | 39 | 32 |
| Hit the cap, seed 1 / seed 2 | 19 / 19 | 22 / 20 | 25 / 27 |
| Loops among capped runs, seed 1 | 0 | 1 | 11 (44%, 95% CI 24–65%) |
| Loops among capped runs, seed 2 | 1 | 1 | 14 (52%, 95% CI 32–71%) |
On seed 1 the three precisions are close (38, 35, 35). On seed 2 ternary solved 9 fewer than Q4_K_M, a 15-percentage-point gap (95% CI 3 to 27 points), so the post-hoc ternary does cost accuracy, just not consistently on 60 problems. What changes on both seeds is how the model fails. Q4_K_M’s capped runs were almost all stalls and long unfinished reasoning, often thousands of tokens after a forced wrap-up would already have given a settled answer, usually one it hadn’t yet written in its reasoning. Ternary looped on about half of its capped runs.
On seed 1, the ternary loops split into two kinds, the split a June paper described for 2-bit GPTQ models (answers found by looking for \boxed{} or “the answer is” in the text):
- 5 commitment failures: the correct answer appears before the loop starts.
- 6 path-finding failures: no answer in the text before the loop (though a forced wrap-up already gave the right answer on 2 of them).
Long loops don’t end on their own
On the second seed, 16 runs were caught in a verbatim loop. None got out before the cap. The detector only fires after six exact repeats, so this says that loops that have already repeated six times don’t recover, not that a short repetition never resolves.
A restart rule I expected to work, and it didn’t
In combinatorial search, killing a long run and restarting with a new seed often helps, because long runs are often unlucky rather than doomed. The ternary data looked like that case: pooled over both seeds, the rate at which runs finished fell from 0.17 per 1,000 tokens in the first 2,000 tokens to 0.017 between 7,000 and 9,000 tokens (that late window rests on only 2 finishes).
I wrote the prediction down before testing it: restarting ternary at 8,192 tokens would solve more problems. I simulated the restarts from the recorded runs rather than running new ones. Ternary solved 2 fewer, IQ3 2 fewer and Q4_K_M 5 fewer. None of those differences is significant (sign-test p 0.69, 0.73, 0.06), and a version that averages over which seed goes first gives −0.5, −3.5 and −6.0, but the predicted gain clearly wasn’t there.
Comparing the two seeds problem by problem points to why, though I worked this out after the fact. For ternary, if seed 1 was still running at 8,192 tokens, seed 2 solved that problem within 8,192 tokens only 10% of the time (3 of 30); if seed 1 had finished, seed 2 solved it within 8,192 tokens 90% of the time (27 of 30). IQ3 and Q4_K_M show the same pattern. Long runs looked like hard problems rather than unlucky draws, and a new draw hits the same wall. That matches arXiv 2609.03436 (“It’s the Problem, Not the Path”), which found the same on MATH by comparing restarts with continuing at a matched budget; I didn’t know about it when I wrote the prediction.
This split leans on the hard-problem selection. The set was built from problems that ran long before plus easy controls, so “still running at 8,192” largely sorts problems into those two groups. I wouldn’t quote the 10% vs 90% split, or the tenfold drop in finishing rate, as properties of MATH-500.
Which run loops is partly luck
I reran the 25 capped ternary problems from seed 1 with one setting changed: micro-batch size 1 instead of 512. On the GPU that doesn’t just reorder additions; it switches the prompt pass from batched matrix kernels to single-token ones (decode is already one token at a time), so the arithmetic differs slightly while the model and inputs stay the same. All 25 runs diverged from the originals, at a median of 51 tokens in, and 9 of 25 switched between loop and not-loop. A different random seed switched 8.
I had pre-registered a threshold of 10 flips for calling loop labels fragile, so as frozen the result is inconclusive, and 9 vs 8 is well within the noise (each count has a standard deviation of about 2.4). Some problems do lean one way (I worked this out after the fact): a run that looped originally looped again half the time (0.50), against 0.21 for the rest, and 3 problems looped in all three runs while 9 never did. So the loop rate reproduces, there’s real per-problem tendency, but a single run’s label is a weak signal on its own.
What fixes what
llama.cpp already has --reasoning-budget and --reasoning-budget-message, which close the reasoning after N tokens and tell the model to answer. In an earlier screening run on a separate 100-problem MATH set at Q4_K_M, a 12,000-token budget plus a wrap-up message took greedy decoding from 75 solved (25 truncated) to 100/100, and all 26 runs that hit the budget answered correctly. That run is screening-grade: it used four parallel slots with the prompt cache on, which changes greedy outputs between runs, and only 19 of the 25 originally truncated problems actually hit the budget in the rerun (6 finished on their own, and 7 other problems hit the budget instead). Where the gold answer was distinctive enough to search for (13 of the 26 budget-hit runs), it appeared in the text in 11, first at a median of 29% of the way through, though per-token entropy and log-probability didn’t predict which runs would go past 12k.
That handles stalls. It only partly handles ternary loops: a forced wrap-up can rescue commitment failures, where an answer exists, but path-finding loops have no answer in the text to give. I replayed a “stop once the forced answer repeats at consecutive checkpoints” rule offline on the 11 seed-1 ternary loops, using wrap-up probes taken every 1,000 tokens. It would have stopped 7 of them before the loop began: 4 with the right answer (one of those only counts after fixing a grader miss) and 3 with a wrong one. I didn’t try a repetition penalty or a hesitation-word penalty, which the papers below use; those are the obvious next decode-time tests. Beyond that, the path-finding loops probably need training, which the Bonsai 2.5 section below points to.
A ternary-trained model on the full benchmark
To get a number on a representative set, I ran PrismML’s Ternary Bonsai 1.7B, which is trained for ternary weights rather than quantized after training, on all 500 MATH-500 problems. Settings: greedy, non-thinking mode, 8,192-token cap.
- Solved: 246/500 (49.2%) by the grader, 249/500 (49.8%) by hand count; mean about 2,000 tokens
- Cut off at the cap: 84, of which 62 were verbatim loops (4 of the 84 still got a final answer out, and 1 of those was correct)
That’s a loop on about one problem in eight, with no hard-problem selection. A hand check of the 420 runs that produced an answer found 4 the grader wrongly accepted and 7 it wrongly rejected, which is where 249 comes from. These loops are in the answer text, since non-thinking mode has no reasoning trace, so they aren’t comparable to the reasoning-phase loops above. PrismML reports 54.4 with the same mode and cap but a different harness, and their grading adds an LLM recall fallback; I’m not claiming to have reproduced it. This is PrismML’s first-generation 1.7B model; their newer ternary models are far stronger.
A trained ternary 27B on the same problems
PrismML released Ternary Bonsai 2.5 27B on November 24: a Qwen3.8-27B trained for ternary weights, 7.7 GB as a Q2_0 GGUF that runs on stock llama.cpp. Its whitepaper reports no loop or termination numbers, so I ran it on the same 60 problems, two seeds, with the same harness and rules as the Qwen3.6 runs (temperature 0.6, 16,384-token cap, one request at a time, prompt cache off), at the model’s default xhigh effort, without its bundled MTP draft head.
| Bonsai 2.5 27B | Our post-hoc ternary | Q4_K_M | |
|---|---|---|---|
| Solved (of 60), seed 1 / seed 2 | 58 / 58 | 35 / 32 | 38 / 41 |
| Hit the cap, seed 1 / seed 2 | 2 / 2 | 25 / 27 | 19 / 19 |
| Loops, both seeds (of 120 runs) | 0 | 25 | 1 |
Bonsai 2.5 never looped. Against our post-hoc ternary, the pre-registered paired test passes at p ≤ 1e-5, and the result is the same under the other loop detectors. Its only misses were the same two problems in both seeds, and both were stalls: a forced wrap-up gives the correct answer at every 1,000-token checkpoint but one, but on one problem the model keeps polishing its write-up and on the other it is still grinding numerics at the cap.
This mostly says it rarely fails to stop, not that it loops less when it does. It hit the cap on 4 runs against our post-hoc ternary’s 52, and with only 4 capped runs the question “does it loop less once it’s stuck?” can’t be tested (0 of 4 vs 25 of 52, p = 0.086). The comparison also isn’t like for like: a different and newer base model, a different size, the xhigh system prompt, temperature 0.6 where PrismML uses 1.0, and a 16k cap where PrismML uses up to 81,920. The 60 problems were picked because Qwen3.6 ran long on them, so a different model is expected to do better here, and it solved 58 of 60, so this set is mostly easy for it. Q4_K_M looped only once, so this separates Bonsai 2.5 from a post-hoc ternary, not trained ternary from 4-bit. My own pre-registered predictions (14 capped runs per seed, 44 solved) were badly wrong in the model’s favour.
What it does show is narrower: ternary weights don’t by themselves mean looping. One model trained for ternary, run through the same stock llama.cpp on a 16 GB card, failed here only by stalling with the right answer in hand, which is the failure class a reasoning budget fixed on Q4_K_M (not tested on this model). Full MATH-500 is the next run.
Prior work
The broad result, that low-bit quantization makes reasoning models think longer, hit caps more often and loop more, was published several times between May and October 2026:
- arXiv 2606.02011 (June): 2-bit GPTQ Qwen3. Splits loops into commitment and path-finding failures, and recovers the first kind by returning the answer that came before the loop.
- arXiv 2610.28537 (October): on Qwen3-30B-A3B at bf16, 4-bit and 2-bit, loops rise and answer-bearing failures fall as bits drop. That’s the same direction as my ladder.
- arXiv 2606.00206 (May): ties extra thinking to hesitation words and penalizes them at decode time.
- arXiv 2609.26708 (September): after aggressive quantization-aware distillation, nearly every generation runs out of budget, mostly in loops.
- Budget forcing (s1, arXiv 2501.19393) and forced wrap-ups on pruned reasoning models (arXiv 2610.19934) are established methods.
- ThinkBit (arXiv 2610.34886, October): quantization-aware training of reasoning models at low bit widths, the trained side of the comparison in the Bonsai 2.5 section.
- Numerical noise changing reasoning outputs is documented in arXiv 2506.09501 (“Understanding and Mitigating Numerical Sources of Nondeterminism in LLM Inference”).
Earlier, arXiv 2512.12895 (“Wait, Wait, Wait… Why Do Reasoning Models Loop?”, December 2025) argued that reasoning loops come from learning errors and need training-time fixes, which fits what the Bonsai 2.5 run shows. The loop detector used here is the periodic-loop rule from arXiv 2611.20419.
What this adds is narrow:
- the same questions on stock llama.cpp GGUF files on one consumer GPU, sampled, on two seeds, with confidence intervals;
- stalls counted separately from loops across three precisions;
- a restart rule borrowed from SAT solving, written down before testing, that failed on quantized models. The underlying point, that difficulty sits in the problem rather than the sampled path, is already in arXiv 2609.03436, and TAAR (arXiv 2601.11940) learns when to truncate and restart;
- a direct comparison of how often arithmetic noise and a new seed change a run’s loop label (inconclusive as pre-registered).
Takeaways
- Lower precision changes how the model fails, not just how often. On seed 1 the three precisions solved within three problems of each other while failing in different ways; on seed 2 the post-hoc ternary also lost 15 points. A score alone hides the failure mode.
- Stalls and loops need different fixes. A budget plus a wrap-up message handles stalls, and llama.cpp already has both. Loops with no answer behind them didn’t respond to anything I tried at decode time, and on these problems a model trained for ternary didn’t produce them at all.
- Don’t lean on one run per problem. Changing only the GPU kernel path flipped whether a run looped about as often as a new seed did.
- Write predictions down before running the test. The restart rule failing is a useful result only because the expected outcome was on record beforehand.