[KongchangAI]
· 4 min read· 2,052 words

GLM-5.4 Loop Architecture Revealed: How a 750B-Parameter Model Takes On 3T Models

GLM-5.4 Loop Architecture Revealed: How a 750B-Parameter Model Takes On 3T Models

GLM-5.4 uses a 750B base with two loop rounds to achieve 106 layer applications, trading depth for a higher intelligence ceiling.

GLM-5.4 is the first flagship model built on the Loop Transformer architecture. Its 750B base runs layers 27-54, a total of 28 layers, for two rounds in one forward pass, so 78 distinct layers achieve 106 layer applications, and the company claims intelligence comparable to 2T-3T parameter models. To run loops stably at flagship scale, the document discloses three engineering changes: per-token gated progressive write-back to control activation norms, hybrid KV Cache using cross-round sharing plus a sliding window to compress memory, and sparse attention index reuse to reduce second-round indexing overhead to zero. The 30B controlled experiment shows the loop version costs only about 10% more training compute, improves all five benchmarks, and benefits tasks with longer reasoning chains more clearly. Head-to-head win rates are mixed against DeepSeek and Kimi, with a 51.1% win rate against the previous generation GLM-5.3.

Introduction: Loop Transformer Lands in a Flagship Model for the First Time

Z.AI's GLM-5.4 model documentation has recently been released. Although the official blog has yet to publish a complete technical report, this document already sketches out a key turning point: GLM-5.4 is the first flagship model built on the Loop Transformer architecture. Its core idea is not complicated—reuse a middle segment of layers from the GLM-5 base, let the same set of weights run two rounds in a single forward pass, and trade the extra depth from looping for a higher intelligence ceiling. The company claims its intelligence level is comparable to 2T-3T parameter models, while the base model has 750B parameters.

What does this design mean? Beyond the large-model parameter race, another path—"fewer parameters, more compute"—is being taken seriously by leading vendors.

Breaking Down the Loop Architecture: How 78 Layers Achieve 106 Layer Applications

Input embedding at the bottom

According to the structure diagram in the document, GLM-5.4 is divided into three segments overall:

Prelude (layers 1-26) is responsible for organizing the input into the hidden state for the first round. In addition to text embeddings, it also incorporates a projected 24-layer visual feature stream, indicating that multimodal capability is woven directly into the base architecture rather than attached as an external module. The first two layers of this segment each carry an indexer, and subsequent layers reuse the already-selected TopK indices.

Loop segment (layers 27-54, 28 layers in total) is the core of the entire design. The same set of weights runs two rounds in one forward pass: the first round establishes a global context state (denoted X1), and the second round continues refining from X1. At the exit, a gate mixes the newly computed hidden state with X1 from the first round in proportion to produce X2.

Tail segment (layers 55-78, 24 layers in total) is responsible for the final output.

Therefore, the model has 78 distinct layers, but the number of layer applications reaches 106 (26+28+28+24). The two rounds are connected via a "Player Cache": it caches the KV prefix variables and TopK indices from the first round of each layer, and the second round uses them directly without recomputation. In the attention block, one KV path in the second round uses the sparse KV left by the first round, while the other path uses the newly generated local window KV from the second round.

Sparse attention and TopK indices are prerequisites for understanding the loop segment design in this article. In standard attention, every token must compute relevance against all historical tokens in the sequence, and the longer the sequence, the greater the computation. Sparse attention keeps only the TopK most relevant tokens for computation and ignores the rest. Which K tokens to select is determined by a lightweight "indexer"—it first quickly evaluates the match between each token and the current query, outputs TopK indices, and the main attention then processes only that portion of KV accordingly. GLM-5.4 places one indexer in each of the first two Prelude layers, and subsequent layers directly reuse the indexing results. This exploits the fact that indices are highly stable across adjacent layers, eliminating repeated filtering overhead.

KV Cache is the core mechanism of autoregressive inference: each time a new token is generated, the Key and Value of all previous tokens are needed. Recomputing them every time would make cost grow quadratically with length, so historical KV is cached for reuse in subsequent steps. The trouble with loop architectures is that the same set of layers runs two rounds, and each round produces its own KV. If cached independently per round, memory grows linearly with the number of rounds. Hybrid KV Cache shares the sparse KV from the first round across rounds and places the newly generated KV from the second round into an in-place sliding window. This is equivalent to replacing a full copy with a combination of "shared old KV + local new KV," which is the key to making million-token context affordable.

Three Engineering Changes: Making Looping Feasible at 750B Scale

Difficult tokens are written more aggressively in the first round

Loop architecture is not a new concept; the hard part is controlling cost and stability at flagship scale. The document discloses three key engineering changes:

Gated progressive write-back is the most core one. Directly overwriting the residual stream with the candidate state causes the activation norm to amplify with each round, and the representations received by subsequent layers deviate from the expected range. GLM-5.4's approach is to add a set of per-token independently computed gates for each round, so that candidate updates are written back proportionally. After training, these gates spontaneously develop a division of labor: the first round mainly establishes global context, with smaller gate values and conservative writing; the second round reuses the state for refinement, with gates opening wider and full updates written back. The gates also adjust according to token difficulty—difficult tokens are written more aggressively in the first round.

Hybrid KV Cache solves the memory problem. The most straightforward approach is to keep a complete KV copy for each round, causing memory to grow multiplicatively with rounds. GLM-5.4 changes this to cross-round sharing plus an independent sliding window: the second round reuses the sparse KV from the first round while keeping its newly generated KV in the sliding window. In this way, one additional loop adds only one sliding-window combination rather than an entire context cache, significantly reducing cost at million-token context lengths.

Sparse attention index reuse further cuts overhead: the second round no longer recomputes indices and directly uses the results from the first-round indexer, reducing this step's overhead to zero. The document claims that measured performance is almost identical to recomputing each round.

Residual streams and activation norms are the background for understanding the gating design. Modern Transformers widely use residual connections: each layer's output does not replace the input but is added to it, forming a "residual stream" that runs through the entire model. The benefit is that gradients can flow back smoothly, but the cost is that each write-back increases the magnitude (norm) of activations in the residual stream. The more layers, the more easily the norm can get out of control; the loop architecture makes the same set of layers write back twice, equivalent to stacking another amplification effect on top of normal depth. If overwritten directly, the representations received by subsequent layers deviate from the training distribution, making convergence difficult. Per-token independently computed gating essentially adds a learnable scaling coefficient to each write-back, allowing updates to be integrated proportionally rather than hard-replaced, thereby keeping the norm within the expected range. After training, gate values spontaneously show a division of labor of "conservative in the first round, aggressive in the second," indicating that the model has learned how to allocate write-back strength between the two rounds.

Small-Model Validation: What the 30B Controlled Experiment Shows

Before pushing the loop structure to flagship scale, the company validated it progressively on 1B, 4B, 30B, and 750B. The 30B controlled experiment given in the document is worth a closer look: the control group has exactly the same architecture as the 750B base and the same parameter count, and the loop version costs only about 10% more total training compute.

All five benchmark scores improved: AIME25 rose from 19.17 to 30.42, an increase of 11.3 points; GPQA Diamond improved by 8.7 points; ALCR, MMLU Pro, and IF Bench also rose, covering mathematics, scientific reasoning, long context, general knowledge, and instruction following. At the same time, output length generally shortened, with most tasks reduced by around 10%, the largest by nearly 15%, and AIME25 down only 2%.

The document's conclusion is: tasks with longer reasoning chains benefit more clearly. Mathematics, science, reasoning, and long context show the largest gains. This suggests that the extra compute brought by loop depth is more likely to translate into effective thinking in scenarios requiring multi-step reasoning.

Scaling experiments (Scaling Law validation) are a mainstream practice before pushing such architectural changes to flagship scale: first run controlled experiments at small scales such as 1B, 4B, and 30B to confirm that architectural gains do not diminish with scale and may even amplify, then invest flagship-level compute. The key here is controlling variables—the 30B control group and the loop version have exactly the same parameter count, and the only difference is whether the 28 layers run two rounds, so score improvements can be attributed to loop depth rather than more parameters. About 10% extra training compute buys an 11.3-point AIME25 improvement, which is a fairly high return under the same compute budget. This approach also has limitations: the gain ratio at small scale does not necessarily extrapolate linearly to 750B. The company only deployed it on the flagship after progressive validation, and the 30B data is just one link in that validation chain.

Head-to-Head Results: Trading Wins and Losses with DeepSeek and Other Rivals

Previous generation GLM5.3

The official head-to-head win-rate chart shows that GLM-5.4 against the previous generation GLM-5.3 has a 51.1% win rate, 25.7% tie rate, and 23.1% loss rate, the largest advantage among the three groups. Against Kimi K 3.1 Pro, it wins 41.8%, ties 26.9%, and loses 31.3%; against a certain version of DeepSeekAd, it wins 36.6%, ties 30.2%, and loses 33.2%, essentially on the same level.

All three win rates fall between 36% and 51%, with the winning segment always the longest and a considerable tie share, indicating that judges often cannot tell the difference. Note that this chart only reports relative wins and losses; it gives no absolute scores, sample sizes, or specific evaluation method, so interpretation should leave room for uncertainty.

From Code to 3D: The Ambition of Fan Coding

The common point is that the outputs are not text

The document positions this generation as "the starting point of Fan Coding"—making code the foundation for solving a broader range of tasks. The company says that since fully pivoting to code in early 2025, it has successively unlocked agent engineering, long-horizon tasks, and cybersecurity capabilities, and the direction it is now pushing has a higher ceiling and broader impact.

Three examples are given: the model generates a music video "Hello World" with narration on its own; completes engineering-grade CAD modeling in FreeCAD and builds a six-axis robotic arm; and generates an interactive 3D scene from scratch using only mathematical geometry and custom GLSL shaders. The common point is that the outputs are not text, but generated code that drives other tools, rendering pipelines, and physical scenes.

Access Conditions and Limitations: Training Details Still Blank

The current model provides an API through the GLM Coding Plan and will be opened only after safety evaluation is completed. Input supports video, images, text, and files, with a 1M-token context and a maximum output of 128K tokens. Training card type, card count, duration, and cost are all undisclosed—the only things this page confirms are access method and context specifications; training-side conditions are basically blank.

In terms of capabilities, thinking mode allows the model to think more deeply without increasing parameters; output can reach 200 tokens per second during off-peak periods and remains at 70-80 tokens per second during peak periods (test input length not specified). It also supports function calling, context caching, and structured output.

The document also acknowledges limitations: the model is prone to getting stuck in overly long marathon-style thinking loops. The official statement is that this elongated reflection does bring accuracy improvements beyond what the parameter scale would suggest, but the specific impact on latency and cost is not elaborated. Weights are planned to be open-sourced after safety hardening, with no timetable.

Conclusion: Both Paths Must Be Taken

The significance of GLM-5.4 is not that it surpasses someone at a single point, but that it validates a path parallel to parameter stacking: trading loop depth for a higher intelligence ceiling while pushing engineering costs down to a deployable range. The outlook section of the document says it directly—this is not a choice between deeper and bigger; both paths must be taken, and the next generation, which will be noticeably larger, will carry all the experience from here. As for whether the next generation will continue to use the loop structure, the document gives no answer.

#GLM-5.4#Loop Transformer#Z.AI#750B parameters#loop architecture#sparse attention#KV Cache#DeepSeek#Kimi K 3.1 Pro
Share:

Related articles