· via dev.to (home feed)
Z.ai's GLM-5.4 loops 28 layers twice per token instead of adding parameters
Z.ai has launched GLM-5.4, a flagship model whose loop Transformer reruns 28 middle layers of its ~750B GLM-5 base for extra depth, claiming parity with far larger models as testers flag long agentic runs.

What Z.ai shipped
On November 23, 2026, Z.ai launched GLM-5.4, its first flagship model built on a loop Transformer rather than a bigger parameter count. According to a technical writeup on dev.to, Z.ai took its existing roughly 750B-parameter GLM-5 mixture-of-experts base and continued training it so that 28 middle layers execute twice per token pass. The company claims the extra pass brings reasoning parity with 2T to 3T parameter models, plus native vision input and a 50% boost to GLM Coding Plan weekly quotas.
Z.ai is marketing the model around "Generalized Coding," with launch demos that included a music video, a robotic arm scripted via FreeCAD's Python API, a physics-and-combat game, and an interactive 3D scene with custom GLSL shaders. As of launch day, though, there was no formal model card, no official 750B benchmark table, and no downloadable weights.
How the loop buys depth
In a standard decoder-only Transformer, each token passes through every layer exactly once. A looped Transformer runs a shared block of layers multiple times, refining hidden states before the output head — more effective depth at a fixed parameter count. Parameter reuse is not free compute, since the shared layers still execute again.
Z.ai's technical post, relayed through the dev.to writeup, concedes that looped models trained from scratch still lag standard ones under equal pre-training compute, which is why the company converted an already-trained base. Making a two-pass loop work at 1M-token context required three fixes:
- Per-token gated residual writes: the first pass learns small, conservative updates that establish global context, while the second opens the gates and refines more aggressively, preventing activation norms from exploding.
- A hybrid KV cache with sliding windows: the second loop reuses sparse key-value entries chosen during the first pass and keeps fresh entries only in a local window, keeping memory overhead near GLM-5.3.
- Sparse attention index reuse: the second loop reuses the attention indices computed by the first pass, adding no extra indexing overhead.
Z.ai also fused GPU kernels across the looped passes, reporting serving speeds of up to 200 tokens per second off-peak and 70 to 80 under peak load.
The evidence, and the catch
With no official 750B benchmarks, the cleanest controlled data is Z.ai's iso-parameter 30B ablation, in which a standard and a looped 30B model had identical parameter counts and the looped variant used roughly 10% more training compute. AIME25 math reasoning rose from 19.17 to 30.42, GPQA-Diamond from 47.58 to 56.26, and long-context AA-LCR from 40.33 to 47.67, with output lengths shrinking across the suite.
At full scale on agentic coding, the pattern inverts. Independent testers observed prolonged self-correction cycles that Z.ai itself calls "marathon thinking," and the dev.to writeup reports GLM-5.4 can take over four times as long and fifteen times as many tokens as competitors on agentic suites. On AICodeKing's KingBench 4 it ranked seventh overall, finishing in 431 minutes on roughly 1.04 million tokens, where Google's Gemini 4 Neon completed the suite in 109 minutes on about 70,000 tokens.
There is a sharp upside. DataCamp's review, cited by the writeup, found GLM-5.4 a strong code reviewer and security auditor that caught subtle bugs Claude Fable 5.2 missed, while cautioning against it as a primary front-end or 3D coding agent. On tool calling it failed 1.56% of calls initially, 11th out of 17 models, but recovered 66% of those failures through automatic retries, ahead of every Claude and Codex model in the test.
Access, weights and tooling
A second dev.to post focused on integration, and it draws a line between service access and open weights. GLM-5.4's weights are not yet available; Z.ai says it plans to release them after safety hardening, with no timeline given. At the time of that post's testing, the model was not reachable through a regular API subscription and required a Coding Plan key. Both plans share an OpenAI-compatible Responses API base address, which is easy to misread: the same endpoint does not grant the same model access. Tool support at test time was split, with llm-glm already updated and llm-zai not yet compatible.
The post also situates GLM-5.4 in a small trend of looped designs: Thinking Machines Lab's Inkling 2 Mini runs its middle layers three times per token, spending more compute per token rather than emitting more tokens — though that three-pass configuration is Inkling's, not Z.ai's.
Why it matters
Most of the 2026 frontier scaled parameter counts upward. GLM-5.4 bets on a different axis — reusing parameters for effective depth — and, by converting an existing base, sidesteps the pre-training penalty that has kept looped models behind. If Z.ai's parity claims survive independent benchmarking, looping could be a cheaper route to reasoning than ever-bigger networks.
The cost is time and tokens. Even at 200 tokens per second, "marathon thinking" can multiply wall-clock latency and token spend, which matters for agentic pipelines with budgets and timeouts. The practical takeaway is to match the model to the job — strong for review and security auditing, questionable where throughput dominates — and to keep availability and openness separate: GLM-5.4 is usable through subscriptions today, but it is not yet self-hostable and its official large-scale benchmarks are still outstanding.
- #ai
- #llm
- #transformer-architecture
- #z-ai
- #coding-agents