GLM-5.4 is GLM-5 with 28 layers run twice: how Z.ai turned a 750B model into a loop transformer
Z.ai released GLM-5.4 on November 23 and calls it its "first loop transformer." The model is not a new pretraining run. Z.ai took the GLM-5 base model, about 750B parameters, and continued training it so that a block of 28 of its layers runs twice for every token. GLM-5's published config has 78 layers, so by our count each token now passes through 106 layer computations with the same weights. The tech blog, "GLM-5.4: Toward Generalized Coding with Our First Loop Transformer", says this brings the model to "intelligence levels comparable to 2T-3T parameter models." That is Z.ai's own claim, and no independent evaluation exists yet.
Introducing GLM-5.4: Generalized Coding with Our First Loop Transformer.
- Loops existing layers in the GLM-5 base model for deeper reasoning
- Pushes beyond traditional coding to video, games, 3D shaders, and CAD modeling
- Adds vision capabilities for stronger visual coding…
GLM-5.4 is available now to GLM Coding Plan subscribers, in Z.ai Chat and in ZCode. The API "will open after safety evaluation," and weights "will be released responsibly." The zai-org organization on Hugging Face has no GLM-5.4 repository yet; its newest models are GLM-5.3 and GLM-5.3-Flash. Without API access, outside benchmark sites can't run it either.
What looping changes
In an ordinary transformer every layer runs once per token. A loop transformer sends the hidden state through a group of shared layers again, so the network gets deeper without getting bigger. Z.ai credits the 2018 Universal Transformer and later recurrent-depth work, and says why it did not train from scratch: looped models trained that way "still lag behind unshared models under the same pre-training compute budget." Converting a trained model avoids that cost. Earlier this month we looked at a small open-weight version of the same move: SenseNova-Loop-9B-Preview turned out to be Qwen3.5-9B with 24 layers run twice. GLM-5.4 applies it at frontier scale and describes three problems it had to solve.
Activations blow up on the second pass. Writing the second pass's output straight into the residual stream made activation norms grow across iterations, and the layers after the loop then saw inputs outside their usual range. GLM-5.4 adds a per-token gate for each iteration that decides how much of the update to write. Z.ai reports that after training, the first pass writes small updates and the second writes full ones, and that on harder tokens the first pass writes more.
A second pass would double the KV cache. Keeping a full key-value cache for each iteration multiplies memory by the loop count. The second pass instead reuses the sparse KV entries selected in the first pass and keeps only a sliding window of its own new KV. Z.ai says an extra loop therefore costs one sliding window rather than a full context's worth of cache, which at 1M tokens of context keeps the deployment cost increase over GLM-5.3 "well under control."
Sparse attention would need indexing twice. GLM-5's sparse attention uses an indexer to choose which positions to attend to. The second loop reuses the first loop's indices, which Z.ai says performs "nearly identically" to recomputing them.
The evidence so far
The blog's controlled comparison is on a 30B model with the same architecture as the 750B base: same parameter count, about 10% more training compute, looped against unlooped. Z.ai reports the largest gains in math, scientific reasoning and long-context tasks, and 10–14% shorter outputs on benchmarks such as GPQA-Diamond and MMLU-Pro, "mostly from shorter chains of thought." Its reading is that part of the reasoning moves from output tokens into the extra depth. The figures are in a table on the blog. They come from the 30B model after long-context SFT, not from GLM-5.4 itself.
Z.ai is also open about a weakness: the model "tends to get caught in overly long 'marathon thinking' loops." That sits awkwardly next to the shorter outputs measured at 30B, and it will be the first thing to check once the API opens. Z.ai quotes throughput of up to 200 tokens per second off-peak and 70–80 at peak, which also can't be checked from outside yet. The rest of the announcement is demos under the "Generalized Coding" label: a music video, a game, a FreeCAD robotic arm and GLSL shaders, all generated through code.
The gate behaviour can only be inspected once the weights are out. The memory cost at long context and the 2T–3T comparison need the API, which Z.ai has not dated.
Comments
No comments yet. Be the first.