Prompt Picked

ChatGPT, Claude & Gemini

Loop transformers explained: Z.ai's 750B model runs 28 layers twice

A loop transformer runs a block of its layers twice instead of adding parameters. Z.ai's GLM-5.4 is the biggest public example, and the claim behind it is unverified.

7 min read
T
Theo Lang

Editor, Prompt Picked

How we research

a bunch of wires that are connected to a server

A loop transformer is a language model that sends data through some of its layers more than once before producing an answer, reusing the same weights each time. Z.ai's new GLM-5.4 is the most concrete public example: 750 billion parameters, with a block of 28 layers that runs twice. Z.ai says the result performs like a model with 2 to 3 trillion parameters. No benchmark scores were published alongside that claim.

The appeal is arithmetic. Weights have to be stored, moved and served, and a 750B model is far cheaper to run than a 3T one if the quality holds up. Repeating a shared block gets you extra depth without a bigger checkpoint. Z.ai is following OpenAI, which the same report says has used a loop architecture since GPT-6 Astra.

How a loop transformer differs from a standard one

In a standard transformer, each layer processes the token stream once and hands it to the next. Depth equals layer count. Want more capability, and you stack more layers and train more parameters, which is how flagship models reached the trillions. GLM-5.4 keeps the full stack but routes data through a middle section twice, so the effective depth is larger than the number of distinct layers.

Nothing new is learned on the second pass. The same weights get a second look at the same problem, with a better input than they had the first time. That is the whole trick: refinement instead of scale.

What GLM-5.4 loops

GLM-5.4 runs layers 27 through 54 twice, which is the 28-layer block the announcement describes. Z.ai says the two passes behave differently. The first builds context cautiously and steps in more strongly on difficult tokens. The second writes its changes back in full. The split matters because the second pass reads a state the first pass produced, so any distortion carries forward into everything after it.

The gates that keep the second pass stable

Running a block twice creates a specific failure mode. If the second pass simply overwrites the intermediate state, activations grow from round to round, and later layers receive values outside the range they saw in training. Z.ai handles this with a gate for each token and each pass, which sets how much of the new output flows back into the data stream. Every token gets its own scaling decision at every pass, so the model can decide how much revision each position needs.

Memory: why both passes share the KV cache

A second trip through half the network would normally double the KV cache, the working memory that holds previously processed tokens so the model can attend to them. Both passes in GLM-5.4 share one cache. The second pass keeps only its extra values in a small local window, which stops memory use from scaling with the number of passes. Z.ai compares the resulting overhead with its previous model, GLM-5.3.

The catch: GLM-5.4 is a retrofit

Z.ai states that loop models trained from scratch have performed worse than models without shared weights under the same compute budget. That explains the method here. GLM-5, released in February, was retrained into a loop model. It did not start life as one.

Retraining is the pragmatic path, and it caps what the result proves. Looping works as a conversion on a base model that already trained well. It hasn't yet shown that a loop model wins when both approaches start from zero on equal compute. Anyone quoting GLM-5.4 as evidence that loop architectures are the future is quoting a conversion, not a controlled comparison.

What the 750B figure is worth

The number to hold onto is the comparison. 750 billion parameters is a big model; Z.ai says it matches models with 2 to 3 trillion, which would mean a quarter to a third of the weights for the same quality. OpenAI made a similar pitch for GPT-6.1 Sol, Astra-level coding at a fifth the price, and the logic is the same: better results per dollar of inference. No published evaluation backs Z.ai's ratio yet, so it stays a company claim until someone independent runs the tests.

Does looping make a model cheaper to run?

Fewer weights means less memory to hold and less bandwidth to move them around. Two passes means more arithmetic per token. Which effect dominates depends on the hardware, the batch size and how well the kernels are written, so a 750B loop model is not automatically cheaper to serve than a dense model of similar quality. The savings show up in storage and memory first, and in compute only if the repeated block is cheaper than the parameters it replaces.

I read the loop design as a supply-side move. Cheaper inference for the provider is what makes a lower sticker price possible later. It doesn't change what you should pay this month, which still comes down to price per million tokens, rate limits and whether the outputs are good enough to use.

What "generalized coding" actually describes

Z.ai frames GLM-5.4 as the start of "Generalized Coding," where code also generates videos, games and CAD models. That is positioning. The source material gives no demo, benchmark or API detail behind it, and producing a CAD model is a claim about output formats that needs a sample file before it means anything. Until there is a model card, treat it as a category the company wants to own rather than a capability you can plan around.

What to watch

Two things would move this from announcement to useful. Does the quality hold after fine-tuning and quantization, which change the weights the loops reuse? And does the 2 to 3 trillion comparison survive an evaluation Z.ai didn't run? If both hold, expect more labs to bolt shared blocks onto checkpoints they already have, because that route costs less than training from scratch. If neither holds, loop transformers stay an architecture note, and choosing an assistant goes back to the usual questions: price, limits, and whether the output is something you'd ship.

Frequently asked questions

What is a loop transformer model in plain words?
A model that runs part of its network more than once before answering. The weights stay the same between passes; the intermediate result gets refined. It's a way to get depth without adding parameters.
Does a loop transformer have more parameters?
No. It has the same weight count as the model it was built from. The extra work happens in repeated passes through a shared block. In GLM-5.4 that block is 28 layers run twice, so compute per token rises while checkpoint size stays put.
Is GLM-5.4 as good as a 3 trillion parameter model?
Z.ai says it performs comparably to models with 2 to 3 trillion parameters. No benchmark scores were published with the claim, so it is unverified. Independent tests on coding and reasoning would settle it.
Why not just train a loop model from scratch?
Z.ai says loop models trained that way have done worse than models without shared weights on the same compute budget. Retraining an existing checkpoint sidesteps that risk, though it ties the design to a base model built without loops.
Will loop transformers make AI cheaper for me?
Maybe, eventually. Fewer weights per unit of quality makes serving cheaper for the provider. Your bill depends on the price per token and the plan limits they set. No pricing for GLM-5.4 appears in the source material.

Sources

More tools worth a look