Z.ai has released GLM-5.4, its first flagship built on a loop transformer: a block of 28 layers runs twice in a row, reusing the same weights. The company says the result reaches intelligence comparable to models with 2 to 3 trillion parameters, while staying at the 750 billion parameters of the base architecture.
The difference from a standard transformer is structural. In a conventional transformer each layer runs once per pass. In a loop, a group of weight-shared layers works over several iterations, refining at each step the internal states produced by the previous one. The result is a deeper network without added parameters: the model reasons more thoroughly, but does not grow in size.
An old idea, applied differently
The idea is not new. A ottobre OpenAI prevedeva un nuovo flagship con looped transformer, ma l'allineamento e la sicurezza risultavano ancora in ritardo. The Universal Transformer, a 2018 paper, already proposed depth with shared weights, and more recent work on recurrent depth has shown gains on small models. The problem, according to Z.ai, is that a looped model trained from scratch lags behind a standard one at equal pre-training compute. So the company did not start over: it took an already trained base model and converted it into a loop transformer through continued training, spending relatively little extra compute.
The conversion required three changes, because simply overwriting hidden states made activation norms explode across iterations. The first is gated progressive updates: for each token and each iteration, a gate decides how much of the update flows into the residual stream. After training, the gates took on distinct roles. The first pass builds global context and writes conservatively with small values; the second reuses that state and opens the gates to write the full update. On harder tokens the first pass writes more decisively.
The second change concerns the KV cache, the memory the model uses for context. A naive version would keep a full cache for every iteration. Z.ai combined cache sharing across loops with a local sliding window for the new pass: the second pass reuses the sparse cache selected in the first and keeps its own window. An extra loop therefore costs one sliding window instead of a full context cache, and at 1-million-token contexts the increase in deployment cost over GLM-5.3 stays, according to the company, under control.
The third change is sparse attention index reuse. The base model uses sparse attention, and the second loop directly reuses the indices produced by the first loop's indexer, with no extra indexing overhead. In the company's experiments the result is nearly identical to recomputing the indices on every pass.
The claimed numbers
The post's only numerical comparison comes from a controlled experiment on a 30-billion-parameter model with the same architecture as the 750-billion base. With identical parameter counts and about 10% more training compute, the looped version does better on reasoning benchmarks. The values, reported after supervised fine-tuning on 200,000-token contexts with reasoning mode enabled, are:
- AIME25 (competition-level math): from 19.17 to 30.42, +11.3
- GPQA-Diamond (university-level science questions): from 47.58 to 56.26, +8.7
- AA-LCR (reasoning over long contexts): from 40.33 to 47.67, +7.3
- MMLU-Pro: from 71.65 to 75.05, +3.4
- IFBench: from 50.20 to 53.47, +3.3
The largest gains sit where long reasoning chains are needed. In the same tests, answers get shorter: on GPQA-Diamond average output length falls by about 12%, on MMLU-Pro by about 15%. Z.ai explains that part of the reasoning shifts from explicit tokens to the implicit depth of the loop. These are figures from a smaller model, reported by the company, and they do not by themselves show what the flagship achieves.
Inference and availability
GLM-5.4 reaches up to 200 tokens per second during off-peak hours and sustains 70 to 80 tokens per second at peak load. To reach that speed with multiple passes, the company says, model and inference infrastructure had to be designed together, with system-level kernel fusion to reduce intermediate memory reads and writes.
The model is available now to subscribers of the GLM Coding Plan and in the coding tools connected to it, including ZCode, Trae, WorkBuddy and Qoder, as well as in Z.ai's chat. Users on the Coding Plan V2, V3 and Team plans receive 1.5 times their usual quota when using GLM-5.4. API access, by contrast, will open only after a safety evaluation, and the weights are to be released openly "in a responsible manner". No API price is given, and no dates are set for the API or the weights.
Generalized coding
Z.ai calls the direction of this generation "generalized coding": using code to do things beyond programming. Examples include a music video whose visuals are generated in real time by front-end code, with no image assets; an interactive bird-watching scene built only from mathematical geometry and GLSL shaders; and a six-axis robot arm modeled in FreeCAD and animated in Blender.
The company also says it ran the model through 200 real-world coding scenarios and considers it "still the Chinese model with the strongest feel for coding", with strengths in visual coding and long-horizon tasks. Neither the 200 tests nor per-task scores have been published, and the comparison models were not disclosed. Results on public leaderboards such as SWE-bench are also missing, so for now the assessment rests on the company's own account.
Z.ai also acknowledges a limitation: the model tends to get caught in overly long "marathon thinking" loops. According to the company, though, this extended reflection and self-correction consistently improve accuracy beyond what the parameter count would suggest.

No comments yet. Be the first!