GLM-5.4 Loops 28 Layers Twice, Adds No Parameters, and Reaches Reasoning Close to a 2T Model
Looped Transformers are no longer just a concept in papers. GPT-6 Astra, Inkling 2 Mini, and GLM-5.4 are all moving in this direction. GLM-5.4 loops 28 layers twice, effectively adding 28 layers of depth—at the cost of marathon-style thinking.
Looped transformers are becoming a thing, whether you like it or not.
GPT-6 Astra, Inkling 2 Mini, and now GLM-5.4. Z.ai researcher Zixuan Li wrote only two lines on X: scale loop depth, scale model size. The former has already been delivered, while the latter is still being pushed forward. Full technical details are at z.ai/blog/glm-5.4.
What Looped Transformers Are Doing
A standard Transformer runs each layer only once. A Looped Transformer makes a group of layers with shared parameters run for multiple rounds, with the previous round's output serving as the next round's input. The parameter count stays the same, but the effective depth increases.
GLM-5.4 loops the middle 28 layers of GLM-5 twice. The team says this effectively adds 28 layers of virtual depth, bringing intelligence level close to 2T-3T parameter models.
In his breakdown, Aaryan Kakad used an analogy: the first pass sketches a draft, the second pass inks the lines, and it all happens in latent space before a single token has even been output.
Z.ai did not train this architecture from scratch. They first pretrained GLM-5 in the usual way, then converted the middle layers into loops and completed the transition through continued training. They validated scalability step by step on 1B, 4B, 30B, and 750B before putting the 750B flagship model into it.

Three Key Changes
If you simply make the same group of layers run twice, the activations in the residual stream blow up. GLM-5.4 adds a per-token gate that controls how much of each iteration's update is written back into the residual stream. After training, the gate develops a clear division of labor: the first pass builds global context and writes conservatively; the second pass refines, opening the gate wider. The harder the token, the more aggressive the first-pass writes.
When looping twice, the KV cache cannot simply be doubled. GLM-5.4 lets the second pass reuse the sparse KV generated by the first pass while keeping only its own sliding window. The two KV paths can overlap, so the model can read both the global representations from the first pass and the local updates from the second. At 1M context, the deployment cost of one extra loop is equivalent to just one additional sliding window.
The base model itself uses sparse attention. The second pass directly reuses the attention indices computed in the first pass, with zero extra indexing overhead. Experiments show the effect is nearly the same as recomputing on every pass.
Deeper Reasoning, Less Rambling
Z.ai ran an iso-parameter comparison on the 30B model: with the same parameter count and only about 10% more total training compute, the looped version improves noticeably. The largest gains are in math, scientific reasoning, and long-context tasks. On GPQA-Diamond and MMLU-Pro, average output length dropped by 10-14%. Some of the thinking shifted from explicit reasoning tokens to the implicit depth of the loops.

Inference speed is also preserved reasonably well: up to 200 tokens/s during off-peak periods, and 70-80 tokens/s during peak periods.
The team also acknowledges a quirk: marathon thinking. The model repeatedly reflects on hard problems, slowing down responses. But this stubbornness pushes accuracy beyond what its parameter count would normally suggest.
What Is Generalized Coding?
Z.ai does not position GLM-5.4 solely as a coding model. They call it Generalized Coding: code becomes the foundation for solving a broader range of tasks. Official examples include a self-narrated music video, building a six-axis robotic arm with FreeCAD, directly generating a complete game, and making an interactive 3D birdwatching experience using mathematical geometry and GLSL shaders.
These tasks require multi-step spatial and causal consistency, where one mistake ruins the entire render—loop depth is exactly useful here.
Looped Architectures Are Not Just One Company's Idea
Hesamation named them on X: GPT-6 Astra, Inkling 2 Mini, GLM-5.4. Whether you like it or not, Looped Transformers are becoming the choice for flagship architectures.
Xuanlei Zhao from NUS posted LoopRes in the comments. They found that after the same group of layers is iterated multiple times, outputs become too similar. LoopRes adds a trainable loop-aware key to each loop to preserve structural identity. On Qwen3-1.7B, 2x compute yields a 29.1% improvement over SFT and can scale to 30B. Details at oahzxl.github.io/LoopRes.
Some people in the comments also brought up old history: recurrent neural networks are back under a new name. This round of debate is not over yet.
Next Steps
GLM-5.4's next goal is adaptive loop depth: harder tokens get more loops, simpler ones get fewer. Model size and loop depth will continue to scale together. The team says the next larger model is already on the way. The API is coming soon, and open-source weights are planned for release after security hardening.
发布时间: 2026-11-24 04:52