Z.ai has launched GLM-5.4, the first flagship model built on what the Chinese AI lab calls a Loop Transformer architecture — a design that runs a shared block of layers through multiple iterations instead of simply stacking more parameters. In a technical blog post published Sunday, the company said the model reaches "intelligence levels comparable to 2T-3T parameter models" while relying on a far smaller parameter footprint, and framed the release as the starting point for what it calls Generalized Coding: using code generation as the foundation for tasks well beyond traditional software development.
The launch landed with unusually high visibility for a model release without an open-weights download. The announcement climbed to the top of Hacker News within hours, drawing nearly 600 upvotes as engineers debated whether looping layers could genuinely substitute for scale. It is the latest move in an increasingly crowded race among Chinese labs to compete on architecture rather than raw compute. For more on how open-weight releases are reshaping the global AI market, see our latest AI developments.
How the Loop Transformer Works
In a standard Transformer, every layer runs once per forward pass. In a Loop Transformer, a group of weight-shared layers runs for multiple iterations, refining the hidden states from the previous pass — effectively deepening the network without increasing the parameter count. The idea itself is not new: the 2018 Universal Transformer proposed weight-shared depth, and recent work on recurrent depth has shown gains at small scales. Z.ai acknowledged that looped models trained from scratch have historically lagged behind unshared ones under the same pre-training compute budget.
Z.ai's answer was to skip training from scratch. Instead, the team adapted an already pre-trained base model into a Loop Transformer through continued training, which it says raises the intelligence ceiling with relatively small compute overhead. Specifically, GLM-5.4 loops 28 layers of the GLM-5 base model for two iterations at the 750-billion-parameter scale.
Three engineering changes made that practical, according to the blog post:
- Gated Progressive Updates. Directly overwriting hidden states across iterations causes activation norms to blow up. GLM-5.4 adds independent per-token gates for each iteration. After training, the first pass builds global context and writes conservatively, while the second pass opens the gates to write full updates — with harder tokens getting more aggressive first-pass writes.
- Hybrid KV Cache. Rather than keeping a full KV cache for every loop iteration, the model reuses the sparse KV selected in the first pass and retains a local sliding window for the new pass. An extra loop therefore costs one sliding window of cache rather than a full context cache, keeping deployment costs at 1M-token context lengths under control.
- Sparse Attention Index Reuse. The second loop reuses the attention indices generated by the first loop's indexer, adding zero indexing overhead. Z.ai reports this performs nearly identically to recomputing indices each pass.
What the Numbers Show
The company validated the architecture progressively across 1B, 4B, 30B, and 750B base models before committing its flagship. In a controlled iso-parameter comparison on a 30B model — identical parameter counts, with only about 10% more total training compute — the looped version showed clear gains, with the largest improvements in math, scientific reasoning, and long-context tasks.
Efficiency showed up in output as well. Across benchmarks including GPQA-Diamond and MMLU-Pro, average output length dropped 10–14%, mostly from shorter chains of thought — Z.ai's interpretation being that part of the reasoning shifts from explicit output tokens into the implicit depth of the loop. On throughput, the company says GLM-5.4 reaches up to 200 tokens per second during off-peak hours and maintains 70–80 tokens per second at peak load, the result of co-design between the model and Z.ai's inference infrastructure, including fused kernels and sparse index designs.
Z.ai was candid about one limitation: the model tends to get caught in overly long "marathon thinking" loops. The company notes that this prolonged reflection and self-correction does consistently improve accuracy beyond what the parameter count alone would suggest — but the token burn is real.
Generalized Coding: Code as the Universal Tool
The strategic framing around GLM-5.4 is Generalized Coding. Z.ai argues that large-scale software engineering, cybersecurity, 3D modeling, and physical control are all ultra-long-chain reasoning tasks that require following multi-step causal chains while maintaining global logical consistency — and that stacking parameters and memorizing data cannot solve them.
To demonstrate the range, the company showed the model writing code that generates and edits video (including a self-narrated music video titled "Hello World"), building a six-axis robotic arm through engineering-grade CAD modeling in FreeCAD, creating a complete game covering character movement, physics, maps, combat systems, and art assets, and generating an interactive 3D scene from pure mathematical geometry with custom GLSL shaders.
Availability, and What Comes Next
GLM-5.4 is available now through Z.ai's GLM Coding Plan, the ZCode development environment, and Z.ai Chat, with API access listed as coming soon. Notably, the company says it plans to release open weights — but only "after completing necessary safety hardening," a qualification that mirrors the staged release approach it has taken with earlier GLM models.
The blog post closes with a look ahead to two open questions: adaptive compute, where harder tokens would dynamically receive more loop iterations, and how the returns of looping behave as both loop count and model size keep growing. Z.ai says it is not choosing between scaling depth and scaling model size — and that its next, significantly larger model, informed by what GLM-5.4 has validated, "will be ready soon."
Whether looped architectures can deliver these gains at frontier scale is now testable in the open. If the community benchmarks back up the company's claims, GLM-5.4 could mark the most credible challenge yet to the assumption that capability comes only from parameter count.
---
Stay Ahead of AIGet the latest AI news, analysis, and breakthroughs — all in one place.
Read more AI news →