GLM-5.4 Released: Running the Transformer Layers an Extra Time, Performance Comparable to 2T-3T Models
Z.ai launches GLM-5.4, its first flagship model based on the Loop Transformer architecture. Without adding parameters, it improves reasoning depth by executing 28 layers twice in a loop, reaching intelligence comparable to 2T-3T parameter models. Coding capabilities are extended to video, 3D, CAD, and games. API will open soon, and weights are planned to be open-sourced.
Z.ai has released GLM-5.4, their first flagship model based on the Loop Transformer architecture.
Core approach: execute the 28 layers in the GLM-5 base model twice in a loop. Parameters do not increase, but reasoning depth goes up. According to the official statement, its intelligence level can rival models with 2T-3T parameters.
What Is Loop Transformer
In a standard Transformer, each layer of the network runs only once in each forward pass. Loop Transformer lets a group of layers with shared weights iterate multiple times, repeatedly refining the hidden state from the previous pass. The network becomes deeper, but the parameter count stays the same.

This idea is not new. In 2018, Universal Transformer proposed weight-sharing depth, and recent research on recurrent depth and recurrent language models has also made small-scale progress. The problem is: recurrent models trained from scratch still cannot beat models without shared parameters under the same pretraining compute.
Z.ai’s solution is not to start from scratch. They convert the already-pretrained GLM-5 base model into a Loop Transformer through continued training. With relatively small additional compute, they raise the intelligence ceiling.
Three Key Technical Changes
At the 750B scale, GLM-5.4 loops 28 layers twice. To balance gains and deployment cost, they made three changes:
Gated Progressive Updates. Directly overwriting the hidden states of intermediate layers multiple times would cause activation norms to explode across iterations. GLM-5.4 adds an independent per-token gate for each iteration, writing candidate updates back into the residual stream proportionally. After training, the gates automatically divide labor: the first round writes with a small magnitude to establish global context; the second round opens up writing to refine the output. Difficult tokens receive more aggressive writes in the first round, allowing complex predictions to benefit more from iterative refinement.
Hybrid KV Cache. A naive implementation would save a full KV cache for each loop iteration, doubling memory with the number of loops. GLM-5.4’s approach is: the second loop reuses the sparse KV selected in the first round and additionally keeps only its own sliding-window KV. The two KV streams can overlap at the same positions, and the model attends simultaneously to the first round’s contextual representation and the second round’s updated local representation. The extra loop costs only one sliding-window KV cache, not a full-context cache. At a 1M context length, deployment cost is not much higher than the previous generation GLM-5.3.
Sparse Attention Index Reuse. The base model uses sparse attention. The second loop directly reuses the attention indices generated in the first round, with zero additional index overhead. Experiments show the effect is almost identical to recomputing indices each round.
Equal-Parameter Comparison: Same Parameters, More Compute, Better Results
The Loop architecture is a strict test of Scaling Correctness: architectural changes must remain effective at large scale. Z.ai validated progressively on 1B, 4B, 30B, and 750B base models.
On the 30B model (same architecture as the 750B base model), they ran an equal-parameter comparison: the parameters are exactly the same, with only about 10% more training compute, and the looped version has a clear advantage.

Two findings:
- Longer reasoning chains benefit more. Math, scientific reasoning, and long-context tasks improve the most—this is precisely the core of Generalized Coding.
- Fewer tokens are used for thinking. On most benchmarks, average output length drops by 10–14%, mainly because chain-of-thought becomes shorter. Some reasoning shifts from explicit output tokens into the implicit depth of the loop.
The official post also mentions a characteristic: GLM-5.4 tends to fall into overly long marathon-style thinking loops. But this sustained reflection and self-correction does push accuracy beyond what the parameter count would predict.
Inference Efficiency
Up to 200 tokens/s during off-peak hours, maintained at 70–80 tokens/s during peak hours. The multi-loop architecture can achieve this throughput thanks to resources saved by the KV cache and sparse indices, as well as system-level fusion of core kernels, reducing intermediate memory reads and writes.
Generalized Coding: Coding Becomes a Foundational Capability
Since coding became Z.ai’s focus in early 2025, they have unlocked Agentic Engineering, Long-Horizon Tasks, and cybersecurity. GLM-5.4 pushes coding capability into broader domains: writing code to generate and edit videos, build complete games, and handle 3D modeling and mechanical design.
The blog shows several examples:
- Generating a self-narrated music video “Hello World” by writing code
- Building a 6-axis robotic arm in FreeCAD (engineering-grade CAD modeling)
- Complete games, including character animation, physics, maps, combat systems, and art assets
- A 3D interactive birdwatching experience generated by pure mathematical geometry and custom GLSL shaders
These capabilities come from improvements in both coding and vision. Coding is already the cornerstone of model capability and is expanding to a broader range of tasks.
How to Access
- GLM Coding Plan: z.ai/subscribe
- ZCode: zcode.z.ai
- Z.ai Chat: chat.z.ai
- API: opening after security evaluation
- Open-source weights: released after security hardening is complete
Next, Z.ai is exploring adaptive compute—allowing difficult tokens to dynamically receive more iterations. They do not plan to give up either loop count or model scale, and will advance both simultaneously.
发布时间: 2026-11-23 21:47