Skip to content

Dory1.0-4B: Does Looping a 4B Model Four Times Really Beat 26B Models?

THE ARGUMENT

Looping is not free depth: it moves compute from output tokens into latent state, letting one 4B checkpoint match models with roughly 9x the parameters on a 12-benchmark average — at the cost of higher compute per token, a post-training ceiling of four loops, and up to 2.1 points lost to last-loop KV caching.

On this page

You have a monthly inference bill on your desk, and your team has to decide whether to keep buying GPUs for the 26B model or move traffic to something smaller and cheaper per call. The default playbook offers two options: use a bigger model, or let the small one think longer. Both burn tokens — the big model is expensive on every generated character, and longer reasoning traces push latency, KV cache and cost up together. Dory1.0-4B tries a third axis: 4B parameters, with one shared block of layers applied repeatedly at inference, so the extra compute is spent on latent state (the internal vectors the model never prints) instead of on longer outputs [1]. Whether that is worth changing your contract depends on a handful of very specific numbers.

The default bet: more accuracy means a bigger model

In a model selection meeting you hear two proposals. One, swap the 4B for a 26B. Two, let the 4B think longer. The first is expensive in parameters; the second is expensive in tokens, because every extra reasoning step inflates latency, the KV cache (the stored keys and values for everything already generated, which grows with context) and the bill. Both spend compute in token space.

Dory1.0-4B adds a third axis. It is a looped (latent-recurrent) model: the layer stack is split into blocks, and one of them can be invoked k times at inference without changing the parameter count. The paper calls this elastic depth — a single checkpoint serving different inference compute budgets [1]. For a buyer, that translates to: you do not need a separate model per budget, one weight file can run one loop or four depending on request difficulty.

Only 40 of the 72 layers actually repeat

The 72 physical layers are partitioned into a 16-layer input block, a 40-layer shared recurrent block, and a 16-layer output block. Input and output blocks run once; only the middle 40 layers are invoked k times. Effective forward depth is therefore 32 + 40k, ranging from 72 to 192 layer applications. The input block's output is re-injected into the state at the start of every loop so deep recurrence does not wash out the original input [1].

The backbone is a normalized Transformer (nGPT): each sublayer output is L2-normalized to unit length before it continues, with learned per-channel residual blending. Attention layers alternate at 3:1 — 27 sliding-window layers (each looking only at the last 1,024 tokens, which is cheaper) and 9 full-attention layers, plus 36 MLP-only layers. There are 16 query heads and 4 KV groups (grouped-query attention, where several query heads share one set of keys and values to save memory).

The 12-benchmark average: 35.2 at one loop, 39.7 at two, 40.6 at four

The paper reports an equal-weight average over 12 benchmarks: SciCode, SWE-Bench Verified, Terminal-Bench v2.1, τ³-Banking, GDPval-AA v2, GPQA Diamond, Humanity's Last Exam (HLE), IFBench, AA-LCR, GDP.pdf, plus AA-Omniscience scored on both accuracy and non-hallucination, with GDPval-AA v2 Elo normalized as (Elo−500)/20 [1]. The average rises from 35.2 at one loop to 39.7 at two and 40.6 at four.

For reference, the paper says this beats Qwen3.5-9B, Gemma 4 12B and Gemma 4 26B-A4B, and lands within 1.7 points of Qwen3.6-35B-A3B — a model with roughly 9x the total parameters. On individual tasks at four loops, SWE-Bench Verified is 61.8% versus 57.4% for Gemma 4 26B-A4B, and GDPval-AA v2 is 967 versus 752 Elo.

The base-model curve is more informative, because it shows where the gains saturate:

Benchmark (Dory1.0-4B Base)1 loop2 loops4 loops
MMLU (5-shot EM)68.2070.7771.19
MMLU-Pro (5-shot CoT)51.5255.0656.09
GSM8K (8-shot CoT)86.4389.9989.84
MATH-500 (4-shot)60.6065.0069.40
HumanEval (pass@1)58.3359.7662.34
MBPP-Sanitized (pass@1)57.0961.5060.89

The jump from one loop to two is consistently the largest; two to four narrows sharply. That is why the authors cap post-training results at four loops, and evaluate six and eight loops only on the base model as inference-depth extrapolation [1]. The knob exists, but its useful range is bounded.

The real bill: four loops write 1.3–2.5x fewer tokens

Looping raises compute per token, which is obvious. The paper's counter-argument is that on agentic tasks it emits fewer tokens. Across four agentic benchmarks, four loops reduce generated tokens per attempt by 1.3–2.5x relative to one loop, with the largest reductions on GDPval-AA v2 and Terminal-Bench v2.1 [1].

The mechanism is not mysterious: extra computation goes into latent state, so the model does not have to buy accuracy with hundreds of extra reasoning words. For per-token billing or output-length-bound latency, that maps directly to money. For GPU-hour billing, it depends on whether cheaper outputs outweigh costlier tokens — the paper only claims the two 'partially' offset, and gives no total-cost conclusion.

Keep only the last loop's KV cache: memory saved, −2.1 to +0.4 points paid

The obvious engineering problem with looping is caching: store one copy per loop and memory grows linearly with k. Dory1.0-4B uses last-loop KV caching, where each loop overwrites the previous loop's entries, so KV footprint equals that of a non-looped model at any loop count [1].

The price is quantified: at four loops, last-loop caching shifts benchmark scores by between −2.1 and +0.4 points versus per-loop caching, with nearly unchanged output lengths. It retains most of the accuracy gain, not all of it — if your acceptance threshold sits inside that 2.1-point band, the design contains a real trade-off. The paper also discusses self-speculative decoding, drafting with shallow loops and verifying with deeper ones, in its Section 6 [1].

Two hard details from training: 4.5T tokens in NVFP4 and a difficulty-aware loop curriculum

Pretraining totals 6T tokens. The first ~4.5T ran at one loop in NVFP4 (4-bit floating point with block scaling, applied only to supported linear-layer matrix multiplies, while weights stay BF16 and optimizer master weights stay FP32), giving roughly 20% end-to-end speedup over BF16; that stage ends at iteration 720,750, around 4.535T tokens. A BF16 continuation of about 1.465T tokens then introduces loop sampling from {1,2,3,4} with truncated backpropagation through loops — gradients flow only through the final invocation, at depth one. A final ~300B tokens extends context from 32,768 to 262,144, for a total budget near 6.3T [1].

Post-training is nine epochs of SFT on packed 256K sequences (keeping random loop sampling) followed by 200 steps of asynchronous GRPO RLVR across 23 environments. The key ingredient is a difficulty-aware loop curriculum: prompts with lower profiled pass rates are preferentially routed to deeper loops. The ablation shows the largest gains at four loops, for example lifting Terminal-Bench v2.1 from 14.0% to 21.4% [1].

  • 6T token pretraining, then ~300B tokens of long-context extension, ~6.3T total
  • NVFP4 stage ~4.535T tokens, roughly 20% end-to-end speedup over BF16
  • Loop counts sampled uniformly from {1,2,3,4}, with ~10% of replicas forced to one loop
  • RLVR: 200 steps of asynchronous GRPO across 23 environments
  • Difficulty curriculum lifts Terminal-Bench v2.1 from 14.0% to 21.4%
  • Open weights in BF16, MXFP8, NVFP4 and GGUF (Q5_K_M) under OpenMDW-1.1

Where this stops applying

First, post-training only covers four loops. Six and eight loops appear only on the base model, and generally do not improve — some tasks regress (GSM8K is 89.84 at four loops versus 89.99 at two; MBPP-Sanitized is 60.89 versus 61.50). Treating loop count as an unbounded dial will disappoint.

Second, the 12-benchmark number is an equal-weight average that folds GDPval-AA v2 Elo in through an (Elo−500)/20 rescaling chosen by the authors; a different rescaling could reorder the average. That is my own observation, not something the paper stress-tests.

Third, the token-efficiency evidence covers four agentic benchmarks and measures output tokens per attempt, not total cost — costlier per-token compute is only 'partially' offset. Fourth, the largest gains are on coding, agentic and long-context tasks, while general-knowledge benchmarks move modestly. Fifth, there is exactly one scale point at 4B, with no larger or smaller sibling in the same architecture, so 'looping beats adding parameters' is a result about one checkpoint, not a scaling law.

So back to the bill on your desk: if your workload is agentic or coding-heavy, latency is dominated by output length, and memory is pinned by KV cache, this design deserves a proof of concept. If you pay by GPU-hour, mostly serve short Q&A, or need depth beyond four loops, the numbers here are not yet enough to justify switching vendors [1].

References

  1. Dory1.0-4B: A Looped Normalized-GPT

Sign in to Padda

A code in your inbox. No password to remember.

Connecting to sign-in…