All Today

🔁 GLM-5.4 from Z.ai: first flagship model built as a loop transformer, aimed at coding

· 4 min

In brief


🔁 Z.ai has released GLM-5.4, by its own account its first flagship model built on a loop transformer. In this design a group of layers with shared weights runs several times in a row, each pass refining the hidden state of the previous one, so the network gets deeper without more parameters. 💻 GLM-5.4 is aimed at coding, which the maker calls “Generalized Coding”: code as the base for tasks beyond classic software. According to Z.ai it is available through the GLM Coding Plan, the ZCode development environment and Z.ai Chat. Simon Willison reports that he could call the model with the key from his Coding Plan subscription through Z.ai's OpenAI-compatible Responses API; it cannot currently be reached through the regular API. 🔓 There are no open weights. Z.ai says it will publish them after “necessary safety hardening”. Anyone who has to run the model themselves or needs a standard pay-as-you-go API will have to wait.


🧱 **How the model is built.** According to a summary by developer jamilxt on DEV Community, based on the launch post by [Z.ai](https://z.ai/blog/glm-5.4), GLM-5.4 has 78 layers in total. Layers 1 to 26 run once, the 28 layers 27 to 54 run twice with the same weights, and layers 55 to 78 run once more. That makes 106 layer passes per token from 78 stored layers. Z.ai puts the scale at “750B”, roughly 750 billion parameters. The input is text plus features from a vision encoder with 24 layers.

🔄 **Converted, not trained from scratch.** Z.ai did not train the model as a loop model from the start. In its words, looped models trained from scratch still lag behind normal models at the same pre-training budget. Instead the finished GLM-5 base model was turned into a loop model through continued training. Three changes are meant to make that work: a per-token gate after each pass limits how much a pass overwrites the state, so activations do not grow from pass to pass; a hybrid KV cache lets the second pass share the first pass's cache for the long context and keep only a small own cache for the last 128 tokens; and the choice of tokens for sparse attention is computed in the first pass only and reused in the second.

🧪 **The numbers Z.ai gives.** The approach is backed by a test on a 30-billion-parameter model with the same architecture: the looped version used about 10% more training compute and scored 3.3 to 11.3 points higher on every benchmark shown, most on maths (AIME25), science (GPQA-Diamond) and long-context reasoning (AA-LCR). Average output length while thinking fell by 10 to 14% on most benchmarks. For the flagship itself the post, according to that summary, gives no benchmark scores, so the statement that its intelligence is comparable to models of 2 to 3 trillion parameters remains the maker's claim. On speed Z.ai names up to 200 tokens per second off-peak and 70 to 80 at peak load, with no detail on hardware or context length.

⚠️ **Limits Z.ai names itself.** The model tends to get caught in very long “marathon” thinking loops; Z.ai says this extra reflection improves accuracy, but it costs time and, when billed per token, money. The demonstrations in the post, among them a music video, a robotic arm modelled in FreeCAD, a complete game and a 3D scene written in GLSL, show what the model can produce, not how often it succeeds.

🛠️ **Getting at it in practice.** Simon Willison signed up for the Coding Plan subscription because the regular API does not offer the model yet; the key then worked against the Responses API at api.z.ai. He wrote a plugin for his command-line tool LLM, since the existing llm-zai plugin does not know the new model yet. He describes his pelican-on-a-bicycle test images from GLM-5.3 and 5.4 as similar in quality.

🧭 **Context.** A week earlier, on 20 November, Thinking Machines Lab had presented another loop model, Inkling 2 Mini, which runs its middle layers three times per token. For readers: anyone looking for coding help through a subscription or an IDE integration can try GLM-5.4 now; anyone who needs open weights, self-hosting or independently confirmed comparison figures has no basis for that yet.

Sources

Open in the interactive reader →

This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources. Imprint, privacy policy and terms of service