Inside GLM-5.4: How Looped Reasoning Changes AI Coding

A closer look at GLM-5.4's shared-layer architecture, published coding results, creative demos, and the practical trade-offs behind deeper computation.

By Cameron Voss & West Mao (pen name) · Reviewed November 23, 2026

In brief: GLM-5.4 adds computational depth by running 28 shared layers twice. Its published results make a case for studying that approach. Turning the extra computation into dependable work still depends on the task, the tools and the checks around the model.

For model comparisons and DSSUB access information, visit our GLM model architecture guide.

A coding model can produce a convincing first draft and still lose the thread halfway through a real project. A change to one module breaks another. A generated scene looks right from one camera angle and falls apart from the next. A mechanical assembly renders beautifully, yet its joints cannot move as intended.

These failures expose a demanding part of the job: keeping many related decisions consistent. GLM-5.4 approaches that problem by reusing a block of neural-network layers for a second pass. Z.ai calls the architecture Loop Transformer. Its broader ambition, which it describes as Generalized Coding, is to use code to create and manipulate things well beyond conventional software.

01 / The engineering problemWhy an extra pass might matter

Consider a request to build an interactive robot-arm demonstration. The agent needs a geometric model, a joint hierarchy, motion limits, a rendering setup and a script that keeps everything in sync. Each piece can look plausible on its own. The difficult part is making all of them agree.

One way to improve a model is to increase its parameter count. Another is to spend more computation working through the representations it already has. GLM-5.4 explores the second route while Z.ai continues to pursue larger models as well.

That distinction helps explain the release. Repeating a shared block increases the amount of processing a token receives without creating a separate set of weights for every repeated layer. The computation grows; the repeated block's parameter count stays the same. Hardware still has to execute the additional work.

Our reading is that the most promising workloads are those with linked constraints: repository changes, procedural scenes and tool-driven engineering tasks. That is an inference about where the design could help. A specific project still needs a direct comparison against the model it would replace.

02 / Under the hoodWhat happens inside the loop

Z.ai starts from a pretrained GLM-5 base and adapts it through continued training. Within the resulting model, a group of 28 layers runs for two iterations. The second iteration receives the hidden states produced by the first and processes them again using shared weights.

This is internal computation during a forward pass. It differs from asking a chatbot to review its answer in another turn, or running an agent through another round of tool calls. Those surrounding workflows can still exist; the architectural loop operates inside the model itself.

A simplified view of the repeated block
Two passes through a shared 28-layer block, supported by global sparse KV, a second-pass local KV window and shared attention indices.
Editorial schematic based on the published architecture. It shows shared computation and supporting state, rather than every component or tensor operation.

Repetition alone introduces problems. Hidden-state values can drift outside the range later layers expect. Keeping a full attention cache for every pass can consume too much memory. Selecting attention positions again adds another source of overhead. Three implementation choices address those issues.

Gates control how much each pass changes

A token-level gate regulates how much of a candidate update enters the residual stream. In Z.ai's account, the first pass generally makes conservative updates while establishing context; the second writes more of the refined representation. The first-pass update can also grow at harder token positions.

The gate matters because a pretrained network expects representations with particular characteristics. Adding another pass must preserve that stability while allowing useful changes to accumulate.

The cache shares distant context and keeps local refinements

The second pass reuses sparse KV information selected during the first. It also retains its own new KV entries within a local sliding window. This lets it read the earlier contextual representation alongside the updated local one.

The extra cache is therefore a sliding window rather than another full-context cache. That is a specific memory saving. It does not establish that a second pass is free, or that total inference memory stays unchanged.

Attention positions are selected once

The second iteration reuses the first iteration's sparse-attention indices. Z.ai reports nearly the same performance as recalculating them on every pass. The design avoids repeating the indexer's work while retaining another round of processing over the selected information.

03 / What the numbers establishSeparate the architecture experiment from the flagship evaluation

The original article contains two distinct kinds of evidence. One compares a 30B model with and without looping. The other reports GLM-5.4 preferences on 200 programming tasks. Combining them into a single headline would hide what each experiment actually measures.

The 30B experiment tests the architectural change

Z.ai describes a controlled comparison with matched parameter counts and approximately 10% more total training compute for the looped version. The reported evaluation follows long-context supervised fine-tuning at 200K, with thinking enabled.

Published 30B comparison · scores reproduced from the original article
BenchmarkBaselineWith loopScore ΔOutput length Δ
AIME2519.1730.42+11.25−635 tokens (−2.0%)
GPQA-Diamond47.5856.26+8.68−2,473 tokens (−11.7%)
AA-LCR40.3347.67+7.34−539 tokens (−9.7%)
MMLU-Pro71.6575.05+3.40−863 tokens (−14.9%)
IFBench50.2053.47+3.27−763 tokens (−13.0%)

Score deltas are calculated by subtracting the displayed baseline from the displayed loop score; they are absolute differences, not relative percentage gains. Output-length changes are the published figures. These are 30B experimental results, not GLM-5.4 flagship benchmark scores.

The improvement comes with a useful complication: the looped model often writes fewer tokens. Extra internal processing may reduce the amount of explicit reasoning text needed on those evaluations. That does not guarantee lower latency. Each generated token can require more computation, so output length and elapsed time need separate measurements.

The 200-task comparison measures reported preferences

The source article also presents Z.ai's win, tie and loss rates for GLM-5.4 against three models. These describe the provider's task set and judging process.

Provider-reported GLM-5.4 comparison · 200 programming tasks
OpponentGLM-5.4 winsTiesGLM-5.4 losses
GLM-5.351.1%25.7%23.1%
Kimi K3.1 Pro41.8%26.9%31.3%
DeepSeek-V4.1-Flash-101736.6%30.2%33.2%

Percentages are reproduced as published; rounding can leave totals slightly below 100%. The article does not provide a task-by-task record or enough judging detail to reconstruct this evaluation.

GLM-5.4 has more reported wins than losses in each row, although the margin against DeepSeek is narrow. A 36.6% win rate is not a 36.6% improvement in coding ability. Ties, task selection, tool configuration and judging criteria all affect the interpretation.

Keep the comparison in scope. Z.ai's broader claim that GLM-5.4 reaches the intelligence level of 2T–3T models is a provider assessment. The materials discussed here do not establish universal equivalence to every model in that parameter range.

04 / Beyond the code editorThe output is an artifact you can inspect

Generalized Coding makes more sense when you look at what the code controls. A scene has geometry and lighting. A video has timing and transitions. An assembly has dimensions and joints. Code gives the agent a way to express those decisions, run them and revise the result.

The release demonstrations explore that idea across several media. They show selected outcomes; they do not tell us how often a fresh attempt succeeds under a fixed budget.

01

Video as a programmable timeline

The “Hello World” music-video demonstration uses frontend code to draw its visuals. The source describes GLM-5.4 handling concept work, motion and rendering, while calling a separate music-generation model.

The useful distinction is orchestration: code can coordinate a production, while individual tools supply capabilities such as music synthesis.

02

A 3D scene built from geometry and shaders

The birdwatching demonstration uses mathematical geometry and custom GLSL shaders, with no external 3D models or textures in the described workflow.

Procedural construction can make an object easier to revise through parameters. It also gives the reviewer concrete things to check: geometry, shading, movement and performance across viewpoints.

03

Mechanical design across CAD and animation

The robotic-arm example moves from FreeCAD modeling to Blender visualization and motion. Its final sequence presents a six-axis arm performing a pickup.

A moving render demonstrates the presented scene. Manufacturing readiness would require further checks on tolerances, loads, collisions and the physical design.

04

Games that hold several systems together

Z.ai also describes complete-game creation spanning character movement, physics, maps, combat and art assets.

The interesting test is whether those systems keep working together after a change request. A playable initial scene is a useful start; consistent revisions are a stronger measure of engineering value.

These examples suggest a practical way to judge the category. Ask whether the agent leaves behind an editable artifact, whether it can make a targeted change without damaging other parts, and whether another person can continue the work.

05 / The cost of thinking longerTokens per second tell only part of the story

Z.ai reports speeds of up to 200 tokens per second off-peak and 70–80 at peak load. Those are provider-reported serving figures. The source does not give enough detail about hardware, concurrency and request shape to use them as a prediction for every session.

The company also acknowledges a tendency toward prolonged thinking. That can coexist with shorter average outputs in the 30B experiments: the experiment and the flagship are different evaluations, and an average does not describe every difficult request.

For a working developer, measure the time from submitting the task to accepting the result. Include the first-token delay, generation, tool execution, retries and human repair. A fast stream is useful. A task that needs fewer repairs may be worth a longer wait.

Measure the cost of an accepted result, including the attempts that failed.

A sensible comparison fixes the repository snapshot, instructions, tool permissions and completion criteria. Record elapsed time and usage across the whole run. Keep the failed attempts in the denominator. This reveals whether deeper computation saves work or merely moves the waiting time around.

06 / A useful first testEvaluate it on work you can verify

You do not need an elaborate benchmark to learn whether a model helps your team. A small collection of well-specified tasks can expose the difference between a good demonstration and a dependable workflow.

  1. Start with a known repository bug.Use a clean snapshot and a regression case with a clear pass condition. Check whether the fix solves the cause, preserves existing behavior and avoids unrelated edits.
  2. Add a change that crosses file boundaries.Ask for a feature involving UI, state and validation. After the initial implementation, change one requirement and check whether the model carries it through every affected layer.
  3. Try one artifact outside ordinary application code.Generate a small procedural scene or CAD assembly with explicit constraints. Open it in the intended tool, adjust a parameter and inspect the resulting behavior.
  4. Set the budget before the run.Give each model the same task and tool access. Record time, usage, retries and human corrections. Decide in advance what counts as acceptable completion.
  5. Repeat the tasks.A single success can be a useful example. Repeated runs reveal reliability, long delays and the kinds of errors that survive a self-review.

For generated visual work, keep the underlying files as well as the final render. Being able to inspect and revise the result is part of the value proposition. For engineering work, use the appropriate domain checks before treating the artifact as finished.

07 / Availability and next stepsWhat you can use, and what remains open

At the November 23, 2026 announcement, GLM-5.4 was available through the official GLM Coding Plan and products including ZCode. The launch information treated general API access and downloadable weights as subsequent steps.

Announced available

Official Coding Plan access

Announced for GLM Coding Plan users. Applicable product terms and quotas depend on the account and plan.

Announced available

ZCode and listed platforms

Named coding products provide access through their own supported configurations. A platform listing does not establish identical limits everywhere.

Pending at announcement

General API

Z.ai says API access follows safety review. Coding Plan availability alone does not establish general API availability.

Planned release

Downloadable model weights

Z.ai states an intention to release the weights responsibly. The announcement does not itself supply a downloadable checkpoint.

Two research questions remain especially interesting. Can the architecture allocate more iterations to harder token positions? And how do the returns change as both the base model and the number of iterations grow? The published GLM-5.4 design uses two passes; adaptive iteration counts are a future direction described by the team.

For developers, the next evidence to look for is less abstract: reproducible task results, completion-time distributions and editable outputs that survive further changes. GLM-5.4 gives the shared-layer approach a substantial real-world test. Its lasting value will depend on how reliably that extra computation turns into work people can use.

Questions, answered

Does looping double GLM-5.4's parameter count?

No. The repeated 28-layer block shares its weights across the two passes. Running it again adds computation without adding another independent copy of those weights.

Is the loop the same as an agent retrying a task?

No. The shared-layer loop runs inside the model's forward computation. An agent retry is a separate workflow step involving another model call, a tool action or both.

Do the 30B scores describe the flagship model?

No. They belong to a controlled architecture experiment at 30B scale. The provider-reported 200-task programming comparison is a separate evaluation of GLM-5.4.

Does shorter reasoning text guarantee a faster response?

No. Fewer generated tokens may reduce one part of the workload, while repeated internal computation increases work per token. Measure elapsed time and completion quality together.

Can I download the weights or call the general API?

At the November 23 announcement, the general API was pending and a weights release was planned. Confirm the current availability of the specific access method before building around it.

Editorial note: Architecture details, demonstration descriptions and evaluation figures are attributed to Z.ai's published material. Workflow advice and interpretation are editorial analysis. No independent model runs were conducted for this article. Availability statements are dated November 23, 2026.

← Back to news