Zhipu AI Releases GLM-5.4, First Flagship Built on Loop Transformer

By 智谱 AIOriginal title: GLM-5.4:瞄向泛Coding,首个Loop Transformer带来的惊喜
88AI Score

Zhipu AI has released GLM-5.4, its first flagship model built on the Loop Transformer architecture, which loops shared-weight layers to achieve deeper reasoning at fixed parameter count and reaches intelligence comparable to 2-3T-scale models. Positioned around generalized coding, it extends to video generation, game building and 3D modeling, and is now available to all GLM Coding Plan users with weights planned for responsible open sourcing.

Full Report

Contents4 sections

GLM-5.4: Aiming at General-Purpose Coding, the Surprise Brought by the First Loop Transformer

2026/11/22 16 Foundation Models Over the past three months, we have aggressively scaled both Loop and model size at the same time. The first thing everyone sees is the surprise brought by the Loop architecture. Loop Transformer allows a set of layers with shared weights to be executed repeatedly, so the model can perform deeper reasoning without changing the parameter count, effectively achieving the performance of a larger model.

  • GLM-5.4 is our first flagship model adopting the Loop Transformer architecture. It delivers results, with intelligence reaching the level of 2-3T models.
  • GLM-5.4 marks the beginning of "general-purpose Coding". Code is becoming the foundation for completing a broader range of tasks, unlocking many new capabilities.

We also found some issues, such as the model easily entering a "thunderous deep-thinking" mode (but we found that this long thinking can continuously improve results—the model keeps reflecting and self-correcting during thinking, which is exactly the capability we have always wanted for long-horizon tasks). Starting today, GLM-5.4 is fully available to all users of the GLM Coding Plan, and is simultaneously launched on coding platforms such as ZCode, Trae, WorkBuddy, and Qoder. The API will be opened after security evaluation is completed, and the model weights are planned to be open-sourced in a responsible manner. For Coding Plan V2/V3/Team Edition users, the GLM-5.4 quota is increased to 1.5x. You can fully experience GLM-5.4's general-purpose Coding capabilities in ZCode and unlock new possibilities for professional applications.

General-Purpose Coding

Coding has become the foundational capability for extrapolating model abilities. Since we went all-in on coding in early 2025, along this path of exploration we have unlocked Agentic Engineering, Long Horizon Tasks, and even Cyber Security capabilities. This time we are the first to aim at "general-purpose Coding", a path with a higher ceiling and more far-reaching changes. To test the model's capabilities in real programming tasks, we conducted a programming combat evaluation of 200 real-world scenarios. The results show that GLM-5.4 remains the domestic model with the strongest Coding feel, standing out in visual Coding, visual replication, and long-horizon tasks.

Thanks to the dual improvement in code and visual capabilities, a large number of new scenarios beyond Coding have been unlocked. For example, GLM-5.4 can use code to generate and process video, build a complete game, and complete 3D modeling and mechanical design. 1. Scaling Coding to Video GLM-5.4's self-narrated MV "Hello world". Creator Mike Luan used GLM-5.4 to complete the entire process from 0 to 1, from creativity, arrangement, and motion to visual rendering. The visual part is entirely drawn in real time using front-end code (0 image assets), while the music is planned by GLM-5.4 itself according to chapters and shots, calling third-party music generation models to produce it, and autonomously completing multiple rounds of music Prompt revisions. 2. Scaling Coding to 3D Creator 夜神不说话, with 0 external 3D models and 0 texture files, generated from scratch a 3D macro interactive birdwatching experience using pure mathematical geometry and custom GLSL shaders, recreating a long-tailed tit with individually distinct feathers, a breathing head tilt, and a blinking nictitating membrane. 3. Scaling Coding to Engineering GLM-5.4 performed engineering modeling through FreeCAD, built a six-axis robotic arm model, then called Blender to design motions, visualize them, and synthesize audio, generating a simulation and visualization of a Logo-grabbing motion.

Loop Architecture

In the GLM-5.3 technical blog, we discussed that memory-oriented tasks benefit from more parameters, while reasoning-oriented tasks benefit from more effective computation. Large-scale software engineering, cybersecurity, 3D modeling, and physical control are all, in essence, extremely long-chain reasoning tasks: the model must continuously reason along multi-step causal chains while maintaining global logical consistency. Such capabilities cannot be acquired by stacking parameters or rote memorization. To this end, GLM-5.4 introduces the Loop Transformer. Each layer of a standard Transformer executes only once in a single forward pass; the Loop Transformer instead makes a group of layers with shared weights loop for multiple rounds, with each round continuing to reason and refine results based on the hidden state of the previous round. This is equivalent to obtaining a deeper network without increasing the parameter count. The idea is not new. The Universal Transformer in 2018 already proposed a deep structure with weight sharing, and recent research on recurrent depth and recurrent language models has also validated the benefits at small scale. However, although weight sharing improves parameter efficiency, under the same amount of pre-training compute, its performance still falls short of models without weight sharing. Therefore, instead of pre-training from scratch, we converted an already pre-trained base model into a Loop Transformer through further training, trading a relatively small compute overhead for an increase in the intelligence ceiling. GLM-5.4 applies two rounds of looping to 28 layers in the GLM-5 base. To balance looping effectiveness and deployment cost, after a series of experiments we made three changes for the 750B-scale model: 1. Gated progressive update: write back candidate changes proportionally, adapt to post-training looping, and form cross-round division of labor. When converting the middle layers of an existing model into multi-round looping, if the hidden state is directly overwritten by each round's output, the activation norm will expand excessively with the number of loop rounds, and the representations received by subsequent layers will also deviate from the scale and distribution familiar to the original model. GLM-5.4 sets an independent per-token gate for each round, writing back that round's candidate changes to the residual stream proportionally. After training, the gates exhibit a clear division of labor: the first round focuses on establishing a global context state and, for most positions, writes back gently with a small gate value to stabilize the scale; the second round reuses this state to complete refinement, opens the gate, and writes back the results fully. In addition, the gate dynamically adjusts the step size according to the prediction difficulty of the token: at positions that are harder to predict, the first-round write is moderately increased, so that complex predictions benefit more fully from multi-round iteration. 2. Global KV Cache sharing + independent sliding window: think one more round with almost no additional memory usage. The naive approach is to keep a full copy of the KV cache for each loop round, causing memory usage to grow multiplicatively with the number of loop rounds. Building on cross-round KV sharing, we use a sliding window to supplement the new round's local information: the second round reuses the sparse KV selected in the first round while retaining the KV generated by the second round within the sliding window. The two KV paths can cover the same position, allowing the model to both read the first round's context representation and leverage the second round's updated local representation. In this way, the extra cost of one more loop round is only one window's KV rather than a full-context cache. Under a 1M long context, this design keeps the deployment cost increase of GLM-5.4 relative to GLM-5.3 controllable. 3. Reuse sparse attention indices: think one more round without extra retrieval cost. The base of GLM-5.4 adopts sparse attention, and the second loop round directly reuses the indices generated by the first-round indexer, adding no indexer overhead. Experiments show that its effect is almost equivalent to recomputing indices each round. Loop is also a rigorous test of Scaling Correctness. Any architectural innovation must still hold after scaling up. Before betting the flagship on Loop, we validated it level by level on 1B, 4B, 30B, and up to 750B bases. On a 30B model with exactly the same architecture as the 750B base, we conducted an equal-parameter comparison: with exactly the same parameter count and only about 10% more overall training compute, the Loop version shows a clear improvement over the baseline.

30B model, after 200K long-text SFT, with thinking enabled for evaluation Two findings are particularly noteworthy:

  • The longer the reasoning chain, the greater the help from Loop. The largest improvements are in mathematical reasoning, long context, and code, which are precisely the capabilities that general Coding relies on most.
  • Loop thinks with fewer tokens: on benchmarks such as GPQA and MMLU-Pro, the average output length drops by 10%–14%, with the reduction mainly coming from the chain of thought. In other words, part of the reasoning has shifted from the token stream to the extra depth brought by looping.

GLM-5.4 is our preliminary exploration of Loop, and there are still questions to answer: how to implement adaptive computation so that tokens of different difficulty receive different amounts of compute; and how the benefits of Loop will change as the number of loop rounds and model scale continue to increase.

Availability

GLM-5.4 can reach speeds of up to 200 token/s during off-peak hours, and can still provide 70-80 token/s during peak hours. For the Loop architecture with multi-round recurrent computation, achieving this is especially difficult. Through deep co-design of the model architecture and inference Infra, we have minimized the extra overhead brought by looping. Architecturally, the distance-partitioned KV cache makes the second loop round add almost no memory usage, and sparse attention index reuse ensures that looping adds no retrieval overhead. At the operator level, core operators are fully fused to reduce back-and-forth reads and writes of intermediate results in memory, saving the fragmented overhead amplified by looping at the kernel level. Stronger performance, faster speed, and more ample quota together make GLM-5.4 the first choice for daily productivity. Experience it now:

We are not choosing between scaling depth and scaling model size—we are pursuing both. GLM-5.4 has validated the path of scaling compute depth, and our next model is significantly larger in scale and will carry everything learned here. It will be with you soon.