News

日本語 · English · 中文

Z.ai announces flagship model “GLM-5.4” – claims to achieve intelligence level comparable to 2T–3T parameter models using loop-type Transformer

Z.ai has unveiled its flagship model, "GLM-5.4." The company claims that by employing a loop-type Transformer that iterates through the 28 layers of the GLM base model twice, it can deepen inference without increasing the number of parameters, asserting that its intelligence level is comparable to that of models with 2T to 3T parameters. By improving coding and visual capabilities, Z.ai positions this as the starting point for "Generalized Coding," expanding its application scope to areas such as video generation, game development, and 3D modeling.

Z.ai has announced its flagship model, "GLM-5.4." According to the company, GLM-5.4 is the first model to adopt the Loop Transformer architecture, achieving an intelligence level comparable to models with 2T–3T parameters. It is positioned as the starting point for "Generalized Coding," which treats code as a foundation for solving a broader range of tasks.

Loop Transformer Architecture

According to the company, while standard Transformers execute each layer only once in a single forward pass, the Loop Transformer executes groups of layers that share weights multiple times through iteration, refining the previous hidden states. This allows for deeper networks without increasing the number of parameters.

The company explains that this concept itself is not new. The Universal Transformer proposed shared-weight depth in 2018, and subsequent research has demonstrated its effectiveness at smaller scales. However, it states that loop-type models trained from scratch still lag behind non-shared-weight models given the same pre-training compute budget. Therefore, instead of pre-training from scratch, GLM-5.4 transforms already pre-trained base models into Loop Transformers via continued learning. The key lies in retraining the existing models specifically to function within a loop structure, rather than simply looping them as they are (the relationship between looping and learning was also discussed in Contributor's Article: "Normal LLMs Don't Improve Just by Looping—Looping Is About Learning").

GLM-5.4 iterates the 28 layers of the GLM-5 base model twice. To balance performance improvement and deployment costs at the 750B scale, the company claims to have implemented three changes:

  • Gated Progressive Updates: When converting intermediate layers of an existing model into multiple loops, directly overwriting hidden states causes activation norms to diverge with each iteration. GLM-5.4 adds independent per-token gates for each iteration, proportionally writing candidate updates back into the residual stream. After training, these gates form distinct roles. The first pass builds global context and writes conservatively with small gate values to stabilize scale; the second pass reuses this state to refine outputs, opening the gates to write full updates. Gates dynamically adjust step sizes based on token difficulty, allowing difficult tokens to be written more actively in the first pass, making complex predictions more susceptible to benefits from iterative refinement.
  • Hybrid KV Cache (Global Sharing + Independent Sliding Window): A naive implementation retains the full KV cache for every loop iteration, causing memory usage to increase proportionally to the number of loops. GLM-5.4 supplements cross-loop KV sharing with a local sliding window for new passes. The second loop reuses sparse KVs selected in the first pass while maintaining newly generated KVs within the sliding window. Since these two KV streams can overlap at the same positions, the model can attend to both the contextual representation from the first pass and the updated local representation from the second pass. As a result, additional loops require only one sliding window’s worth of KV cache rather than a full context cache, keeping the deployment cost increase of GLM-5.4 over GLM-5.3 manageable even with a 1M context length.
  • Sparse Attention Index Reuse: The base model of GLM-5.4 uses sparse attention. The second loop directly reuses the attention indices generated by the indexer of the first loop, reducing indexing overhead to zero. The company’s experiments showed performance nearly identical to cases where indices were recalculated each time.

Before adopting the Loop architecture for its flagship model, the company conducted phased validation on base models of 1B, 4B, 30B, and 750B. In a controlled comparison using a 30B model with the same architecture as the 750B base, merely increasing total training compute by approximately 10% for the same parameter count, the loop version showed clear improvements. Evaluation was performed on the 30B model after 200k long-context SFT samples, with thinking mode enabled.

The company highlights two findings. First, longer reasoning chains yield greater benefits, with the most significant improvements seen in math/science reasoning and long-context tasks. Second, fewer tokens are spent on thinking. Average output length decreased by 10–14% across many benchmarks such as GPQA-Diamond and MMLU-Pro, largely due to shortened chain-of-thought. Consequently, part of the reasoning shifts from explicit output tokens to the implicit depth of the loop.

Regarding inference efficiency, the company states it maintains up to 200 tokens/second during off-peak times and 70–80 tokens/second even under peak load. To reduce intermediate memory reads/writes increased by looping, it designed the inference kernel alongside the inference base, including fusing major kernels.

Generalized Coding

The company explains that since focusing entirely on coding in early 2025, it has explored Agentic Engineering, Long-Horizon Tasks, and cybersecurity. It positions Generalized Coding as having a higher ceiling and broader impact, viewing GLM-5.4 merely as the starting point.

Improvements in both coding and visual aspects allow GLM-5.4 to generalize beyond traditional software development. It can write code to generate and edit videos, build complete games, handle 3D modeling, and manage mechanical design. Examples cited in the document include producing a self-narrated music video titled "Hello World," building a 6-axis robotic arm via engineering-grade CAD modeling in FreeCAD, and generating an interactive 3D bird-watching experience using pure mathematical geometry and custom GLSL shaders.

Capabilities and Limitations

GLM-5.4 handles video, images, text, and files as inputs, with text as output. Context length is 1M, with a maximum output of 128K tokens. It supports thinking mode, streaming, function calling, context caching, and structured outputs like JSON.

The company acknowledges limitations. Most notably, there is a tendency to fall into overly long "marathon thinking" loops. However, this extended introspection and self-correction consistently show accuracy gains exceeding those attributable to parameter count alone.

How to View This

What has been disclosed includes the Loop Transformer design, three architectural changes at the 750B scale, results from controlled comparisons on the 30B model, and examples of Generalized Coding. Performance figures are based on the company’s measurements and claims; the document does not contain third-party measurement results. The 30B model comparison was conducted under conditions of identical parameter counts and approximately 10% higher total training compute; similar comparative metrics for the 750B model are not shown. The 10–14% reduction in output length was presented as an average across some benchmarks like GPQA-Diamond and MMLU-Pro, not a universal value across all tasks. The figure of up to 200 tokens/second during off-peak times is also stated strictly as a maximum value.

Regarding availability, the GLM Coding Plan users have already begun receiving access, and the Model API will be provided after completing security evaluations. There is no mention in this document regarding the release of model weights. Nor does the document describe the evaluation procedures used to verify each example of Generalized Coding. As future challenges, the company cites realizing adaptive computation by allocating more iterations to difficult tokens and clarifying how loop effects scale when increasing loop counts and model size, stating that a larger next-generation model will be prepared soon.

This article was translated from the Japanese original. 日本語で読む

← Latest articles