GLM-5.4: A Looped Transformer That Gets Smarter Without Stacking Parameters

GLM-5.4 uses a looped Transformer to reuse 28 layers twice, nearing larger-model intelligence with fewer parameters.
Z.AI's new flagship GLM-5.4 adopts a "looped Transformer" architecture, taking 28 layers from the base GLM-5 model and running information through the same layers for two iterations, sharing weights without duplicating layers. Z.AI claims it reaches the intelligence of 2–3 trillion-parameter models at roughly 750 billion parameters. To control the memory and compute costs of looping, Z.AI adds gated progressive update, hybrid KV cache, and sparse attention index reuse. The article also covers "generalized programming," where code generates games, 3D scenes, and mechanical systems. But the model can get stuck in long reasoning loops, and complete independent benchmarks are still missing, so official claims warrant caution.
From "Stacking Parameters" to "Deeper Computation": GLM-5.4's Unconventional Path
While the industry broadly equates "bigger" with "smarter," Z.AI's new flagship model GLM-5.4 offers a counterintuitive answer: you don't necessarily have to get bigger to get stronger. According to the company, GLM-5.4 can reach the intelligence level of models with 2 to 3 trillion parameters while operating at a scale of roughly 750 billion parameters. What's truly worth noting isn't this number, but how it processes information—an architecture called the "looped Transformer."
To understand its value, we first need to return to how a standard Transformer works. An ordinary model is like an assembly line: input text is first converted into numerical token representations, then passed through layer by layer, with each layer running only once in the forward pass, handing off its transformation to the next. The most direct way to boost capability is to add layers, but more layers mean parameters and compute balloon in tandem. GLM-5.4 takes a different approach—instead of adding layers, it makes the existing layers run multiple rounds.

How Does a Looped Transformer Work?
In GLM-5.4, the model takes 28 layers from the base GLM-5 model and passes information through this set of layers for two iterations. The key is weight sharing: the model doesn't need to duplicate a new copy of the layers, but instead uses the same set of parameters to process the updated information again. In other words, the network doesn't get wider, but through repeated computation it effectively becomes deeper.
The direct benefit of this design is that the model gains an extra opportunity to process information without having to build a complete duplicate set of parameters for those 28 layers. This is precisely how Z.AI claims GLM-5.4 can approach the intelligence level exhibited by models with far larger parameter counts while operating at a smaller scale.
But reusing layers isn't without cost. The model must keep its internal representations stable while efficiently managing memory. To this end, Z.AI made several targeted engineering optimizations.
Three Key Optimizations
The first is "gated progressive update." As information passes through the loop, the model needs to control how much new information changes the internal state. These gates help maintain representational stability—the first pass builds context, and the second pass can apply stronger corrections.
The second is "hybrid KV cache." Transformers rely on the key-value cache to avoid recomputing attention information. If you loop naively, the cache could be duplicated, significantly increasing memory overhead. GLM-5.4's approach is to share part of the cache between iterations while reserving an independent local sliding window for the second pass.
The third is "sparse attention index reuse." The model directly reuses the attention indices computed in the first pass rather than recomputing them. Together, these changes keep the memory and compute costs of looping in check.

Weight Reuse vs. "Computational Depth"
The core of a looped Transformer lies in distinguishing "parameter scale" from "computational depth." Each layer of a standard Transformer has its own independent parameters, so adding layers necessarily increases the parameter count; a looped Transformer, by contrast, calls the same set of layers (28 here) multiple times. The total number of parameters stays the same, but each token undergoes more forward computations. This is akin to extending computation time on fixed hardware in exchange for stronger representational refinement. Early academic research on the "Universal Transformer" has shown that weight reuse combined with adaptive computation steps can outperform deeper models with the same parameter count on certain algorithmic tasks. GLM-5.4's engineering contribution is making this kind of looping feasible at ultra-large model scale, rather than proposing the looping structure itself.
Why the KV Cache Is the Bottleneck for Looped Architectures
The key-value cache (KV cache) stores the attention keys and values of historical tokens during autoregressive generation, avoiding recomputation of the entire context for every new token. In a standard Transformer, cache size grows linearly with the number of layers; if you simply run each layer twice and keep separate caches for each pass, memory usage would nearly double—especially fatal in long-context scenarios. The hybrid KV cache keeps the increment within an acceptable range by sharing most of the cache between iterations and reserving only a local sliding window for the second pass. Sparse attention index reuse addresses another cost: computing attention indices itself requires extra compute, and reusing the first-pass results avoids duplication. Together, these two optimizations show that the real difficulty of deploying looped architectures isn't the math, but the fine-grained scheduling of memory and bandwidth.
Why Does "Thinking It Through Again" Matter?
Not all tasks require the same degree of reasoning. Translating a short sentence may need only a single forward pass; but designing a system, debugging a complex application, or solving a scientific problem is entirely different—the model needs to maintain context, chain together multiple ideas, and avoid logical contradictions.

The loop structure gives the model another opportunity to refine its internal representations. This doesn't mean the model will automatically produce the right answer, but it provides more "computational depth" without introducing a whole separate set of parameters. For tasks involving long-chain reasoning, this characteristic is especially worth watching.
Generalized Programming: Code Isn't Just for Building Websites
Alongside GLM-5.4, Z.AI introduced the concept of "generalized programming." The logic is straightforward: code isn't just a tool for building websites and applications—it can also be used to generate video, create interactive 3D environments, develop games, and design mechanical systems. In the official demos, GLM-5.4 can generate complete games with movement, physics, maps, and combat systems; build 3D scenes using mathematical geometry and custom shaders; and construct mechanical models with the help of engineering software. From this perspective, programming becomes a general-purpose means of turning ideas into runnable systems.

"Generalized Programming" vs. Code Generation
Traditional code generation tasks are usually evaluated by whether they pass unit tests or implement specified functionality, with output typically being programs in text form. Z.AI's "generalized programming" expands the scope to runnable multimodal systems: games require coordinating rendering, physics, input, and state management simultaneously; 3D scenes depend on geometric mathematics and shaders; mechanical models must interface with the parametric APIs of engineering software. What these tasks share is that code is merely an intermediate product—what's ultimately delivered is an interactive, runnable artifact, and the model must possess cross-domain structural knowledge. This also means the evaluation criteria are more complex: it's not just about whether the code compiles, but whether the generated system is reasonable in terms of motion, collision, visual consistency, and so on. There is currently no unified benchmarking system for this.
Limitations and Open Questions
Z.AI itself acknowledges that GLM-5.4 can sometimes get stuck in extremely long reasoning loops, meaning difficult tasks may take longer and consume more resources than expected. Another thing to watch is performance verification: the company claims the model reaches the level of models far larger than itself, but complete independent benchmark results for this flagship model are still missing. It's necessary to remain cautious about these claims.
Takeaway: Use Existing Resources More Wisely
For years, one of the main paths to improving AI model capabilities has been to make them bigger. GLM-5.4 explores another direction: not just adding parameters, but adding depth to how the model processes information. This may become an important part of how future AI systems are built—sometimes getting smarter isn't about having more, but about making better use of what you already have.
One-line Summary
GLM-5.4 uses a looped Transformer to reuse 28 layers across two iterations, approaching the intelligence of larger models with fewer parameters.
Paragraph Summary
Z.AI's new flagship model GLM-5.4 adopts a "looped Transformer" architecture, taking 28 layers from the base GLM-5 model and passing information through the same set of layers for two iterations, sharing weights instead of duplicating layer copies. The company claims it reaches the intelligence level of 2 to 3 trillion-parameter models at roughly 750 billion parameters. To control the memory and compute costs of looping, Z.AI introduces three optimizations: gated progressive update, hybrid KV cache, and sparse attention index reuse. The article also introduces the concept of "generalized programming," where code can be used to generate games, 3D scenes, and mechanical systems. However, the model may get stuck in long reasoning loops, and complete independent benchmark results are still missing, so official claims should be viewed with caution.
Related articles

ChatGPT Plus Self-Service Recharge in China: Full Process and Risk Analysis
Analyzing the Bilibili tutorial's ChatGPT Plus website recharge process in China, the real risks of Session credential handover, security differences between credit card and mobile recharge, and an account protection checklist for beginners.

DSH + GPT 'Armor-Breaking' in Practice: Compliantly Unlocking AI Creation and Development Limits
A Bilibili creator demonstrates using the DeepSeek Harness desktop client with the Purge plugin to lower AI review thresholds, then driving GPT for image generation and coding tasks.

Prompt Engineering for Beginners: From Writing Instructions to Designing AI Workflows
From the four roles of prompts and the six-step prompt engineering process to AI's real capabilities, a systematic overview of prompt engineering fundamentals from a Bilibili tutorial.