Z.ai says GLM-5.4 runs 28 layers twice per token for more depth

A transformer language model normally sends each token through its stack of layers once. Z.ai says its new flagship GLM-5.4 sends every token through a block of 28 layers twice, reusing the same weights on the second pass. The model gets more computation per token without a single extra parameter.

The surprise is how Z.ai got there. Looped models trained from scratch, the company writes, "still lag behind unshared models under the same pre-training compute budget". So it did not start from scratch: it took its already trained 750B-parameter GLM-5 base model and turned its middle layers into a loop by continuing the training. Z.ai claims the result reaches "intelligence levels comparable to 2T-3T parameter models". That is its own claim; the page publishes no benchmark table for the 750B model, and no independent evaluation has appeared yet.

In short

28 layers of the 750B base that run twice per token; ~10% extra training compute in Z.ai's 30B looped test; 10–14% shorter answers on most benchmarks in that test; 128 tokens the only new KV cache the second pass keeps

How does GLM-5.4 run layers twice?

Z.ai's architecture diagram splits the model into three parts. By our count from it, that is 78 stored layers:

So each token passes through 26 + 2 × 28 + 24 = 106 layers' worth of computation (our arithmetic) from 78 layers of weights. The idea itself is old, as Z.ai notes, citing the 2018 Universal Transformer, which shared weights across depth. More recently, Thinking Machines Lab's Inkling 2 Mini, released on 20 November, runs its middle 12 layers three times. GLM-5.4 applies the idea to a far larger model, and does it by adapting one that already exists.

Z.ai says turning a trained model into a loop needed three changes.

The 30B test

Before committing the flagship, Z.ai says it tried the loop on 1B, 4B, 30B and 750B base models. Its controlled comparison used the 30B model: same parameter count, about 10% more total training compute for the looped version, evaluated after long-context fine-tuning with thinking mode on.

Source: Z.ai's ablation table on the GLM-5.4 page.

The largest gains came in maths, scientific reasoning and long-context tasks. Z.ai reads the shorter outputs as "part of the reasoning shifts from explicit output tokens into the implicit depth of the loop". The cut was smallest on AIME25, at 2%, so the 10–14% figure covers most benchmarks, not all.

These are Z.ai's own numbers, on a 30B test model, not on GLM-5.4 itself. The page also shows a chart of GLM-5.4's win rate against GLM-5.3 (51.1% wins, 25.7% ties, 23.1% losses) and two rival models, but does not say what tasks were judged or by whom.

Speed

Looping means more computation per token, which could slow generation. Z.ai says GLM-5.4 reaches up to 200 tokens per second off-peak and holds 70–80 tokens per second at peak load. Besides the cache and index savings, it says it fused core GPU kernels to cut the memory reads and writes that looping multiplies.

Terms in plain English

Where things stand

The page says the Model API will open after a security assessment. Z.ai calls GLM-5.4 its "first step with looped architectures" and lists open questions: how to give harder tokens more passes automatically, and how the gains from looping change as loop count and model size grow. It says its next, "significantly larger" model will carry these lessons forward.

Sources

Sources

Related stories

More from Teach the Bot

All stories from Teach the Bot