UPDATE (Nov 28) — Free Accuracy Lift via LoopCD Contrastive Decoding (
3 passes + LoopCDis now default): Huge thanks to@beamivalice(author ofsushi), who called out Apple’s recent LoopCD research (“Decoding Looped Transformers Better for (Almost) Free”,arXiv:2610.02185) and addedLoopCDsupport intomlx-serve(ddalcu/mlx-serve#1348). Extrapolating the hidden-state step between the last two passes right before exiting the loop (0extra FLOPs,0extra KV cache) lifted ourv3.13-pass adapter+3.2 ptsacross314problems (15wins vs.5losses) — including+10.0 ptson LiveCodeBench v6 (+22.5 ptsover 24k Stock),+12.0 ptson GPQA Gate-50, and90.0%on AIME 2025 in half the tokens. Updated tables and charts below.
Models like Inkling-2-Mini showed that looping middle transformer blocks 2–3× per token lets a model do iterative reasoning in latent space instead of burning 20k–30k <think> tokens — especially when paired with Multi-Token Prediction (MTP) speculative decoding to absorb the extra FLOPs.
The catch is that recurrent-depth models are normally trained that way during pretraining. I wanted to see whether looping retrofits work on an off-the-shelf open model: keep Qwen3.8-27B 100% frozen, wrap its middle 16 layers in a tiny loop adapter, and calibrate its native MTP head to match.
With a small 0.23% adapter (240 MB) + LoopCD on frozen Qwen3.8-27B, we got:
- Higher LiveCodeBench v6 accuracy at every token cap (
Stock → Looped): 72.6% → 78.9% (+6.3 pts) on all 175 problems at an 80k cap, 73.3% → 85.0% (+11.7 pts) at a 64k cap (v3.1, 60 problems), and 55.0% → 77.5% (+22.5 pts) at a tighter 24k cap (3 passes + LoopCD, where Stock’s long<think>chains get cut off). - Stronger Olympiad math in half the tokens (
Stock → Looped): 93.3% → 96.7% on AIME 2024 (80k), and 73.3% → 90.0% (+16.7 pts) on AIME 2025 at a 24k cap — matching Stock Qwen3.8’s 80k score in half the tokens. - 50%–90% fewer
<think>tokens across coding, math, bug repair, and MMLU-Pro. - Same tokens/sec, 2×–3.7× faster answers: Calibrated MTP keeps per-token speed flat (36.7 tok/s vs. Stock’s 37.1 tok/s on an M5 Max despite running the middle layers multiple times). Because each answer needs half as many tokens (and hits far fewer 80k-token timeouts), total wall-clock time drops dramatically — finishing all 2,321 H200 eval problems in 233 min → 62 min (3.7× faster).
- Zero-fork plugins for mlx-serve (Apple Silicon) and vLLM (CUDA, defaulting to
3 passes + LoopCD), with weights on HuggingFace.
How the Retrofit Is Wired
Because all 64 layers of Qwen3.8-27B stay frozen, the release is a drop-in overlay on top of BF16, FP8, 8-bit, or 4-bit base weights:
- Middle-layer loop (layers 24–39): Runs 1, 2, 3, or 4 passes per token (set via runtime flag), with a zero-initialized gated adapter before each pass and a cross-pass mixer anchored back to layer 23 so deeper passes don’t drift off-manifold.
- Zero-cost LoopCD-Hidden exit (
ω = 0.15at 3 passes): Right before entering exit layers 40–63, we extrapolate along the hidden-state delta(pass_3 − pass_2)— amplifying what the extra pass refined with zero extra matrix multiplies or KV cache. - Calibrated MTP head (810 MB): Looping shifts final hidden states enough to drop draft acceptance on the stock MTP head; a short calibration pass restores 3.57 accepted draft tokens/step.
Benchmarks & Token Counts
Evaluated at Qwen3.8’s official 80k ceiling on EvalScope and greedy pass@1 on EvalPlus, alongside unmodified Inkling-2-Mini on mlx-serve and our v3.1 + LoopCD runs:
| Benchmark | Stock Qwen3.8-27B | Looped (2 passes) | Looped (3 passes) | + LoopCD / v3.1 (Stock → Looped) | Inkling-2-Mini (baseline) | Token Delta |
|---|---|---|---|---|---|---|
| LiveCodeBench v6 (175, 80k) | 72.6% · 31.6k tok | 73.1% · 13.1k tok | 78.9% · 15.1k tok | 73.3% → 85.0% (v3.1 @ 64k, n=60);56.7% → 80.0% (3p+CD @ 24k, n=60) | 82.3% · 23.2k tok | -52% to -67% |
| AIME 2024 (30, 80k) | 93.3% · 20.2k tok | 96.7% · 9.5k tok | 96.7% · 11.5k tok | 83.3% → 93.3% (v3.1 2p+CD @ 24k, 9.0k) | — | -53% |
| AIME 2025 (30, 80k) | 90.0% · 19.6k tok(73.3% @ 24k) | 86.7% · 13.4k tok | 86.7% · 12.3k tok | 73.3% → 90.0% (v3.1 3p+CD @ 24k, 10.0k);90.0% → 93.3% (v3.1 ckpt_300 @ 64k) | 96.7% · 17.2k tok | -49% |
| MMLU-Pro (500, 80k) | 82.2% · 5.0k tok | 80.0% · 1.5k tok | 83.2% · 1.6k tok | 86.0% → 89.3% (3p+CD @ 24k, n=150, 1.4k) | — | -68% to -69% |
| HumanEvalFix (164) | 98.8% · 2.3k tok | 93.3% · 268 tok | 95.1% · 254 tok | 97.0% · 223 tok (3p+CD, 159/164) | — | -90% |
| MBPP+ Direct (378) | 77.5% · 108 tok | 79.6% · 93 tok | 78.8% · 93 tok | 79.6% (LoopCD off on Direct) | 77.8% · 395 tok | -14% (4.2× < Inkling) |
| HumanEval+ Direct (164) | 79.9% · 255 tok | 81.7% · 254 tok | 80.5% · 244 tok | 81.7% (LoopCD off on Direct) | 82.9% · 562 tok | Same (2.2× < Inkling) |
| HumanEval+ Think (164) | 81.7% · 1.9k tok | 82.3% · 642 tok | 82.9% · 640 tok | 82.9% · 640 tok | 90.2% (med. effort) | -66% |
| MBPP+ Think (378) | 83.6% · 2.3k tok | 83.1% · 810 tok | 83.1% · 707 tok | 83.1% (ties Stock @ 24k) | 81.2% · 499 tok | -64% to -69% |
| GPQA Diamond (198, 80k) | 86.9% · 18.7k tok(80.8% @ 24k) | 80.8% · 4.7k tok | 82.3% · 4.9k tok | Ties 80.8% @ 24k (3.6× fewer tok);Gate-50: 68% → 80% (3p+CD) & 82% (4p) | 86.6% · 10.4k tok | -71% to -73% |
- LiveCodeBench v6: 3 passes closes 65% of the gap to Inkling-2-Mini on all 175 problems while using 35% fewer tokens than Inkling (15.1k vs. 23.2k), and
v3.1pushes the 60-problem stratified split to 85.0% (+11.7 pts over Stock) in half the tokens. - No-
<think>codegen (MBPP+&HumanEval+Direct): Gains +2.1 and +1.8 pts with thinking disabled — confirming the extra pass sharpens single-token representations directly, not just CoT formatting. - Why wall-clock drops 3.7× even though tok/s is flat: Per-token generation speed is ~unchanged (36.7 vs. 37.1 tok/s), so the speedup comes from generating 50%–90% fewer tokens per problem and eliminating long-tail 80k-token stragglers in batched H200 runs (233 min → 62 min).
How Much LoopCD Lifts Things Even More (0 Extra FLOPs)
After publishing the initial v3 results, @beamivalice pointed out Apple’s LoopCD paper (arXiv:2610.02185) and landed support in ddalcu/mlx-serve#1348. Normally a looped model discards its intermediate passes once the final pass finishes; LoopCD-Hidden instead nudges the final hidden state further along the direction the last pass moved, at zero extra compute or memory.
To measure the isolated lift, we ran exact item-level paired evaluations (seed = 42 + i, 24k cap) toggling only LoopCD ON vs. OFF at the same pass count:
| Paired 24k Suite | Stock Qwen3.8-27B | Looped (LoopCD off) | Looped + LoopCD | Isolated LoopCD Lift | Total vs. 24k Stock |
|---|---|---|---|---|---|
LiveCodeBench v6 (v3.1, 40 probs, 3p) | 55.0% · 27.4k tok | 67.5% · 9.2k tok | 77.5% · 8.9k tok | +10.0 pts (+4 / 0 losses) | +22.5 pts (-67% tok) |
GPQA Gate-50 (v3.1, 50 probs, 3p) | 86.0% · 17.3k tok | 68.0% · 5.5k tok | 80.0% · 5.5k tok | +12.0 pts (+7 / -1) | -6.0 pts (-68% tok) |
AIME 2025 (v3.1, 30 probs, 3p) | 73.3% · 19.0k tok | 86.7% · 9.1k tok | 90.0% · 10.0k tok | +3.3 pts (+2 / -1) | +16.7 pts (ties 80k Stock!) |
AIME 2024 (v3.1, 30 probs, 2p) | 83.3% · 18.7k tok | 83.3% · 10.5k tok | 93.3% · 9.0k tok | +10.0 pts (+3 / 0 losses) | +10.0 pts (-52% tok) |
LiveCodeBench v6 (v3, 60 probs, 2p/3p) | 56.7% · 12.6k tok | 75.0% (2p) / 80.0% (3p) | 78.3% (2p) / 80.0% (3p, -8% tok) | +3.3 pts at 2p | +23.3 pts (-53% tok) |
HumanEvalFix (v3, 164 probs, 2p/3p) | 98.2% · 2,286 tok | 93.3% (2p) / 95.1% (3p) | 96.3% (2p) / 97.0% (3p, 223 tok) | +3.0 pts (2p) / +1.9 pts (3p) | -1.2 pts (-90% tok) |
MMLU-Pro (v3, 150 probs, 3p) | 86.0% · 4,580 tok | 88.7% · 1,480 tok | 89.3% · 1,432 tok | +0.6 pts | +3.3 pts (-69% tok) |
All 314 v3.1 3-Pass Problems Pooled | 85.0% (267/314) | 85.7% (269/314) | 88.9% (279/314) | +3.2 pts (15 wins / 5 losses) | +3.9 pts over 24k Stock |
At 2 passes, extrapolating (pass_1 − pass_0) helps math and coding (+3.3 to +10.0 pts) but trims GPQA by 4 pts because pass 0 is still setting up token representations. By 3 passes, (pass_2 − pass_1) is a clean late-stage refinement direction — giving a 3:1 win/loss ratio across coding, math, and science alike, which is why 3 passes + LoopCD (ω = 0.15) is now our single default.
Caveat: Over-Compression, v3.1 & LoopCD Recovery
Token counts also exposed where v3 over-compressed: on GPQA Diamond, cutting <think> by 71% (18.7k → 5.5k tok, vs. Inkling’s 10.4k) caused premature </think> exits on ultra-long science derivations (-4.6 pts at 80k, while tying Stock Qwen3.8 at 24k: 80.8% vs. 80.8% in 3.6× fewer tokens).
Adding a one-sided penalty against emitting </think> earlier than the base model (v3.1, ckpt_200.safetensors) plus 3p + LoopCD (ω = 0.15) lifts our 50-item GPQA diagnostic gate from 62% (v3 2p) → 80.0% (40/50) (and 82.0% at 4 passes), while pushing 64k LiveCodeBench to 85.0% and matching 80k Stock on AIME 2025 (90.0%) in half the tokens.
Why Looping Retrofits Look Worth Exploring
Almost all open-weights post-training today scales test-time compute along one axis: generating more surface tokens via RL. Retrofitting a recurrent loop gives existing models a second, orthogonal axis — more latent depth per token — for ~0.2% extra parameters and a few hours of GPU training:
- A runtime depth knob (
T=1/2/3/4) + free contrastive decoding from one checkpoint: Run3 passes + LoopCDas your high-accuracy default, drop to2 passeson RAM-constrained laptops, or set1 passfor bit-exact Stock Qwen3.8-27B behavior. - Wide-open design space: Which layer range to loop, adaptive per-token halting (looping only on high-entropy tokens instead of every token), and retrofitting loops onto MoE or smaller coding models all look wide open to explore.
Run It (No Engine Forks)
Mac (mlx-serve v26.11.4+)
mlx-serve plugin install liblooped_qwen38.dylib --yes
echo '{"enabled": true}' > ~/.mlx-serve/plugins.json
python3 scripts/export_mlx_serve_pack.py \
--base-model ~/.cache/huggingface/hub/models--mlx-community--Qwen3.8-27B-4bit/snapshots/<hash> \
--adapter v3.1/ckpt_200.safetensors \
--mtp model-mtp.safetensors \
--out ./Looped-Qwen3.8-27B-4bit-pack \
--num-passes 3
mlx-serve serve --model "$PWD/Looped-Qwen3.8-27B-4bit-pack" --port 8080
Linux / CUDA (vLLM — Defaults to 3 Passes + LoopCD)
pip install "git+https://github.com/jasontitus/loopedqwen.git#subdirectory=vllm_looped_qwen38"
# Defaults out-of-the-box to T=3 + LoopCD-Hidden (omega=0.15, ref="prev")
VLLM_LOOPED_CKPT=/path/to/v3.1/ckpt_200.safetensors \
vllm serve Qwen/Qwen3.8-27B \
--hf-overrides '{"architectures": ["LoopedQwen3_5ForCausalLM"]}' \
--dtype bfloat16 \
--max-model-len 81920
Sub-note (ML implementation details): Qwen3.8-27B is a 64-layer hybrid trunk (48 GatedDeltaNet linear-attention + 16 Gated Attention blocks). The 62.85M-param BF16 adapter adds a per-pass RMSNorm + SwiGLU workspace entry gate with zero-initialized
tanhanchoring around blocks 24–39, a cross-pass mixer blending passpwith pre-looph₀, and rank-16 LoRA on blocks 40–51. Backpropagating multiple passes through GatedDeltaNet over long contexts required reformulating the chunkwise WY parallel scan in log-space (looped_qwen38.py) to avoid fp32exp()overflow.v3.1(ckpt_200.safetensors) adds true BPE token-count effort buckets and a one-sided KL stop-guard (--lam-stop) at</think>positions wherep_loop(</think>) > p_base(</think>). Inference-time LoopCD-Hidden (arXiv:2610.02185Eq. 2) applies RMS-matched hidden extrapolationh_cd = rms_match(m_{T-1} + ω(m_{T-1} - m_ref), m_{T-1})directly before layer 40 (ω = 0.15, ref = m_{T-2}atT=3; gated to0whenthinking=False).
Links
- Looped-Qwen3.8-27B on HuggingFace —
v3&v3.1adapters, calibrated MTP head, and prebuilt macOS plugin - jasontitus/loopedqwen on GitHub — Training code, log-space WY scan,
LoopCDeval JSONLs, and both plugins - mlx-serve Plugin · vLLM Plugin · mlx-serve LoopCD PR #1348




