GLM-5.4 Loop Transformer: Three Times Smarter Without Stacking Parameters

Loop Transformer lets GLM-5.4 match trillion-scale models with 750B parameters through structure, not size.
The article introduces ZAI Research's GLM-5.4 and its core innovation, the Loop Transformer, which runs weight-sharing layers iteratively to build deeper reasoning without adding parameters. With 28 layers looped twice, the 750B model rivals 2-3 trillion parameter models. Three key modifications—gated progressive updates, hybrid KV cache, and sparse attention index reuse—enable stable, low-cost deployment. Controlled experiments show the loop model excels at long-reasoning tasks with 10-14% shorter outputs, and the roadmap points to token-level adaptive computation.
Title
GLM-5.4 Loop Transformer: Three Times Smarter Without Stacking Parameters
Meta Description
An analysis of ZAI Research's GLM-5.4 Loop Transformer: 28 layers looped twice, 750B parameters rivaling trillion-scale models, using gated updates, hybrid KV cache, and index reuse to achieve low-cost deep reasoning, extending to general coding and adaptive computation.
Article Content
For the past few years, the AI industry's creed has been almost universally "bigger is better." Parameter counts ballooned until a single model's runtime power consumption rivaled a small town's electricity usage. But this old path of stacking parameters has hit a wall—when tasks require multi-step causal reasoning and global logical consistency, simply increasing memory capacity doesn't make a model think better. According to analysis from a YouTube tech channel, ZAI Research's GLM-5.4 proposes a different solution: the Loop Transformer, which dramatically improves reasoning ability without significantly increasing parameters by making the model "think twice before speaking."
The Bottleneck of Parameter Stacking: Memory Is Not Reasoning
First, we need to distinguish two concepts: rote memorization and effective computation. If you're just asking a model to write an email, standard memory retrieval is completely sufficient. But if you ask it to design a complex software system, the model must remember decisions made in step one and ensure that step fifty doesn't overturn step two—this is an ultra-long-chain reasoning task that requires spending real compute on logic itself, not on retrieving patterns seen in training data.
High-level tasks like large-scale software engineering, cybersecurity, 3D modeling, and physical control all demand sustained, deep reasoning over long horizons. According to the channel, standard models struggle noticeably on these tasks unless they're scaled to unsustainable trillion-level parameter counts. Take cybersecurity: miss any single logical link in a vulnerability chain, and the entire analysis becomes worthless. 3D modeling and physical control can't be faked with generalized conversational text either—the math and logic must hold up precisely every single time.

Loop Transformer: Let the Model Draft First, Then Refine
In a standard Transformer, data passes through the layers only once. Want deeper reasoning? Add more layers—which means more parameters. The Loop Transformer changes this rule: it takes a set of weight-sharing layers and runs them iteratively multiple times, with each round refining the hidden state left by the previous round, thereby constructing a deeper network without increasing parameter count.
Here's an analogy: rather than hiring a thousand new writers to produce a better book, let your existing hundred good writers polish and revise through multiple rounds. Researchers converted an existing pre-trained model into a loop structure, raising its intelligence ceiling with relatively small compute overhead. Specifically, by looping 28 layers twice, the resulting 750B-parameter GLM-5.4 matches the raw intelligence level of giant models in the 2-3 trillion parameter range—not through sheer size, but through the structural ability to "think twice before opening its mouth."

Weight sharing is the core mechanism of the Loop Transformer. In a standard Transformer, each layer has its own independent parameter matrix, so increasing layers means linear growth in parameters. The loop structure lets the same set of layers be called multiple times, with all iteration rounds sharing the same weights. This means the model's "depth" (number of computation steps) is decoupled from its "width" (parameter count): you can deepen the reasoning chain by increasing loop count without expanding model size. This design borrows from the idea of recurrent neural networks in computer science, but the key difference is that each iteration of the Loop Transformer retains the full attention mechanism, and hidden states are passed between rounds and refined—not simply repeated forward passes.
Three Architectural Modifications: Making Loops Stable at 750B Scale
Scaling multi-round looping to 750B parameters isn't as simple as pressing a repeat button. Without underlying adjustments, the system would collapse and numerical values would snowball out of control. The team made three key modifications.
Gated progressive updates. When loops overwrite hidden states, values can explode, leaving downstream layers completely lost. To address this, independent per-token gates were introduced: the first round writes a conservative draft, stabilizing global context; the second round opens the gates wider for substantial editing and refinement. These gates also adjust dynamically based on the difficulty of specific tokens—the harder the token, the more cautious the update.
Hybrid KV cache. Intuitively, thinking twice should take twice the memory, which would make server bills explode. But the second loop round reuses the sparse global cache selected in the first round, while maintaining its own independent local sliding window to accommodate new ideas. The result is that an extra loop round brings only a small fraction of memory overhead—deployment costs remain manageable even at million-token context lengths.
Sparse attention index reuse. The second loop round directly reuses the attention map generated in the first round, making index overhead nearly zero.
KV cache is a key memory optimization technique for LLM inference. In autoregressive generation, the model needs to cache the Key and Value matrices of previous tokens to avoid recomputing the entire history each time a new token is generated. Standard Transformer KV caches grow linearly with context length, creating enormous memory overhead at million-token levels. The cleverness of the hybrid KV cache design lies in this: the second loop round reuses the sparse global cache already selected in the first round (i.e., the KV pairs of tokens marked as important by the attention mechanism), while maintaining an independent local sliding window cache for the new round. This preserves global context coherence while keeping the memory increase from additional loops to a small proportion, making long-context deployment economically feasible.
Controlled Experiments: Thinking Deeper, Saying Less
To prove this isn't a mathematical coincidence, researchers conducted strictly controlled comparisons: two 30B models with identical parameter counts, one standard and one loop-structured, with the latter using about 10% more training compute. The results were crystal clear—tasks requiring longer reasoning chains (complex math and science) benefited the most.
The most intriguing detail: explicit output length dropped by 10% to 14%. The architecture shifted reasoning from "saying it out loud" to the "implicit depth" of the loop—the model says less outwardly, thinks more internally, and achieves higher accuracy. This data also corroborates the channel's "three times smarter" claim: the improvement comes from structure and effective computation, not parameter inflation.

Effective compute and parameter scale are two different dimensions for evaluating model capability. Parameter scale measures the model's capacity to store knowledge, while effective compute measures the amount of operations actually used for logical reasoning during inference. The Loop Transformer increases effective compute by adding iteration rounds—even with unchanged parameters, the model performs better on tasks requiring multi-step reasoning. This explains why in same-parameter controlled experiments, the loop model benefited most on complex math and science tasks—these tasks depend most on the depth of logical chains rather than the breadth of the knowledge base. The decrease in explicit output length confirms this too: reasoning is internalized into the loop's hidden states, and the model no longer needs to "say" all intermediate steps out loud.
System-Level Optimization: Looping Doesn't Mean Slow
Running multiple loop rounds sounds like it would leave end users waiting uncomfortably. The team fused core kernels at the system level, reducing reads and writes of intermediate results and eliminating the fragmentation overhead that loops typically introduce—essentially cutting out the middleman of memory shuffling. Thanks to this software-hardware co-design, the model can reach 200 tokens per second during off-peak periods and maintain 70 to 80 tokens per second under peak load.
General Coding: Code Becomes the Language for Operating Reality
The leap in core logical capability has brought the model into the era of "general coding"—code is no longer just for software development, but has become the universal language for operating reality. According to the channel's demonstration, this model uses code to produce music videos with narration, perform engineering-grade CAD modeling in FreeCAD, design six-axis robotic arms, build complete games from scratch including physics, character movement, combat systems, and art assets, and even generate interactive 3D birdwatching experiences from pure mathematical geometry. Every one of these tasks requires frame-by-frame mathematical and logical consistency—exactly the scenarios where loop reasoning excels.

The Future: Adaptive Computation
The next stage this path points toward is adaptive computation: harder tokens dynamically receive more loop rounds, and the model decides for itself how much compute to spend thinking. The channel offers an experiment you can try yourself—give a standard AI a complex logic puzzle and watch how quickly it produces a completely wrong answer, precisely because it lacks the architecture for pausing and looping. When models can autonomously decide how long to think, the era of mindlessly scaling model size will truly come to an end.
It should be noted that the above content comes from a single YouTube channel's interpretation. For specific technical details and experimental data on GLM-5.4, we recommend cross-referencing ZAI Research's original papers and official releases for further verification.
Adaptive computation refers to a model dynamically adjusting its allocation of computational resources based on input difficulty. Within the Loop Transformer framework, this manifests as reducing loop rounds for simple tokens and increasing them for complex tokens. This idea has early precedents in research, such as the ACT (Adaptive Computation Time) mechanism in Universal Transformer, which allows the model to learn a stopping probability for each token to decide when to terminate looping. The token-level adaptive computation on GLM-5.4's roadmap essentially extends this dynamic depth control to hundred-billion-parameter scale, teaching the model to learn "when to think a little longer," thereby maximizing reasoning quality under limited overall compute budgets.
One-line Summary
Loop Transformer lets GLM-5.4 match trillion-scale models with 750B parameters, improving reasoning through structure rather than size.
Paragraph Summary
The article introduces ZAI Research's GLM-5.4 model and its core innovation—the Loop Transformer. This architecture runs weight-sharing layers iteratively multiple times, constructing deeper reasoning networks without significantly increasing parameters. The 750B-parameter GLM-5.4, with 28 layers looped twice, matches the intelligence level of 2-3 trillion parameter models. To run stably at 750B scale, the team introduced three modifications: gated progressive updates, hybrid KV cache, and sparse attention index reuse, ensuring numerical stability and low-cost deployment. Same-parameter controlled experiments show the loop model benefits most on long-reasoning tasks, with explicit output length dropping 10-14% as reasoning shifts from output to implicit depth. System-level optimization ensures looping doesn't slow response times. General coding makes code the language for operating reality, and the next step is token-level adaptive computation.
Related articles

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.

AI Prompt Engineering Bootcamp: Mastering Future-Proof Core Principles
A complete AI prompt engineering bootcamp on Bilibili, taught by Mike Taylor and James Phoenix, covering ChatGPT, GitHub Copilot, LangChain, vector databases, and autonomous agents, emphasizing future-proof prompt principles over short-lived tricks, with reusable prompt templates.