GLM-5.4: Z.ai Loops 28 Layers Twice for Deeper Reasoning

Z.ai's GLM-5.4 runs 28 layers of its 750B base twice per token. The Loop Transformer design, the 30B ablation evidence, and what independent tests say about speed.

PUBLISHED //
DURATION // 16 MIN READ
A looped ribbon of light folding back through a tall stack of glass layers in a dark studio, no text
FIG.01 // VISUAL DOCUMENTATION A looped ribbon of light folding back through a tall stack of glass layers in a dark studio, no text

On November 23, 2026, Z.ai released GLM-5.4, its new flagship model and the first one built on what the company calls a Loop Transformer. The headline is simple to state and hard to verify: a roughly 750-billion-parameter model that runs 28 of its layers twice per token, which Z.ai says reaches intelligence comparable to models with 2 to 3 trillion parameters. The release matters because it tests a different scaling bet. Instead of training a bigger model, Z.ai took an already trained base and made part of it deeper. Whether that trade holds up at flagship scale is the question this article works through, using the vendor documentation, a controlled ablation study Z.ai published, and the first independent test results.

What Z.ai shipped on November 23

GLM-5.4 is a coding-first flagship from Z.ai, the company also known as Zhipu AI. It is built on the GLM-5 base model, a mixture-of-experts design at roughly 750 billion total parameters. Z.ai has not published an active parameter count, so only a fraction of those weights run on any given token, and the exact fraction is unknown. The model supports a 1-million-token context window and up to 128,000 output tokens, and it adds vision input where the previous GLM-5.3 was text only. Z.ai’s model overview lists those capabilities alongside thinking mode, function calling, context caching, and structured output.

Access is subscription only for now. GLM-5.4 is live in Z.ai Chat, in ZCode, and for GLM Coding Plan subscribers, with weekly quotas 1.5 times those of GLM-5.3. The GLM Coding Plan starts at $18 per month. The model name is glm-5.4 in most tools and glm-5.4[1m] in Claude Code. A pay-as-you-go API is marked as coming after a safety evaluation, and Z.ai has published no API price. Open weights are planned after what the company calls safety hardening, with no date and no licence terms attached. As of November 23 there was no Hugging Face repository and no model card. That gap shapes everything else in this article: the model can be tried through a subscription, but it cannot yet be self-hosted, benchmarked from weights, or priced per token through an API.

Z.ai frames the release as the start of “Generalized Coding,” the idea that code becomes the route into work that is not software. The launch demos show the model writing code to produce a self-narrated music video, a 6-axis robotic arm modelled in FreeCAD, a complete game with physics and combat, and an interactive 3D bird-watching scene built from geometry and custom GLSL shaders. Demos prove that the model can produce such artefacts under controlled conditions. They say nothing about how often it succeeds on a first attempt, which is why the ablation study and the independent tests below carry more weight than the demo reel.

The release landed in a crowded week. Google had shipped Gemini 4 Neon days earlier, and the same stretch saw new models from OpenAI, Anthropic, DeepSeek, Kimi, and Mistral. Our Gemini 4 Neon guide covers the nearest comparable launch, a model that also targets coding work through subscriptions and editor integrations. GLM-5.4 stands apart from that group in one respect: it is the only flagship in the batch built on a looped transformer.

How the loop works: 28 layers, twice

A standard transformer is a fixed stack of layers. Each token passes through every layer once on its way to the next-token prediction. A loop transformer picks a block of layers and runs it more than once, reusing the same weights on each pass. Each pass starts from the hidden states the previous pass produced, so the model refines its work instead of widening it. The result is a deeper effective network with almost no extra parameters, since the only additions are small gating modules.

The architecture diagram in Z.ai’s documentation breaks the 78 stored layers into four groups. A prelude of layers 1 to 26 runs once and turns the input into the model’s internal representation, including projected features from a 24-layer vision encoder. Then the 28 looped layers, layers 27 to 54, run twice. A coda of layers 55 to 78 runs once and turns the final state into the next-token prediction. That adds up to 106 layer passes per token from 78 stored layers. Z.ai’s documentation describes the same structure in words: a group of weight-shared layers runs for multiple iterations, refining the hidden states from the previous pass.

Converting a trained model into a loop is not a matter of flipping a switch. Z.ai made three changes to keep it working at 750 billion parameters. The first is gated progressive updates. Overwriting hidden states on every pass makes activation norms grow across iterations, so later layers receive values outside the range they were trained on. GLM-5.4 adds an independent per-token gate for each iteration, controlling how much of a candidate update is written back into the residual stream. After training, the gates split the work on their own: the first pass builds global context and writes conservatively, the second pass opens the gates and writes full updates to refine the output, and the gates write more aggressively on the first pass for harder tokens.

The second change is a hybrid KV cache. A naive loop keeps a full key-value cache for every iteration, which multiplies memory cost with the loop count. At a 1-million-token context, that cost dominates serving. GLM-5.4 reuses the sparse KV selected in the first pass and keeps its own new KV only inside a local sliding window, so the extra loop costs one window of cache rather than a full second cache. The third change is sparse attention index reuse: the second loop reuses the attention indices generated by the first loop’s indexer, adding no indexing overhead, with results Z.ai says are nearly identical to recomputing the indices on every pass.

The lineage is older than this release. Z.ai credits the 2018 Universal Transformer for the idea of weight-shared depth, and notes that recent work on recurrent depth and looped language models showed gains at small scales. The difference this week is that two labs shipped looped models days apart at very different sizes. Thinking Machines Lab released Inkling 2 Mini on November 20, a 26.4-billion-parameter open-weights model that loops its middle layers three times per token. GLM-5.4 applies the same idea at roughly 750 billion parameters, inside a closed subscription product. The contrast is useful: one release tests whether looping works as a small open model, the other tests whether it works as a flagship.

Z.ai also explains why it converted a finished model instead of training a looped one from scratch. Looped models trained from scratch still lag behind unshared models under the same pre-training compute budget, according to the documentation. Converting the GLM-5 base through continued training was the cheaper route to the same depth, and Z.ai says it raises the intelligence ceiling with a relatively small compute overhead. That claim is testable in principle, and the ablation study is where Z.ai tries to support it.

The evidence Z.ai published: a 30B ablation, not flagship benchmarks

The most important fact about GLM-5.4’s launch is what did not ship with it. Z.ai published no model card and no benchmark figures for the flagship itself as of November 23, and a Z.ai team member said scores would come later. The headline claim, intelligence comparable to 2-to-3-trillion-parameter models, is a statement in the announcement, not a result in a table. DataCamp’s analysis puts it plainly: treat every number here as provisional until a benchmark table or a model card appears.

What Z.ai did publish is a controlled ablation at 30 billion parameters. Before committing the flagship to the loop architecture, the company validated the design progressively across 1B, 4B, 30B, and 750B base models. On a 30B model with the same architecture as the 750B base, it ran an iso-parameter comparison, meaning the looped and standard models had identical parameter counts and only the looping differed. With about 10 percent more total training compute, the looped version gained most on math, scientific reasoning, and long-context tasks. The efficiency finding runs in the opposite direction from what the flagship’s behaviour suggests: average output length dropped 10 to 14 percent across benchmarks including GPQA-Diamond and MMLU-Pro, mostly from shorter chains of thought. Part of the reasoning, in Z.ai’s words, shifts from explicit output tokens into the implicit depth of the loop.

That ablation is the cleanest evidence in the launch, and it is also limited. A 30B model is not a 750B model, and gains on graduate-level science questions do not predict gains on multi-file refactors or long agent runs. Z.ai also reports an internal 200-scenario comparison of GLM-5.4 against GLM-5.3, but the launch material gives no published tasks or rubric for it, so it cannot be rerun or checked. The honest reading is that looping improves a 30B model under controlled conditions, and that the flagship’s own scores are still missing. Anyone citing GLM-5.4’s capability from this launch should say which of those two things they are citing.

Z.ai does publish serving numbers. The model reaches up to 200 tokens per second during off-peak hours and holds 70 to 80 tokens per second at peak load, which the company credits to fused kernels that cut the memory reads and writes looping otherwise multiplies. Those are per-token throughput figures. They describe how fast the model emits tokens once it is generating, not how long a task takes end to end. That distinction matters, because the independent tests show the model spending far more tokens than its rivals on the same work.

One limitation comes from Z.ai itself. The documentation says the model tends to get caught in overly long “marathon thinking” loops, and adds that the prolonged reflection and self-correction still improves accuracy beyond its parameter count. A vendor disclosing a failure mode in its own launch post is worth noting, and it lines up with what independent testing found on timing.

Independent testing: a strong ranking reached the slow way

The first independent numbers come from AICodeKing’s KingBench 4 suite, reported by DataCamp. GLM-5.4 placed 7th overall and 1st among open models in that group, which also included Qwen4 Max, DeepSeek-V4.1-Flash, Kimi K3.1 Pro, and Mistral Large 4. The rest of the table shows what that placement cost in time and tokens.

MetricGLM-5.4Gemini 4 Neon
KingBench 4 rank7th overall, 1st open modelNot ranked in this comparison
Runtime431 minutes109 minutes
Reasoning steps1,128244
Tokens consumedAbout 1.04 millionAbout 70,000
Tool-call failure rate1.56% (11th of 17 models)Not reported
Failed calls recovered on retry66%Not reported

GLM-5.4 took roughly four times as long as Gemini 4 Neon, used nearly 15 times as many tokens, and took more than four times as many reasoning steps to finish the same suite. The pattern is consistent with the marathon thinking Z.ai disclosed: the model gets to an answer by thinking longer, not by emitting tokens faster. A 15-times token gap is a real cost if you pay per token, and it is a real delay if an agent harness has a default timeout. An online discussion after publication questioned which reasoning effort setting and which harness produced these numbers, so reproducibility is unsettled until a second harness repeats the run.

The tool-use numbers add a second dimension. A tool call is the model asking an external tool, such as a shell or an API, to do something. GLM-5.4’s tool-call failure rate was 1.56 percent, ranking 11th of 17 models tested, but it recovered 66 percent of failed calls through retries, more than any Claude or Codex model in that test. It fails more often and gives up less. One reviewer reported that GLM-5.4 surfaced application bugs and security vulnerabilities that Claude Fable 5.2 and other tested models missed, and now runs it in a pre-release council of reviewers rather than as a primary coding agent. That is a single reviewer’s experience, not a benchmark, but it points to the role where the model’s behaviour is an asset: a slow, thorough second reader that checks work other models produced.

The open-model ranking needs a qualifier. KingBench 4 placed GLM-5.4 first among open models, but its weights are not out. Until the safety hardening finishes and a Hugging Face repository appears, DeepSeek-V4.1-Flash is open in a way GLM-5.4 is not. The label describes behaviour against other models in the test, not a licence file. Readers planning a self-hosted deployment should treat GLM-5.4 as a subscription model for now. Our open-model comparison covers the field it is measured against, including Kimi K3 and the licensing questions that decide whether a model can actually be run locally.

Access, effort settings, and cost

Using GLM-5.4 today means working inside Z.ai’s subscription products. The GLM Coding Plan is the route, and it works in ZCode and other coding tools, with the model listed as glm-5.4 in most tools and glm-5.4[1m] in Claude Code. Z.ai’s Coding Plan documentation recommends setting the client context window to 512,000 tokens for better coding results, even though the model supports 1 million. The plan’s weekly quota for GLM-5.4 is 1.5 times that of GLM-5.3, and the plan starts at $18 per month. There is no per-token API price to compare against, which makes cost comparisons with other models provisional. Our GPT-6.2 pricing comparison shows how those comparisons look when both sides publish rates; for GLM-5.4, the subscription is the only price that exists.

The setting that matters most is reasoning effort. GLM-5.4 ships as a single model with effort settings that control how long it may think, rather than a size family, so the choice between settings matters more than usual. Z.ai’s Coding Plan documentation maps requests onto three real levels. Low covers low, light, minimal, none, and any request with thinking switched off. High covers medium and high. Max covers xhigh, max, and ultra, and also any request with no level set. In Claude Code, the /effort command sets the level, and skipping it runs at max. In AICodeKing’s security testing, the higher settings timed out while still reasoning and never produced an answer, while a mid-level setting completed the task.

The practical advice follows from that. Set the effort level explicitly and start at high. Test max only with a generous timeout, and expect it to burn the whole window without returning an answer on some tasks. Set a long timeout before running anything non-trivial, since a model that spent 431 minutes on one benchmark suite will hit default agent timeouts. GLM-5.4 was not listed in the OpenRouter catalog as of November 23, and its presence on Cursor, GitHub Copilot, Vertex AI, Azure AI Foundry, or AWS Bedrock could not be confirmed, because those sources do not enumerate GLM models. In OpenCode, the plan’s provider is zai-coding-plan, and the model is selected in the client configuration.

Method: what this analysis rests on

This article is a comparison of published material, not a test report. The architecture, the 30B ablation, the throughput figures, the access routes, and the effort-level mapping all come from Z.ai’s official documentation, updated November 23, 2026. The KingBench 4 ranking, the runtime and token figures, the tool-call failure and recovery rates, and the reviewer experience with security bugs come from DataCamp’s independent analysis, which reports one reviewer’s harness rather than a vendor table. The 1-million-token context and 128,000-token output figures are confirmed in launch coverage from November 25. Where those sources disagree or leave a gap, the article says so instead of picking the more flattering number. The 2-to-3-trillion-parameter equivalence claim is Z.ai’s own wording, and it is presented as a claim because no benchmark table supports it yet.

Readers can check the central claims directly. The documentation page lays out the loop architecture, the three engineering changes, and the ablation results. The KingBench 4 figures can be compared against the DataCamp writeup, which names the harness and the rival model in each row. Anyone with a Coding Plan subscription can reproduce the effort-level behaviour by setting /effort in Claude Code and watching whether max finishes a long task inside the timeout. What cannot be checked yet is the flagship’s own benchmark performance, its API price, and its open weights, because none of those have been published. Those three gaps are the reason this article treats GLM-5.4 as a promising design with provisional evidence rather than a proven flagship.

Our take: a second reviewer, not a default

GLM-5.4 is the first flagship-scale test of whether computational depth scales as well as parameter count, and the early answer is yes, but slowly. Converting a trained base into a looped model is a cheaper path to depth than training a larger model from scratch, and the 30B ablation shows the design working under controlled conditions. The loop’s engineering is specific and checkable: gated writes, a hybrid KV cache, and reused attention indices are concrete mechanisms, not marketing language. The marathon thinking is the other side of the same design. A model that refines its work by running layers twice will spend more tokens and more wall-clock time on hard tasks, and the first independent test shows that cost clearly.

For most teams, GLM-5.4 is not a default coding agent today. The subscription-only access, the missing API, the unsettled effort settings, and the 431-minute benchmark run all argue against making it the first model in the loop. The role it fits is the one the independent reviewer landed on: a second reviewer that checks work other models produced, where patience is a feature and a long think is cheaper than a missed vulnerability. Security review, pre-release audits, and long-horizon tasks with generous timeouts are the places to try it first. Front-end work and 3D development are not, despite the GLSL demo, since independent testing did not recommend the model for either.

Three things would change that assessment. Published benchmark scores for the flagship would let the 2-to-3-trillion-parameter claim be judged instead of quoted. A per-token API price would let teams compare the token-heavy behaviour against rivals on cost rather than on subscription quotas. Open weights would let independent labs rerun the tests and settle the reproducibility questions around the first harness. Z.ai says a significantly larger model built on these lessons is close. If that model ships with a benchmark table and an API, the loop transformer stops being an interesting launch and becomes a measurable option. Until then, GLM-5.4 is best understood as a depth-first experiment at flagship scale, with the evidence still catching up to the claim.