Over the past three months, we have aggressively scaled both the Loop architecture and model size. The first surprise has come from Loop. A Loop Transformer repeatedly executes a set of layers with shared weights, allowing the model to reason more deeply without increasing its parameter count and effectively deliver the performance of a larger model.
GLM-5.4 is our first flagship model built on the Loop Transformer architecture. The approach has paid off, bringing its intelligence to the level of models with 2 trillion to 3 trillion parameters.
GLM-5.4 marks the beginning of “general-purpose coding.” Code is becoming the foundation for completing a broader range of tasks, unlocking a host of new capabilities.
We have also identified some issues. For example, the model can easily slip into a “thunderous overthinking” mode. But we have found that extended reasoning continues to improve results: the model keeps reflecting and correcting itself as it thinks, precisely the capability we have long sought for long-horizon tasks.
Starting today, GLM-5.4 is available to all GLM Coding Plan users and is launching simultaneously on coding platforms including ZCode, Trae, WorkBuddy and Qoder. API access will open after the completion of safety evaluations, while the model weights are slated for a responsible open-source release. Usage quotas for Coding Plan V2, V3 and Team users have been raised to 1.5 times their previous levels. Users can explore GLM-5.4’s general-purpose coding capabilities in ZCode and unlock new possibilities for professional applications.
Code Is Just the Beginning
Coding has become a foundational capability from which models can generalize. Since going all in on coding in early 2025, we have unlocked capabilities in agentic engineering, long-horizon tasks and even cybersecurity. This time, we are turning first to “general-purpose coding,” a path with a higher ceiling and potentially more far-reaching impact.
To test the model on practical programming tasks, we ran an evaluation covering 200 real-world coding scenarios. The results showed that GLM-5.4 remains the Chinese model with the strongest hands-on coding experience, with standout performance in visual coding, visual replication and long-horizon tasks.
Combined improvements in coding and vision have unlocked a wide range of scenarios beyond coding itself. GLM-5.4 can, for example, use code to generate and process video, build a complete game, and perform 3D modeling and mechanical design.
Scaling Coding to Video
“Hello World” is GLM-5.4’s autobiographical music video. Creator Mike Luan used GLM-5.4 to complete the entire process from scratch, spanning concept development, music arrangement, animation and visual rendering. All visuals were drawn in real time with front-end code, using no image assets. GLM-5.4 planned the music around the chapters and shots, called a third-party music generation model to produce it, and independently completed multiple rounds of revisions to the music prompts.
Scaling Coding to 3D
Creator Yesheng Bushuohua built an interactive, macro-scale 3D birdwatching experience from scratch using only mathematical geometry and custom GLSL shaders, with no external 3D models or texture files. The result recreates a northern long-tailed tit with individually defined down feathers that breathes, tilts its head, blinks and moves its nictitating membranes.
Scaling Coding to Engineering
GLM-5.4 used FreeCAD for engineering modeling to build a six-axis robotic arm, then called Blender to design and visualize its movements and added audio, producing a simulation and visualization of the arm grabbing a logo.
28 Layers, Two Loops
As we discussed in the GLM-5.3 technical blog, memory-intensive tasks benefit from more parameters, while reasoning-intensive tasks benefit from more effective compute. Large-scale software engineering, cybersecurity, 3D modeling and physical control are all, at their core, extremely long-chain reasoning tasks. A model must continue working through multistep causal chains while maintaining global logical consistency. These capabilities cannot be acquired simply by piling on parameters or relying on rote memorization.
To address this, GLM-5.4 introduces the Loop Transformer.
Each layer in a standard Transformer executes only once during a forward pass. A Loop Transformer instead runs a set of shared-weight layers for multiple rounds, with each round building on the previous round’s hidden states to continue reasoning and refine the result. In effect, this creates a deeper network without increasing the parameter count.
The idea is not new. The Universal Transformer proposed a shared-weight deep architecture in 2018, and more recent research into recurrent depth and recurrent language models has demonstrated benefits at smaller scales. But while weight sharing improves parameter efficiency, it still underperforms models without shared weights when given the same amount of pretraining compute. We therefore did not pretrain from scratch. Instead, we used additional training to convert an already pretrained base model into a Loop Transformer, raising its intelligence ceiling at relatively modest computing power cost. GLM-5.4 runs two loops across 28 layers of the GLM-5 base model. After a series of experiments aimed at balancing the benefits of looping against deployment costs, we made three changes for the 750-billion-parameter model:
1. Gated progressive updates: Candidate changes are written back proportionally, adapting the model to post-training loops and creating a division of labor across rounds. When an existing model’s intermediate layers are converted into a multiround loop, directly replacing the hidden state with each round’s output causes activation norms to grow excessively with the number of loops. The representations passed to later layers also drift away from the scales and distributions familiar to the original model. GLM-5.4 assigns an independent per-token gate to each round, proportionally writing that round’s candidate changes back into the residual stream. After training, the gates show a clear division of labor. The first round focuses on establishing global contextual states and uses relatively small gate values to write back gently at most positions, stabilizing the scale. The second round reuses that state for refinement, opens the gates and writes back the results more fully. The gates also dynamically adjust step size based on how difficult a token is to predict. At harder positions, the first round writes back more information, allowing complex predictions to benefit more fully from multiple iterations.
2. Globally shared KV cache with independent sliding windows: An extra round of thought consumes almost no additional GPU memory. A naive implementation would retain a full KV cache for each loop, causing memory use to multiply with the number of rounds. We share KV across rounds and use a sliding window to supply local information for the new round. The second round reuses the sparse KV selected in the first while retaining KV generated by the second round within the sliding window. Both KV paths can cover the same position, allowing the model to read the first round’s contextual representation as well as the second round’s updated local representation. As a result, the incremental cost of another loop is only one window of KV, rather than another full-context cache. With a context length of 1 million tokens, this design keeps GLM-5.4’s deployment cost increase over GLM-5.3 manageable.
3. Reused sparse-attention indices: An extra round of thought adds no retrieval cost. GLM-5.4’s base model uses sparse attention, and the second loop directly reuses the indices generated by the first round’s indexer, adding no indexer overhead. Experiments show that its performance is almost identical to recalculating the indices in every round.
Loop is also a rigorous test of scaling correctness. Any architectural innovation must continue to work as it scales. Before betting our flagship model on Loop, we validated it step by step on base models ranging from 1 billion and 4 billion parameters to 30 billion and ultimately 750 billion.
Using a 30-billion-parameter model with exactly the same architecture as the 750-billion-parameter base, we ran a controlled comparison at an identical parameter count. With overall training compute increasing by only about 10%, the Loop version delivered a clear improvement over the baseline.
We evaluated the 30-billion-parameter model with thinking enabled after long-text supervised fine-tuning on 200,000 samples:
The longer the reasoning chain, the more Loop helps. The largest gains came in mathematical reasoning, long-context tasks and coding, precisely the capabilities on which general-purpose coding depends most heavily.
Loop reasons with fewer tokens. On benchmarks including GPQA and MMLU-Pro, average output length fell by 10% to 14%, with most of the reduction coming from chain-of-thought tokens. In other words, some reasoning shifted from the token stream into the additional depth provided by looping.
GLM-5.4 is our first exploration of Loop, and important questions remain. How can we implement adaptive computation so that tokens of varying difficulty receive different amounts of compute? And how will Loop’s benefits change as the number of rounds and the model’s scale continue to grow?
After Two Loops, the Speed Remains
GLM-5.4 can reach speeds of up to 200 tokens per second during off-peak periods and still deliver 70 to 80 tokens per second at peak times. That is particularly difficult for a Loop architecture built around multiple rounds of computation. Through deep co-design of the model architecture and inference infrastructure, we minimized the overhead introduced by looping. At the architectural level, a KV cache partitioned by distance means the second loop adds almost no GPU memory usage, while reusing sparse-attention indices eliminates additional retrieval overhead. At the operator level, extensive fusion of core operators reduces repeated reads and writes of intermediate results in GPU memory, eliminating the small costs amplified by looping at the kernel level.
Stronger performance, faster speeds and more generous quotas together make GLM-5.4 the preferred choice for everyday productivity.
We are not choosing between scaling computational depth and scaling model size. We are pursuing both. GLM-5.4 validates the path of greater computational depth. Our next model will be significantly larger, incorporate everything we have learned here and arrive soon.

Comments
00No comments yet. Be the first to weigh in.