750B GLM-5.4 runs its middle layers twice: how was Z.ai's looped model trained?
Z.ai's first Loop Transformer runs 28 layers twice with shared parameters, reads images and opens to Coding Plan users with a 1M-token context.
The usual way to make an AI model smarter is to make it bigger: more parameters, more data, more GPUs. In the GLM-5.4 announcement published on November 23, Z.ai tries another route. The model is at the 750B-parameter scale, but it runs its middle layers twice. The company says this brings it to an intelligence level comparable to models with 2 to 3 trillion parameters. GLM-5.4 went live the same day for every GLM Coding Plan user, in Z.ai's coding tool ZCode and in Z.ai Chat.
The release also brings two practical changes: the model now reads images, so it can write code from a design screenshot or a UI sketch, and it works with a 1M-token context. This article explains what a looped model is, how Z.ai trained it, which approaches failed along the way, and what changes for people who use it.
What a looped model is
A language model processes text by passing it through a stack of layers. Each layer refines the meaning a little further, and after the last layer the model picks the next word. In a classic model each layer runs once. In a looped model, or Loop Transformer, a group of layers runs two or more times in a row and reuses the same parameters on every pass. Think of reading a hard paragraph a second time: the book stays the same, but the reading goes deeper. The model file does not grow, yet the model gets more depth to think with.
Z.ai's reasoning is that some tasks need a lot of knowledge and others need a lot of computation. Remembering the name of a library takes memory, while solving a multi-step maths problem or a tangled bug takes longer thinking. The company writes that stacking parameters and memorising data cannot solve the second kind on its own. A loop adds thinking capacity without enlarging the memory.
The idea is not new; Z.ai itself cites the Universal Transformer proposed in 2018. It has also appeared in several open models in recent weeks: Thinking Machines' Inkling 2 Mini, which runs its middle layers three times, was small enough for a laptop, and SenseTime's SenseNova-Loop-9B runs the same layer block twice. What sets GLM-5.4 apart is scale: this time the loop is applied to a 750B model.
How it was trained
According to the announcement, looped models trained from scratch still lag behind ordinary models trained with the same compute. So Z.ai did not start over. It took its already trained GLM-5 base model and turned it into a looped model through continued training. Over three months the team scaled loop depth and model size together, validating the method step by step on 1B, 4B, 30B and finally 750B base models.
The architecture diagram shows 78 layers in the GLM-5 base. The first 26 layers, the prelude, run once. The 28 layers from 27 to 54 form the loop block: they run in a first pass and then again, with the same parameters, in a second pass. The last 24 layers, the coda, run once. Roughly, each token walks a path of 106 layers instead of 78, while the file still holds parameters for only 78. Text and images are processed together at the input: images go through a 24-layer vision encoder (ViT) and join the same stream as the text.
The most instructive part of the announcement describes what did not work at this scale. The first attempt was the simplest one: let the second pass overwrite the result of the first. In the large model this made the internal activation norms grow out of control. The fix was a per-token gate on each pass that decides how much of the new result is written over the old one. The first pass takes small, careful steps and the second makes full updates. Z.ai observed that on hard tokens the first pass writes more boldly, while on easy ones it barely touches the state.
The second problem was memory. While writing, language models keep summaries of the earlier text in a cache, the KV cache. Keeping a separate full cache for each loop would have multiplied memory use at a 1M-token context. Z.ai solved this with a hybrid cache: the second pass reuses the first pass's sparse cache, the 2,048 most relevant earlier tokens for each position, and adds only its own window of the last 128 tokens. An extra pass therefore costs one small window of memory, not a whole context. As a third step, the indexer that chooses which tokens sparse attention looks at is not rerun in the second pass; its output is reused from the first, which the company says gives nearly identical results to recomputing it.
Some details are not in the announcement: the size and sources of the training data, the reinforcement learning stages, how the vision ability was trained, and how many parameters are active per step.
What the loop changed in a smaller model
Z.ai did not publish benchmark scores for GLM-5.4 itself. The one table it shared shows the method's effect on a 30B test model. Two models with the same architecture and parameter count are compared, with the looped one using about 10% more total training compute. Measured after long-context fine-tuning with thinking on, the looped model rose from 19.17 to 30.42 on the AIME25 maths test, from 47.58 to 56.26 on GPQA-Diamond science questions, from 40.33 to 47.67 on AA-LCR long-context reasoning, from 71.65 to 75.05 on MMLU-Pro and from 50.20 to 53.47 on the IFBench instruction-following test.
The most interesting column is answer length. The looped model wrote shorter answers on every test, from 2% shorter in maths to 14.9% shorter on MMLU-Pro. Z.ai reads this as part of the reasoning moving out of the written tokens and into the hidden depth of the loop. For users, that means a model that finishes the same job with fewer tokens.
What changes for users
According to the Coding Plan docs, GLM-5.4 is available on the Lite, Pro and Max plans. The credit allowance of each plan did not change; what changed is that GLM-5.4 uses fewer credits per token. As of November 23, an input token counts as 6.9 credits on GLM-5.3 and 4.6 on GLM-5.4, and on the output side the ratio is 24 to 16. So users with weekly quotas can get 50% more work out of the same credits. Off-peak usage is also billed at half rate; peak hours are 14:00 to 18:00 Beijing time on weekdays.
On speed, Z.ai cites up to 200 tokens per second off-peak and 70 to 80 tokens per second at peak. Thinking effort can be set to low, high or max, with max as the default. In coding tools such as Claude Code the model name is glm-5.4, and the 1M-context variant is glm-5.4[1m]. The English docs suggest a 1M-token window, while the Chinese docs recommend a 512K window for better coding results, so on long projects it is worth trying both.
The demos in the announcement show the visual coding side. GLM-5.4 produced a music video it narrated itself, modelled a six-axis robotic arm in FreeCAD, wrote a complete playable game and built a 3D bird-watching scene with GLSL shaders, all as the output of code it wrote.
What comes next
API access is not open yet; Z.ai says it will open after safety evaluation. The company also plans to release the model files as open source after the necessary safety hardening, without giving a date. As of November 23, the newest model on the zai-org Hugging Face page is GLM-5.3, released openly at the end of August. Z.ai adds that its next, significantly larger model will be ready soon; it has not given a name or a date.
Z.ai also names a known weakness itself: the model sometimes gets caught in overly long "marathon thinking" loops, though the company adds that this extended reflection and self-correction still lifts accuracy beyond what its parameter count would suggest. The team's next goals are an adaptive loop that gives hard tokens more passes and easy tokens fewer, and a study of how the gains scale as the number of passes grows.
What makes GLM-5.4 interesting is that it tries to use its existing layers better instead of making a big model even bigger. The claim of being comparable to 2T to 3T parameter models is the company's own assessment for now; the picture will sharpen as the model's own scores and independent measurements arrive. Coding Plan users can already try it on a real coding task and see the difference for themselves.
Sources: Z.ai announcement, GLM Coding Plan docs, Coding Plan overview