DEV Community

Breach Protocol
Breach Protocol

Posted on • Originally published at groundtruth.day

Nanbeige4.2-3B reuses one 22-layer stack twice to punch above its size

A Chinese lab has released Nanbeige4.2-3B, a small open-weight model with a clever structural trick: it runs its 22 transformer layers twice in a row, getting 44 layers of processing depth from a single set of weights. On the lab's own benchmarks it rivals models three times its size, and the design is genuinely interesting, but the numbers are vendor-reported and the viral "beats 4x its size" line does not survive clean accounting.

Key facts

  • The released Apache-2.0 model is 4 billion total parameters, 3 billion non-embedding, with a 262,144-token context. Model card
  • Its config specifies 22 decoder layers and num_loops 2; the code builds the 22 layers once and iterates over them twice. config.json
  • The base model was trained from scratch on 28 trillion tokens, up from 23 trillion in the previous recipe. Base-model card
  • It ships BF16 shards totaling about 8.4GB, with SGLang, vLLM, llama.cpp, and Ollama paths.

Here is the idea, in plain terms. A normal transformer stacks many distinct layers, each with its own weights, and passes data up through them once. A "looped" transformer instead reuses the same stack: the data goes bottom-to-top through 22 layers, gets normalized, then goes through those exact same 22 layers again. You get the processing depth of 44 layers while only storing the weights for 22. It is like reading a difficult paragraph twice with the same brain rather than needing two brains, more thinking passes, same stored knowledge.

The non-obvious point, and the one that keeps the hype honest, is that this saves memory, not compute. Every token still runs attention and the feed-forward network twice, and the implementation keeps loop-aware cache entries, so the real cost is roughly twice the core block compute for the storage footprint of one 22-layer stack. That can be an attractive memory-quality trade for local deployment, but it is not a 3-billion-parameter model's speed. Anyone expecting looping to be free intelligence will be disappointed; it is fixed recurrent depth, not an adaptive reasoning loop or a second generated draft.

Why it matters: weight sharing across depth is a live research direction for squeezing more capability onto modest hardware, and a public, Apache-licensed model that actually ships it is useful to study. But causation is unresolved. The base card discloses that training rose from 23 to 28 trillion tokens with heavier math, code, and STEM sampling, and there is no ablation separating the loop's effect from those extra five trillion tokens, the data mixture, and the reinforcement-learning recipe. "The loop did it" is unverified. It is also worth not crediting 4.2 with the code's newer tricks: the repository contains features like LoopSplit and depth attention, but both cards explicitly place those in a forthcoming 4.5, and the 4.2 config only activates the two-pass loop.

The benchmark framing needs the same care. The model card does not literally claim "4x," and its largest comparison is Gemma4-12B. Reaching a four-times multiplier requires mixing Gemma's 12-billion total-parameter count with Nanbeige's 3-billion non-embedding count; on a like-for-like total-parameter basis it is 4 billion versus 12 billion, about three times. Against Qwen3.5-9B, Nanbeige leads every reported row in the card's 19-metric suite; against Gemma4-12B it wins most shared rows but loses on scientific-code reasoning and two alignment measures. Those are strong author-reported results, all run in thinking mode, some using Nanbeige's in-house scaffold, not independent replications.

The honest counter-take comes from outside research: a recent paper finds that naively reapplying transformer blocks generally degrades performance and needs a carefully designed refinement scheme to help. That does not test Nanbeige, which was trained with its loop from the start, but it is the right caution, recurrence must be trained and measured as a compute-quality trade, not treated as automatic capacity. On r/LocalLLaMA, the sharpest response was also the correct one: it needs independent testing. The clean summary: a 4-billion-weight model trained to spend 44-layer compute through a 22-layer stack twice, posting striking vendor numbers that still await equal-budget outside verification.


Originally published on Ground Truth, where every claim is checked against the primary source.

Top comments (0)