Z.ai has released GLM-5.4, its first flagship model built on a Loop Transformer architecture. The GLM-5.4 Loop Transformer runs 28 layers of the GLM-5 base model for 2 iterations. Z.ai says the model reaches intelligence comparable to 2T-3T parameter models. For developers, the pitch is ‘Generalized Coding’: code as the tool for video, games, 3D shaders and CAD.
TL;DR
- Size: 750B-scale base. Active parameters not disclosed. Context window not officially listed (the blog discusses deployment at 1M context).
- Runs on: Z.ai-hosted only for now (GLM Coding Plan, ZCode, Z.ai Chat). Self-hosting hardware not disclosed until weights ship.
- Performance: No flagship benchmark table yet. Z.ai claims parity with 2T-3T parameter models.
- Best: +11.3 points on AIME25 (19.17 to 30.42) in Z.ai’s 30B looped ablation.
- Worst: +3.3 points on IFBench (50.20 to 53.47), the smallest gain. Z.ai also flags “marathon thinking” loops.
What is GLM-5.4?
GLM-5.4 is a 750B-scale Loop Transformer from Z.ai that runs shared layers twice per pass. It ships first inside Z.ai’s own products: the GLM Coding Plan, the ZCode desktop app and Z.ai Chat.
Z.ai did not pre-train a looped model from scratch. It adapted the pre-trained GLM-5 base through continued training. The technical post states that looped models trained from scratch still trail unshared models at equal compute. Adapting an existing base raises the ceiling with a relatively small compute overhead.
How does the Loop Transformer work?
In a standard Transformer, each layer runs once per forward pass. In GLM-5.4, a group of 28 weight-shared layers runs for 2 iterations. Z.ai made 3 changes to keep this practical at 750B scale.
Gated progressive updates
Overwriting hidden states across loops made activation norms blow up. GLM-5.4 adds independent per-token gates for each iteration. The first pass writes small updates and builds global context. The second pass opens the gates to refine the output. On harder tokens, the first pass writes more aggressively.
Hybrid KV cache
A naive design keeps a full KV cache for every loop. GLM-5.4’s second loop reuses the sparse KV selected in pass 1. It keeps its own new KV only inside a local sliding window. So the extra loop costs 1 sliding window of KV cache, not a full context cache. Z.ai says this keeps the cost increase over GLM-5.3 under control at 1M context.
Sparse attention index reuse
The second loop reuses the indices from the first loop’s indexer. That adds zero indexing overhead. Z.ai reports near-identical results versus recomputing indices on every pass.
