Zhipu Releases GLM-5.4 Debuting Loop Transformer Architecture

By 褚杏娟Original title: GLM-5.4 编程能力暴涨、3D惊艳,但推理变久了?智谱押注双路线:首发Loop架构,下一代继续 Scaling
78AI Score

Zhipu AI launched GLM-5.4, its new flagship model that debuts a Loop Transformer architecture, recycling shared-weight layers to raise effective computational depth without growing parameter count, while repositioning from coding to 'generalized coding'. It is live for GLM Coding Plan users and on platforms such as ZCode and Trae, with weights promised for open source and a larger next-generation model planned on the same Loop path.

Full Report

Contents4 sections

On November 23, Zhipu launched its new-generation flagship model GLM-5.4, expanding its product positioning from traditional Coding to "generalized Coding." The model adopts the Loop Transformer architecture for the first time, increasing effective computational depth without increasing the number of model parameters by having network layers with shared weights execute recurrently.

Zhipu states that GLM-5.4 has achieved significant improvements in programming capability, long-horizon tasks, and cross-domain generalization.

Currently, GLM-5.4 is available to all GLM Coding Plan users starting today, and has simultaneously launched on coding platforms including ZCode, Trae, WorkBuddy, Qoder, CatPaw, and OpenCode. The GLM-5.4 model quota for GLM Coding Plan V2, V3, and Team Edition users has been increased to 1.5 times the original. The API will be opened after security assessment is completed. Zhipu states that it plans to open-source the model weights in a responsible manner after completing necessary security hardening.

This release of GLM-5.4 reflects another exploration path Zhipu is taking in model Scaling: while continuing to expand model scale, it increases effective computational depth through a recurrent architecture, rather than relying solely on parameter count growth to improve capabilities. Zhipu revealed that the next-generation model will be significantly larger in scale and will continue to advance by building on the experience gained from GLM-5.4's Loop architecture.

Hands-on Test of "Generalized Coding": Engineered Video Production Capability Impresses, but Development Takes Long

Zhipu refers to the core capability expansion of GLM-5.4 as "generalized Coding." The underlying judgment is that code is no longer confined to traditional software development, but is gradually becoming a universal interface for models to describe, construct, and operate different digital content.

For example, videos can be generated and processed through code, complete games can be built directly with code, and 3D scenes and mechanical industrial designs can also describe geometric structures, materials, and constraint relationships through programs. As model programming capabilities strengthen, tasks that originally required professional software, complex operation workflows, and coordination of multiple tools are beginning to have the opportunity to be completed directly by agents.

In Zhipu's view, Coding has become an important foundation for extrapolating model capabilities. Since fully committing to the Coding direction in early 2025, the team has gradually explored capabilities in agent engineering, long-horizon tasks, and cybersecurity. The further proposal of "generalized Coding" this time means that the boundaries of model capabilities are beginning to extend outward from software development itself.

To this end, we conducted a Code2Video specialized test using GLM-5.4 in ZCode. The model was asked to produce a 1920×1080, 30FPS video on the theme of "Six-Year Trajectory of Revenue and R&D Investment." The prompt is as follows:

Create a 20-second dynamic data visualization video from the data in the CSV, output as a 1920×1080, 30FPS MP4. Visual requirements: 0–3 seconds: title and statistical scope explanation; 3–9 seconds: revenue data bar chart growing year by year, with numbers scrolling in sync; 9–15 seconds: R&D investment line chart being drawn, showing annual values; 15–20 seconds: side-by-side comparison of revenue and R&D investment, with a brief and prudent conclusion; all numbers must come from the CSV, and must not be filled in, interpolated, or fabricated; legends, units, and years must be clear; labels must not be obscured by animations. Style should be clean, editorial data journalism visual, and do not use exaggerated 3D pie charts.

After nearly 30 minutes of "work," the final delivered video:

From the final output, GLM-5.4 demonstrated solid visual design capabilities. The video uses a warm white background paired with brick red and dark blue, with an overall clean and restrained style, and the typography, whitespace, and chart layout are relatively well-coordinated.

In terms of accuracy, compared against the original data, the six-year revenue and R&D investment figures in the video are consistent with the input file, and the R&D investment as a proportion of revenue shown at the end of the video is approximately 29%–35%, with the calculation results being basically correct.

At the development level, the model used Pillow for frame-by-frame image rendering, then completed video encoding through FFmpeg. The code set up 2x supersampling, organized different segments through independent scene functions, and used easing functions to control bar chart growth, line drawing, and element entrances. It is evident that GLM-5.4 already possesses code-driven video production capabilities.

In terms of 3D production, we also designed a test to create a 3D animation involving physics calculations. The prompt is as follows:

Create a 3D animation of approximately 12 seconds: a metal ball falls from a slope, undergoes two elastic collisions, enters a mechanical device and pushes the transmission mechanism to start, and finally the camera pulls back to show the complete device. Requirements: the scene ground is a horizontal plane, and gravity direction is downward. The metal ball has a diameter of 40mm and a mass of 0.25kg; the ball is released from a height of 1.2m above the ground; the collision bodies in the two collisions must not penetrate each other; the mechanical device consists of at least 3 gears, with reasonable gear rotation directions and meshing relationships; the ball's motion, collisions, gear startup, and inertial deceleration must be represented; the camera must include at least a wide shot, a follow shot, mechanical details, and a final wide shot. Real physics simulation or explicitly stated approximate animation may be used, but purely visual illusions must not be claimed as physics simulation.

This took the longest time in the entire test, approximately 5 hours, but the result is indeed impressive:

From the submitted source code, GLM-5.4 did not simply simulate all motion through keyframes, but adopted the Blender Bullet rigid body solver to handle the metal ball's motion and collisions, and implemented baffle rotation through HINGE hinge constraints. For the three-stage gear mechanism, the transmission relationship was calculated based on the number of gear teeth and the actual rotation angle of the baffle, driven by kinematic approximation.

In gear design, the model set up a three-stage transmission structure with 12 teeth, 18 teeth, and 27 teeth, and the rotation directions and angular velocity ratios between gears conform to basic mechanical transmission relationships. The model also adopted 120FPS physics solving with 10 substeps per frame, and improved collision stability through settings such as hidden collision proxies, collision margins, and angular damping.

It can be seen that GLM-5.4 demonstrated strong cross-domain technical integration capabilities, able to organize rigid body physics, mechanical transmission, 3D animation, and video rendering into an automated pipeline. However, exception handling in some areas can still be further strengthened.

Below is a small future city block scene created by GLM-5.4 that can be used in real-time engines. You can also take a look at the result:

Programming Significantly Improved Over Previous Generation, but a Bit Slower

Compared to simply improving code generation quality, Zhipu this time is more focused on whether the model can complete complex tasks that last longer and involve more steps. This is also an important reason why GLM-5.4 introduced Loop Transformer.

To this end, we chose to build a small game for testing. The prompt is as follows:

Develop a playable 2D side-scrolling action game themed "Repair Robot Escapes a Runaway Factory." Requirements: left/right movement, jumping, dashing; at least one complete level including platforms, traps, collectibles, and an exit; at least one enemy type with patrol and attack behavior; the player has health, damage feedback, and invincibility frames; include start, pause, victory, defeat, and restart screens; clear keyboard controls with restart support.

After about an hour and a half, it output a side-scrolling action mini-game written in pure vanilla JavaScript + HTML5 Canvas. The gameplay testing process is as follows:

The author is a clumsy player, so bear with it~

The game background presents distant, midground, and foreground layers through multi-layer parallax, adding rotating gears, warning lights, and floating dust; sound effects are synthesized in real time using the Web Audio API, and the background music uses 100 BPM procedural arpeggios and drum kits, adjusting audio intensity based on combat state.

The overall control experience has no issues, the keys correspond correctly, the UI design is simple and fits the theme, and the initial gameplay experience is pretty good. But it seems there's nothing after the first level ends.

On the development side, the project uses a 60Hz fixed timestep to update game logic, with requestAnimationFrame responsible for rendering, and sets a maximum of 5 logic updates per frame. The collision system uses AABB per-axis resolution, and one-way platforms determine whether a valid collision occurs based on the foot position in the previous frame.

These implementations show that the model is already able to integrate character control, physics mechanics, enemy behavior, level data, sound effects, and game state management into a relatively complete project. Compared with only generating a web demo where a character can move, the complexity of this delivery is noticeably higher.

But in terms of the generation experience, the whole process was somewhat slow. The test used GLM-5.4 at the highest reasoning intensity, and it felt like the model would overthink. The generation process was very cautious, with the model constantly testing and checking, then correcting.

However, the Zhipu team should also be aware of this issue. They wrote in their blog: "We have also found some problems, such as the model easily entering 'thunderous overthinking' mode (but we found that this long thinking can continuously improve results—the model constantly reflects and self-corrects during thinking, which is exactly the capability we have always wanted for long-horizon tasks)."

In addition, we encountered an automatic context compression issue during this time. That is, "after 3 consecutive compressions, the context was filled up again within fewer than 3 tool calls each time. Most likely the files read / tool return content were too large in volume. It is recommended to read in chunks, or open a new session."

This time the system proactively stopped after 3 consecutive rapid compressions, indicating that its protection mechanism had intervened. However, if the context protection mechanism is frequently triggered when continuously calling tools and processing large numbers of engineering files, it will be difficult to stably undertake complete production tasks.

The backend shows that the peak token count during the test was 55.047 million. In addition, during the test, after opening six conversations at the same time, we also encountered rate limiting issues.

First Introduction of Loop Transformer, Increasing Reasoning Depth

Behind this upgrade there are two technical routes worth noting: one is to continue expanding model scale, and the other is to increase the model's effective reasoning depth through recurrent computation. Zhipu stated that over the past three months, the team has simultaneously advanced the Scaling of model scale and the Loop architecture, hoping to further improve the model's ability to handle complex tasks without relying solely on parameter growth.

GLM-5.4 is the first flagship model to adopt the Loop Transformer architecture.

Each layer of a traditional Transformer usually executes only once in a single forward computation, whereas a Loop Transformer lets a group of network layers with shared weights execute multiple rounds in a loop. Each round continues to reason and refine results based on the hidden state of the previous round, which is equivalent to giving the model a deeper computational network without increasing the number of parameters.

This idea is not new. The Universal Transformer in 2018 already proposed a deep structure with weight sharing, and in recent years research on recurrent depth and recurrent language models has also verified related benefits in small-scale experiments.

However, although weight sharing can improve parameter efficiency, under the same amount of pretraining compute, its performance is not necessarily better than models without weight sharing. Therefore, Zhipu did not choose to pretrain a Loop Transformer from scratch, but instead used an already pretrained base model as the foundation and further trained it to transform it into a recurrent architecture, hoping to exchange a relatively small amount of additional compute for a higher intelligence ceiling.

Specifically, GLM-5.4 applies two rounds of looping to the 28 layers in the GLM-5 base. Targeting the characteristics of the 750B-scale model, the team made three key designs.

The first is gated progressive updating. Directly letting the output of each loop round overwrite the hidden state of the previous round may cause the activation norm to expand as the number of loop rounds increases, making the representations received by subsequent layers deviate from the scale and distribution familiar to the original model. To this end, GLM-5.4 sets an independent per-token gating mechanism for each round, writing candidate changes back into the residual stream according to a certain ratio.

After training, the two loop rounds formed different divisions of labor: the first round mainly establishes the global context state, using smaller gating values for most positions to keep the model representation stable; the second round further refines the existing state and increases the write ratio. In addition, the gating also dynamically adjusts the step size according to the prediction difficulty of the token, appropriately increasing the first-round write amount at positions that are harder to predict, so that complex prediction tasks can benefit more fully from multiple rounds of iteration.

The second is global KV Cache sharing and independent sliding-window design.

The traditional approach requires keeping a full copy of the KV Cache for each loop round, and as the number of loop rounds increases, memory usage also grows accordingly. GLM-5.4 splits according to attention scope: near-distance context within the sliding window keeps KV separately for each round, because this part of the content differs more across rounds; far-distance context outside the window shares the same copy of KV across all rounds. In this way, the additional memory required to add one loop round is only related to one window, without needing to re-save the full context. In the 1M long-context scenario, this design keeps the increase in deployment cost of GLM-5.4 compared with GLM-5.3 within a controllable range.

The third improvement is reusing sparse attention indices. Since the base model of GLM-5.4 adopts a sparse attention mechanism, the second loop directly reuses the indices generated by the indexer in the first loop, eliminating the need for recomputation. Experiments show that this approach achieves essentially the same effect as recomputing indices each round, while avoiding the additional indexer overhead.

Output Tokens Reduced by Over 10% on Some Tasks

To verify whether the Loop architecture can continue to be effective as model scale increases, Zhipu tested progressively on 1B, 4B, 30B, and up to 750B base models.

On a 30B model with an architecture identical to the 750B base, the team conducted a controlled experiment with the same parameter count. Results show that the Loop version has exactly the same parameter count as the baseline model, with overall training compute increasing by only about 10%, yet performance has already improved significantly.

Experiments published by Zhipu also show that the Loop architecture is more helpful for tasks with longer reasoning chains, with particularly notable improvements on mathematical reasoning, long-context, and coding tasks. These tasks are also important foundations for general Coding capabilities.

The team stated that another noteworthy finding is that the Loop architecture does not necessarily require generating more tokens to achieve better results. On most benchmarks such as GPQA and MMLU-Pro, the model's average output length decreased by 10%–14%, with the reduction mainly coming from the chain of thought.

This means that part of the reasoning process that originally required continuous token generation can be shifted to the additional network depth brought by loop computation. The model can perform multiple rounds of internal state updates and result refinement without relying entirely on longer external chains of thought.

Multi-round loop computation typically increases inference overhead. How to maintain generation speed while improving model capabilities is another issue for whether the Loop Transformer can be practically deployed.

Zhipu states that GLM-5.4 can achieve generation speeds of up to 200 Token/s during off-peak hours, and can maintain 70–80 Token/s during peak hours. To control the additional cost brought by loop computation, the team jointly optimized the model architecture and inference infrastructure.

Among these, the aforementioned KV Cache sharing mechanism reduces memory usage in the second loop, while sparse attention index reuse avoids additional retrieval costs. At the operator level, the team reduced repeated reads and writes of intermediate results in memory by fusing core operators, lowering the additional overhead generated during loop computation.

However, Zhipu also stated that GLM-5.4 is still only a preliminary exploration of the Loop architecture. How to achieve adaptive computation so that tokens of different difficulty receive different amounts of computation, and how the benefits of Loop will change as the number of loop rounds and model scale continue to increase, remain questions for future research.