Model Architecture2026-11-23Updated 2026-11-23

GLM-5.4: When Coding Goes Beyond Code

TL;DRGLM-5.4 is Z.ai's first flagship with Loop Transformer. It runs 28 shared layers twice, increasing computational depth without adding parameters to that block. Z.ai calls its broader approach general Coding: using code for videos, 3D scenes and engineering, not only software. The company reports gains in its 30B experiments with about 10% more training compute. GLM Coding Plan users can try it now; API access and downloadable weights are still pending.

By Cameron Voss and West Mao

For the past three months, Z.ai says it has been scaling Loop and model size aggressively, at the same time. The first result on show is Loop Transformer. It runs a group of shared-weight layers repeatedly, allowing deeper reasoning without adding parameters. The aim is the effective capability of a larger model.

GLM-5.4 is Z.ai's first flagship to use Loop Transformer. The company says it reaches the intelligence level of a 2T to 3T model. It also calls this release the start of general Coding, its term for using code to do work that goes well beyond writing software.

There are still rough edges. The model can slip into what the team calls "thunderous thinking" and spend a long time on a problem. Z.ai says those extended runs can keep improving the answer as the model reflects and corrects itself. That may help on long tasks, but it is not always the fastest way to answer a simple question.

GLM-5.4 is now available to all GLM Coding Plan users, and on coding platforms including ZCode, Trae, WorkBuddy and Qoder. API access will follow the safety review. Z.ai plans to release the model weights responsibly. Coding Plan V2, V3 and Team users receive 1.5 times their previous GLM-5.4 allowance.

What does Z.ai mean by general Coding?

Z.ai has treated coding as a base capability since going all in on it in early 2025. Its earlier work covered agentic engineering, long-horizon tasks and cybersecurity. General Coding applies that idea beyond software development: making videos, building complete games, producing 3D scenes and designing mechanical parts.

The company evaluated GLM-5.4 on 200 real-world programming tasks. It describes GLM-5.4 as the strongest Chinese model for coding feel, particularly in visual coding, visual replication and long tasks. That is Z.ai's assessment of its own evaluation, not an independent test conducted for this article.

GLM-5.4 win rates against GLM-5.3, Kimi K3.1 Pro and DeepSeek-V4.1-Flash-1017
Z.ai's 200-task coding comparison. Against GLM-5.3, GLM-5.4 records 51.1% wins, 25.7% ties and 23.1% losses. Against Kimi K3.1 Pro, the figures are 41.8%, 26.9% and 31.3%. Against DeepSeek-V4.1-Flash-1017, they are 36.6%, 30.2% and 33.2%.

How does Coding scale to video, 3D and engineering?

Scaling Coding to Video

GLM-5.4's self-narrated "Hello world" music video, 2:44. Creator Mike Luan used the model for the concept, music planning, motion and rendering. Every visual is drawn in real time with frontend code, with zero image assets. GLM-5.4 planned the music by chapter and shot, called a third-party music generation model and revised its prompts over several rounds.

Scaling Coding to 3D

A macro birdwatching experience, 0:53. The creator used mathematical geometry and custom GLSL shaders, with no external 3D models or texture files. The long-tailed tit has individually rendered feathers and can breathe, tilt its head and blink.

Scaling Coding to Engineering

A six-axis robotic arm simulation, 0:21. GLM-5.4 built the model in FreeCAD, then used Blender to design the motion, create the visualization and synthesize audio. The arm performs a logo-pickup sequence.

How does Loop Transformer work?

The GLM-5.3 technical blog drew a useful distinction: memory-heavy tasks benefit from more parameters, while reasoning-heavy tasks benefit from more effective computation. Large software projects, cybersecurity, 3D modeling and physical control all involve long causal chains. The model must keep reasoning across many steps without losing track of the whole problem. Adding more parameters alone does not solve that.

A standard Transformer runs each layer once during a forward pass. Loop Transformer runs a group of shared-weight layers for several rounds. Each round starts from the previous hidden state and refines it. The model performs more computation without increasing the parameter count.

Open the full-size Loop Transformer diagram
Loop Transformer architecture: two passes over 28 shared layers, damp gates, shared sparse KV cache, sliding-window KV and reused sparse-attention indices
The published architecture: a prelude, two passes over 28 shared layers, and a coda. The diagram is already in English; select it to inspect the labels at full size.

The idea goes back at least to the Universal Transformer in 2018. More recent work on recurrent depth and recurrent language models found benefits at smaller scales. Weight sharing improves parameter efficiency, but models trained from scratch with shared weights still trailed their non-shared counterparts at the same pretraining compute budget.

Z.ai therefore started with a pretrained GLM-5 base rather than training from scratch. Further training turned it into a Loop Transformer. GLM-5.4 runs 28 of the base model's layers twice. At the 750B scale, three design changes help preserve the quality gains without letting deployment costs grow unchecked.

1. Gated progressive updates

Simply overwriting the hidden state after every pass makes activation norms grow too quickly. Later layers then receive representations whose scale and distribution no longer match what the original model learned.

GLM-5.4 uses a separate token-level gate for each pass. The gate writes only a fraction of the candidate change back into the residual stream. After training, the two passes take on different jobs. Pass one builds a global context state and writes cautiously at most positions. Pass two reuses that state, opens the gate and writes more of the refined result.

The gate also adjusts the step size according to token difficulty. Harder positions get a larger first-pass write, so they receive more benefit from the extra computation.

2. Shared global KV cache with an independent sliding window

A naive loop keeps a complete KV cache for every pass, multiplying memory use by the number of rounds. GLM-5.4 shares the sparse KV selected in pass one, while pass two adds only the KV it generates inside a sliding window.

The two KV paths can cover the same position. The model reads the contextual representation from pass one and the updated local representation from pass two. The extra memory cost is one window of KV rather than another full-context cache. Z.ai says this limits the deployment cost increase over GLM-5.3 at a 1M context length.

3. Reused sparse-attention indices

GLM-5.4's base uses sparse attention. The second pass reuses the indices generated by the first pass's indexer, so it incurs no additional indexer cost. Z.ai reports that this performs almost as well as recomputing the indices for every pass.

What do the scaling experiments show?

Before betting a flagship on Loop, Z.ai tested it on 1B, 4B, 30B and 750B bases. In the controlled 30B comparison, the Loop model and its baseline used the same architecture and parameter count. The Loop version used about 10% more total training compute.

The results below come from that 30B model after 200K long-text supervised fine-tuning, with thinking enabled during evaluation. The scores are published by Z.ai.

Original 30B Loop benchmark table, comparing the baseline and Loop versions across five tasks
The original Chinese benchmark table. The complete English transcription follows.
30B Loop experiment: Z.ai's published scores and average output-length changes
BenchmarkBaseline+ LoopImprovementAverage length change
AIME2519.1730.4211.3-635 tokens (-2%)
GPQA-Diamond47.5856.268.7-2,473 tokens (-11.7%)
AA-LCR40.3347.677.3-539 tokens (-9.7%)
MMLU-Pro71.6575.053.4-863 tokens (-14.9%)
IFBench50.2053.473.3-763 tokens (-13.0%)

The largest gains are in math reasoning, long-context work and code, the capabilities that general Coding relies on. Z.ai's results suggest that longer reasoning chains benefit more from the extra computational depth.

Loop also changes how much the model writes while it thinks. On GPQA and MMLU-Pro, average output length falls by roughly 10% to 14%, mostly through shorter chains of thought. Z.ai interprets this as part of the reasoning moving from the token stream into the loop's extra computational depth.

This is an early version of the approach. The team still wants adaptive computation that gives harder tokens more work. It also remains to be seen how the returns change as the number of rounds and model scale increase.

How fast is it, and where can you use it?

Z.ai says GLM-5.4 can reach 200 tokens per second during off-peak periods and maintain 70 to 80 tokens per second at peak times. Sustaining those speeds with multiple rounds of computation required changes to both the model and its inference infrastructure.

At the architecture level, splitting the KV cache by distance keeps the second pass from adding much memory. Reusing sparse-attention indices avoids another indexing pass. At the kernel level, fused operators reduce repeated reads and writes of intermediate results in memory.

GLM-5.4 is available through ZCode and GLM Coding Plan. API access is listed as coming after the safety review. Z.ai also lists Z.ai, Zhipu Qingyan and AutoClaw as its own products.

The partner launch includes WorkBuddy, Doubao Work, Trae, Qwen Office, Qoder, CatPaw, MaDao, Baidu Dazi Enterprise, AiWork, TJ Codely and OpenCode. These are the distribution channels named by Z.ai.

Z.ai ends with a teaser for a bigger model. It is pursuing greater computational depth and greater model size together. GLM-5.4 tests the first path. The company says its next model will be significantly larger and will carry forward what the team learned here.

Frequently asked

What is Loop Transformer in GLM-5.4?

Loop Transformer runs 28 shared-weight layers twice, adding computational depth without increasing the parameter count of that block. GLM-5.4 combines gated progressive updates, a shared sparse KV cache with a local sliding window, and reused sparse-attention indices.

What does Z.ai mean by general Coding?

General Coding is Z.ai's term for using code beyond conventional software development. Its GLM-5.4 demonstrations cover video production, complete games, interactive 3D scenes and mechanical design.

Is the GLM-5.4 API or model checkpoint available now?

At the November 23, 2026 announcement, GLM-5.4 was available to GLM Coding Plan users and on listed coding platforms. Z.ai says API access will follow a safety review and that it plans to release the model weights responsibly.

How fast is GLM-5.4?

Z.ai says GLM-5.4 can reach 200 tokens per second during off-peak periods and maintain 70 to 80 tokens per second at peak times. These are the company's reported serving speeds, not measurements conducted for this article.