Z.ai is moving its flagship GLM-5.4 model to a loop architecture in which 28 layers run twice, which the company says lets the 750-billion-parameter model match models with 2 to 3 trillion parameters. Benchmark scores are only available for a smaller 30B test model so far, and Z.ai is positioning GLM-5.4 as the start of "Generalized Coding," where code also generates videos, games, and CAD models. The article Z.ai follows OpenAI into loop transformer territory with its new 750B flagship model ap
Z.ai is moving its flagship model to a loop architecture that runs some of its layers twice. With GLM-5.4, the company wants to mark the start of "Generalized Coding," where code also generates videos, games, and CAD models.
Following OpenAI, Z.ai is introducing GLM-5.4, its first large model built on a loop transformer. While standard language models use each layer once per pass, GLM-5.4 runs a block of shared layers multiple times, refining the intermediate results from the previous pass to make the network deeper without adding parameters. OpenAI has used a similar architecture since GPT-6 Astra . According to Z.ai, the 750-billion-parameter model reaches performance comparable to models with 2 to 3 trillion parameters.
The team retrained the GLM-5 base model released in February into a loop model that runs 28 layers twice. Loop models trained from scratch have so far performed worse than models without shared weights under the same compute budget, Z.ai writes .
Converting the model introduces a problem, Z.ai says. If the model simply overwrites intermediate states on each pass, activations grow sharply from round to round, leaving subsequent layers with values outside the range they were trained on.
To handle this, GLM-5.4 uses dedicated gates for each token and pass to control how much of the new output flows back into the data stream. According to Z.ai, the model builds context cautiously on the first pass and writes its changes back in full on the second. On difficult tokens, Z.ai says, the first pass steps in more strongly.
Because the second pass would otherwise double memory usage, both passes share the KV cache, the temporary memory for previously processed tokens. The second pass stores its own extra values only in a small local window. As a result, Z.ai says, the overhead compared to GLM-5.3 stays manageable even at a 1-million-token context.
To save on compute as well, the model uses sparse attention to pick the most relevant earlier tokens upfront rather than scanning the entire context every time, a standard technique. The second pass then reuses that selection from the first instead of making a new one. According to Z.ai, that yields nearly the same results as picking tokens separately on each pass. The company also says the model reaches up to 200 tokens per second off-peak and 70 to 80 tokens per second under load.
Before rolling out the architecture in its flagship, Z.ai tested it on models with 1, 4, 30, and 750 billion parameters. For a direct comparison, the team used a 30B model built on the same architecture as the large base model. Both versions had the same parameter count, while the loop version received about 10 percent more training compute. Its biggest gain came on the AIME25 math benchmark, where scores jumped from 19.2 to 30.4 points. Scores on the expert-level science questions in GPQA-Diamond rose from 47.6 to 56.3 points, and on the AA-LCR long-context test they climbed from 40.3 to 47.7 points. Gains were smaller at just over three points on the MMLU-Pro knowledge test and on IFBench, which tests instruction following.
The Decoder
Original Reporting Source
Explore features, ratings, and alternatives from our 19,000+ AI tools catalog.

OpenAI's flagship conversational AI platform featuring GPT-4o, advanced voice mode, web browsing, DALL-E 3 image generation, and custom GPTs.