[KongchangAI]
· 2 min read· 1,343 words

GLM-5.4 Loop Transformer Tested: Full Guide to Claude Code Integration

GLM-5.4 Loop Transformer Tested: Full Guide to Claude Code Integration

Z.ai's GLM-5.4 loop transformer ranks high but costs significantly more compute.

Z.ai released GLM-5.4 on November 23, a ~750B-parameter loop transformer that passes requests through the same 28 layers twice, trading more compute for deeper reasoning. It claims parity with 2-3x larger models and supports million-token context and vision. Coding coverage extends to games, 3D shaders, and CAD, and coding plan quotas are up. Official benchmarks, public API, and open weights are still pending. It ranks 7th overall and 1st among open models on King Bench, but with much higher latency and token usage; max effort even timed out in a safety test. The article recommends high effort for daily use, max only for hard bugs, and provides setup steps for Claude Code and other tools.

Z.ai quietly released GLM-5.4 on November 23, and search interest spiked immediately. This new flagship coding model, with roughly 750 billion parameters, claims performance on par with models three times its size, supports a million-token context, and adds vision capabilities for the first time. What makes it most unusual is its architecture — it's Z.ai's first loop transformer, which sends a request through the same 28 layers twice, like rereading a difficult page of text, making the model "deeper" without adding weights, at the cost of more compute per response.

GLM-5.4 loop transformer diagram

Loop Transformer: Stronger Without Stacking Parameters

Traditional models pass a request through the network layers once and produce a result; GLM-5.4 has the same set of 28 layers process it twice. Z.ai claims this design delivers intelligence equivalent to models two to three times larger, and it's not simply parameter scaling — it's described as having the capability of a two-to-three-trillion-parameter model.

The trade-off is straightforward: each answer requires more computation. This also explains the "marathon thinking" phenomenon seen in the independent tests below.

The core idea of the loop transformer comes from a re-examination of the expressive capacity of deep networks: rather than increasing model capacity by adding independent layers, the same set of weights is called repeatedly, letting the network unfold deeper along a "time dimension." This approach is theoretically related to weight-sharing recursive structures, but a loop transformer typically performs only a fixed number of repetitions (e.g., twice) rather than true sequence recursion, making both training and inference easier to control. Its advantage is parameter efficiency — the same weights handle multiple rounds of computation, so the model doesn't need to store separate parameters for each layer; the cost is that inference must execute multiple forward passes serially, with latency and compute consumption growing linearly with the number of loops. Z.ai claims two loops are equivalent to a model two to three times larger in parameter scale; this claim awaits confirmation from official benchmarks, but the architectural direction itself reflects the industry's shift from "stacking parameters" toward "stacking compute."

Three New Capabilities and Three Gaps

New capabilities: First, vision — the model can now read images, which helps with visual coding tasks like screenshot comparison; second, expanded coding coverage, which Z.ai says now extends to video games, 3D shaders, and CAD modeling; third, weekly quotas for coding plan users are higher than during the GLM-5.3 era.

The parts not yet delivered are equally clear: official benchmark scores haven't been published; the public API will open only after safety evaluation; and there's no timeline for open weights.

The million-token context is key background for understanding GLM-5.4's positioning. The context window refers to the total number of tokens a model can hold in a single request; the million-token level means it can read in an entire medium-sized book or multiple files from a large code repository at once, which is especially practical for coding scenarios — the model can track call relationships and type definitions across files without losing prior context. But long context isn't free: attention computation grows quadratically with sequence length, and VRAM usage rises significantly, so supporting a million-token context often requires techniques like chunked attention and positional encoding extrapolation. In addition, the "1m" marker that appears in the configuration is used to explicitly enable this window; if not enabled, the context the model actually processes will be shorter than the nominal value.

Three Access Points and Developer Plan Rules

GLM-5.4 is currently available through the GLM coding plan, Z.ai's Z Code app, and the Z.ai chat interface. Developers should pay attention to the coding plan — the light, pro, and max tiers all include GLM-5.4, but there's one restriction: code must be within supported coding tools such as Claude Code, Kilo Code, Klein, Roo Code, and Open Code.

List of supported coding tools

Money-saving tip: off-peak calls (including all day on weekends) consume only half the usual credits.

Integrating GLM-5.4 into Claude Code

No changes to Claude Code itself are needed — just point it at Z.ai. Open settings.json in the .claude folder, fill in the Z.ai key and endpoint in the env section, then map all three of Claude's model slots to GLM-5.4; the 1m in parentheses enables the million-token context. After launching, type /status, and it should show GLM-5.4 as the current model; if it says the model doesn't exist, upgrade Claude Code first.

Configuration and effort settings

There's one key setting: under the coding plan, effort defaults to max and can be adjusted with /effort. For users who don't want to edit files manually, Z.ai provides a helper tool for automatic configuration. When using Open Code, Kilo Code, or Klein, most support the OpenAI format — select compatibility mode, paste Z.ai's coding endpoint, and enter the custom model name glm-5.4; check two extra options — enable image support (since the model can read images) and set the context window to one million.

The effort setting is a parameter in the coding plan that controls how much reasoning the model invests, analogous to a "thinking budget": when raised, the model generates more intermediate reasoning steps and tries more approaches before answering; when lowered, it's faster but may skip verification. Under the coding plan, GLM-5.4 defaults to max, meaning every request tends toward deep reasoning — one of the direct causes of the high time and token consumption seen in the independent tests below. Lowering everyday tasks to high essentially rebalances response speed against answer thoroughness; max is better suited to hard-to-reproduce bugs that require multi-path investigation. Note that effort and the loop transformer's two forward passes are two independent mechanisms: the former affects sampling and thinking length during inference, while the latter affects the network's own computational depth — only their combination fully explains the "marathon thinking."

Independent Testing: High Ranking, but at a Cost

With no official scores, third-party testing is the only option. On i Code King's King Bench, GLM-5.4 ranks seventh overall and first among open models. But the consumption required to achieve this is worth noting: in the same test, its runtime was far higher than the compared Gemini 4 Neon, and its token usage was about an order of magnitude higher — this is the "marathon thinking" problem, which Z.ai has acknowledged exists.

Timeout phenomenon in safety testing

In one safety test, the highest effort setting timed out while still thinking, whereas the medium setting completed the task. The practical advice, therefore, is: use high for everyday work, and reserve max for genuinely difficult bugs. Some reviewers report that GLM-5.4 found application bugs and security vulnerabilities that other models (including the mentioned Clawed Fable 5.2) missed — slow, but more thorough.

King Bench is a coding capability benchmark launched by the third-party evaluation platform i Code King. Unlike vendor self-reported academic leaderboards, it focuses more on overall performance in real coding tasks, so it's often used as a substitute reference when official benchmarks are missing. The leaderboard examines both accuracy and efficiency, but models may not be tested under uniform conditions such as effort settings and context length, so configuration differences should be noted when comparing across models. GLM-5.4 ranks seventh overall and first among open models here, showing it's competitive within the open-weight camp; however, token usage an order of magnitude higher means the actual cost per task could be several times that of comparison models — especially worth considering for pay-as-you-go users.

Buying Advice

When GLM-5.4 is a good fit: you want a budget-friendly, powerful model for Claude Code or Open Code and don't mind slower responses. When to hold off: you urgently need a public API, require fast responses, or need to see official benchmark data before trusting it. In one sentence: a loop model that thinks twice, integrates with Claude Code in two minutes, and performs best at high effort.

In the video's quiz, the correct answer about GLM-5.4's design difference is "run the same layers twice," and the safer effort setting for everyday coding is high.

#GLM-5.4#loop transformer#Z.ai#Claude Code#King Bench#coding model
Share:

Related articles