Z.ai Runs 28 Layers of GLM-5 Twice to Build GLM-5.4, a Looped Flagship That Ships to Coding Subscribers Before Its API and Weights

Z.ai introduced GLM-5.4 on November 23, 2026, its first flagship built on a Loop Transformer, in which a shared block of 28 layers from the GLM-5 base runs for two passes at the 750B scale. The model is live for GLM Coding Plan users, ZCode and Z.ai Chat with a 1M-token context, while pay-per-token API access and open weights wait on safety work.

A glowing spiral staircase climbs through the same stack of floors twice inside a glass tower.
A glowing spiral staircase climbs through the same stack of floors twice inside a glass tower.

Most labs make a model smarter by making it bigger. Z.ai’s new flagship takes another route: it reuses the same layers twice. GLM-5.4, introduced on November 23, 2026, is the company’s first large model built on a Loop Transformer, and the company says the extra depth lets a 750B-scale model perform like one with two to three trillion parameters.

The model is available now to subscribers of the GLM Coding Plan, in the ZCode coding app and in Z.ai Chat. Pay-per-token API access is listed as “coming soon,” and Z.ai says it plans to open-source the weights “responsibly after completing necessary safety hardening,” without giving a date for either.

Reusing depth instead of adding parameters

In a standard Transformer, each layer runs once per forward pass. In a Loop Transformer, a group of weight-shared layers runs several times, refining the hidden states produced by the previous pass. The network gets deeper without getting larger.

Z.ai acknowledges the idea is old. The 2018 Universal Transformer proposed weight-shared depth, and later work on recurrent and looped language models showed gains at small scale. The catch, the company writes, is that looped models trained from scratch still trail ordinary models given the same pre-training compute. So instead of starting over, Z.ai took its already pre-trained GLM-5 base and converted it through continued training. GLM-5.4 loops 28 of that base model’s layers for two iterations.

The company’s argument for the approach is that memory-heavy tasks benefit from more parameters, while long reasoning chains, such as large software projects, cybersecurity, 3D modeling and physical control, benefit more from extra compute per token.

Three changes to keep two passes affordable

Looping a 750B model naively would be expensive and unstable, and Z.ai describes three fixes. First, gated progressive updates: rather than overwriting hidden states each pass, which made activation norms blow up, each iteration has per-token gates that control how much of its update is written back. Z.ai says the gates learned a division of labor, with the first pass writing conservatively to build context and the second pass writing full updates, and with harder tokens getting more aggressive first-pass writes.

Second, a hybrid KV cache. Keeping a full cache for every loop would multiply memory use. GLM-5.4’s second pass reuses the sparse cache selected in the first pass and keeps only a sliding window of its own new entries, so an extra loop costs one window of cache rather than a full context. Z.ai says this keeps the deployment cost increase over GLM-5.3 under control at 1M-token context. Third, the second pass reuses the attention indices produced by the first pass’s sparse-attention indexer, adding no indexing overhead with results nearly identical to recomputing them.

Evidence from smaller models

Z.ai says it validated the architecture on 1B, 4B, 30B and 750B base models before committing its flagship. In a controlled comparison on a 30B model with identical parameter counts and about 10% more total training compute, the looped version showed its biggest gains in math, scientific reasoning and long-context tasks. On most benchmarks, including GPQA-Diamond and MMLU-Pro, average output length fell by 10% to 14%, mostly from shorter chains of thought, which the company reads as reasoning moving from visible tokens into the loop’s hidden depth.

These are Z.ai’s own internal results, and the “2T-3T” comparison is the company’s characterization rather than an independent measurement. Its Chinese documentation adds that, on an internal evaluation of 200 real-world programming scenarios, GLM-5.4 ranked near the top of domestic models, standing out in visual coding and long-horizon tasks.

From code to games, CAD and video

Z.ai calls the new direction “Generalized Coding,” using code as the route to tasks beyond software. Its demos include a self-narrated music video, a six-axis robotic arm modeled in FreeCAD, a complete game with physics and combat, and an interactive 3D bird-watching scene drawn with custom GLSL shaders.

Z.ai also lists a known weakness: the model tends to get stuck in overly long “marathon thinking” loops, although Z.ai says the extra self-correction consistently improves accuracy.

How to use it now

GLM-5.4 supports a 1M-token context, according to Z.ai’s documentation. It has been opened to all GLM Coding Plan users, and subscribers with weekly limits get 1.5 times the usage allowance they had with GLM-5.3. Z.ai reports speeds of up to 200 tokens per second off-peak and 70 to 80 tokens per second at peak load, which it attributes to fused kernels alongside the cache and index designs.

Z.ai says its next, significantly larger model will build on what it learned from GLM-5.4 and “will be ready soon.”

Topics
  • #GLM-5.4
  • #Z.ai
  • #Loop Transformer
  • #Coding Models
  • #LLM Architecture
Raj M

Author

Raj M

Contributor

AI Systems Architect is a seasoned technology leader with over 15 years of experience in the IT industry working with Fortune 500 companies. With a solid foundation in multi-agent systems, open-source LLM infrastructure, and enterprise deployment, he excels at building scalable production-grade AI platforms.