Blog / news

Z.ai's GLM-5.4 Loop Transformer Runs 28 Layers Twice

, 6 min read

GLM-5.4: Toward Generalized Coding with Our First Loop Transformer
Photo: z.ai

Z.ai released GLM-5.4 on November 23, 2026, its first flagship model built on a Loop Transformer. The 750-billion-parameter model runs 28 layers twice, and Z.ai says it reaches intelligence levels comparable to models with 2 trillion to 3 trillion parameters. The pitch behind the GLM-5.4 loop transformer is simple: more depth and more compute per token without adding parameters.

What happened

Z.ai published the GLM-5.4 research post on November 23, 2026. The model is a 750B-parameter flagship, and it loops 28 layers of the GLM-5 base model for two iterations. The Decoder reports that the looped block covers layers 27 through 54.

Instead of training a looped model from scratch, Z.ai adapted an already pre-trained base model through continued training. The company says this raises the intelligence ceiling with a relatively small compute overhead. It also avoids the known problem that looped models trained from scratch lag behind unshared models under the same pre-training compute budget.

Z.ai made three architectural changes to keep the second pass from blowing up memory or compute:

  • Gated progressive updates. Each token gets gates for each iteration, so the model controls how much of the new candidate update is written back into the residual stream. After training, the first pass writes conservatively with small gate values, and the second pass opens the gates for full updates. Harder tokens get more aggressive first-pass writes.
  • Hybrid KV cache. The second pass reuses the sparse KV cache selected in the first pass and stores its own new KV only in a local sliding window. Z.ai says overhead compared with GLM-5.3 stays manageable even at a 1-million-token context.
  • Sparse attention index reuse. The second loop reuses the attention indices from the first loop's indexer. Z.ai's experiments found this performs nearly identically to recomputing indices on every pass.

GLM-5.4 also adds vision, according to VentureBeat. Z.ai frames the release as the start of Generalized Coding, where code is used for mechanical design, 3D modeling, video generation, games and CAD models, not only software.

GLM-5.4 is available now through Z.ai's GLM Coding Plan, ZCode and Z.ai Chat. API access is listed as coming soon. Z.ai says open weights will follow after safety hardening, but it gave no date. Z.ai quotes speeds of up to 200 tokens per second off-peak and 70 to 80 tokens per second under load.

How the GLM-5.4 loop transformer works

Standard Transformer layers run once per forward pass. A Loop Transformer sends hidden states through a shared block of layers more than once, refining the result on each pass. That makes the network deeper without increasing the parameter count.

The idea is not new. The 2018 Universal Transformer proposed weight-shared depth, and recent work on recurrent depth and looped language models has shown gains at small scales. Z.ai says the hard part is that looped models trained from scratch still trail unshared models at the same pre-training compute. Its fix was to start with a pre-trained GLM-5 base, released in February, and continue training it as a loop model.

Z.ai previously released GLM-5.3 in August with advanced cyber capabilities. VentureBeat reported that Thinking Machines Lab used a looped transformer in Inkling 2 Mini, which it said was released the week before. The Decoder reports that OpenAI has used a similar architecture since GPT-6 Astra. So GLM-5.4 is part of a small group of loop-based flagship models, not a one-off experiment.

Why it matters

The obvious appeal is cost. If a 750B model can do work that normally needs 2T to 3T parameters, teams could serve the same tasks with fewer parameters and less memory. That is a big if: Z.ai's main controlled evidence comes from a 30B test model, not the full 750B flagship.

On that 30B test, the looped version used about 10% more training compute than a non-looped baseline of the same size. It scored 30.4 on AIME25, up from 19.2; 56.3 on GPQA-Diamond, up from 47.6; and 47.7 on AA-LCR, up from 40.3. The gain on MMLU-Pro was just over three points. Those are real numbers, but they describe a 30B test model, not the 750B model Z.ai is offering.

Z.ai also published a win-rate chart comparing GLM-5.4 with three other models, but VentureBeat reports that it did not explain the evaluation methodology. The company says GLM-5.4 reaches 2T-3T performance but does not explain how it arrived at that comparison. Independent benchmarks for the 750B model are the missing piece.

Early testers told VentureBeat that the looped model is slow but useful for hunting bugs and security flaws. That fits Z.ai's pitch: ultra-long-chain reasoning tasks such as large-scale software engineering and cybersecurity. If you run a coding assistant or a security review bot, a model that can spend more compute per token could catch mistakes that a faster model misses. The same loops can also waste time, which is why the marathon thinking problem matters.

Z.ai calls the model's tendency to get caught in overly long 'marathon thinking' loops its most notable limitation. It also says the prolonged reflection and self-correction consistently improves accuracy beyond its parameter count. Both things can be true: the model can be more accurate and still annoyingly slow.

Access is another limit. GLM-5.4 is available through Z.ai's own products, but API access is coming soon and open weights have no date. Developers who want to test the loop architecture on their own hardware cannot do that yet. Teams that want a drop-in API also have to wait.

What comes next

The next milestone is API access. Z.ai lists it as coming soon, without a date. Open weights are promised after safety hardening, also without a date. Until those ship, most developers will meet GLM-5.4 through Z.ai Chat, ZCode or the GLM Coding Plan.

Three questions are open. First, can independent testers reproduce the 2T-3T comparison on the full 750B model? Z.ai's controlled benchmark is the 30B test, and the win-rate chart lacks a methodology. Second, how bad are the marathon thinking loops in production? Z.ai says they improve accuracy, but early testers already describe the model as slow. Third, what will API pricing and rate limits look like? The sources published so far do not say.

Z.ai also has to show that Generalized Coding works outside demos. The company says code can generate videos, games and CAD models. Those claims still need independent tests. For now, the safe read is that GLM-5.4 is a serious architectural bet with promising 30B evidence and a lot left to prove at flagship scale.

Sources