# GLM-5.4 explained: Z.ai's first looped flagship, its hybrid KV cache and what is confirmed

On 23 November 2026 Z.ai released GLM-5.4, its first flagship built as a loop transformer. It runs the layers of its GLM-5 base twice, adds image input and is live in the GLM Coding Plan, while the API and open weights are still to come.

On 23 November 2026, Z.ai released GLM-5.4, the newest model in its GLM family and its first flagship built as a loop transformer. Instead of adding more parameters, GLM-5.4 runs part of its network twice for each token. Z.ai says this lets a model at "the 750B scale" reach intelligence comparable to models with 2 to 3 trillion parameters. That is a company claim, and Z.ai has not yet published a benchmark table to support it.

The release matters for two reasons. First, it is the largest public bet so far on looping, an idea that until recently appeared mostly in small research models. Second, Z.ai has published engineering details about how it kept the extra depth affordable at long context. Those details apply to anyone serving long-context models, whether or not they use GLM.

This article explains what was released, how looping works, why a second pass normally makes the KV cache much bigger, and how Z.ai says it avoided that. It also separates what is confirmed from what is not.

## What happened

### Z.ai launches GLM-5.4 in its Coding Plan (23 November 2026)

Z.ai's Zixuan Li announced on X that "GLM-5.4 is now available to all GLM Coding Plan users". The model is also available in ZCode, Z.ai's coding client, and in Z.ai Chat. It adds image input, which Z.ai pitches for visual coding tasks. In Claude Code the model name is glm-5.4[1m], and in other tools it is glm-5.4.

Z.ai's developer documentation for the Coding Plan now says: "All plans support GLM-5.4, GLM-5.3 and GLM-5.3-Flash." Plans start at 18 US dollars a month and come in Lite, Pro and Max tiers. Usage is counted in credits. For GLM-5.4 the documentation lists credit multipliers of 4.6 for input, 1.1 for cached input and 16 for output. Off-peak use costs half the standard rate. Peak hours are Monday to Friday, 14:00 to 18:00 Singapore time.

Two things are not yet available. Pay-as-you-go API access is "coming soon", after a safety evaluation, with no date or price. Open weights are planned after "safety hardening", also with no date. When CellCog checked on launch day, Hugging Face still listed GLM-5.3 as Z.ai's newest open model.

### Z.ai's blog explains the loop design (23 November 2026)

Z.ai's launch blog post is titled "Toward Generalized Coding with Our First Loop Transformer". As reported by TestingCatalog and Let's Data Science, it says GLM-5.4 runs 28 layers of the GLM-5 base model for two iterations. The base was adapted by continued training rather than trained as a looped model from scratch. Three changes control the cost: per-token gates on what each pass writes, a hybrid KV cache, and reuse of sparse attention indices from the first pass.

Z.ai also reports results from a 30B test model with the same design. The looped version used about 10% more total training compute. The largest gains were in math, scientific reasoning and long-context tasks. Average output length fell 10 to 14% on most benchmarks, including GPQA-Diamond and MMLU-Pro. Z.ai reports serving speed of up to 200 tokens per second off-peak and 70 to 80 at peak load.

## How a loop transformer works

A normal transformer is a stack of different layers. Each token's hidden state passes through layer 1, then layer 2, and so on, once. Each layer has its own weights. To make the model "think harder" per token, the usual answer is to add more layers, which means more parameters, more memory and more cost.

A loop transformer reuses layers. After the hidden state leaves the looped block, it goes back in and passes through the same weights again. Two passes through 28 layers give the depth of 56 layers while storing only the weights of 28.

An everyday picture is proofreading. You can hire a second editor, which costs another salary. Or the same editor can read the draft twice. The second reading uses no new staff, but it does take more time, and the editor sees things the first reading missed.

The idea is not new. The 2018 Universal Transformer by Dehghani and colleagues applied the same block repeatedly and added a per-position halting mechanism. The Ouro models of 2025 brought looping into pretraining. Ouro's 1.4B and 2.6B models, trained on 7.7 trillion tokens, matched models up to 12B parameters on many benchmarks, according to their authors. The authors also found that the gains came from better use of knowledge, not from storing more of it. The site has covered two recent looped models in depth: [SenseNova Loop-9B](/articles/sensenova-loop-9b-looped-transformer), which runs 32 layers as 56, and [Inkling 2 Mini](/articles/inkling-2-mini-looped-laptop-moe), which loops a mixture-of-experts model small enough for a laptop.

### Why looping helps reasoning but not knowledge

Parameters store knowledge: facts, vocabulary, code patterns. Depth lets the model combine that knowledge in more steps before it must commit to the next token. Looping adds steps without adding storage. That is why Z.ai's 30B test showed the largest gains on math and science reasoning, where a few extra steps of internal work help most.

It also explains the shorter outputs. A model that can do more work inside each token may need fewer visible reasoning tokens to reach an answer. Z.ai measured average output length 10 to 14% shorter on most benchmarks. Fewer output tokens can offset part of the extra compute per token.

### Gated progressive updates

Running a block twice has a known risk. Each pass adds its output to the residual stream, the running sum that carries information between layers. If both passes write at full strength, the size of the activations can grow and training can become unstable. The site's article on [hyper-connections and residual streams](/articles/cmhc-hyper-connections-geometric-contraction) explains why this mixing is delicate.

Z.ai says GLM-5.4 gives each iteration its own per-token gates. In the first pass the gates write conservatively, to keep activation norms stable. In the second pass the gates open for full updates. Because the gates are per token, the model can in principle learn to write more on hard tokens and less on easy ones. This is a step towards adaptive compute, which Z.ai says it is now exploring.

## The KV cache problem and Z.ai's fix

Looping is cheap in weights but not, by default, in memory. To see why, recall how generation works. For every token in the context, every attention layer stores a key and a value vector, so the model does not recompute them. This store is the KV cache. The site's [KV cache page](/ai-simulations/kv-cache) and the [KV cache simulation](/ai-simulations/kv-cache) show how it grows with context length.

If a looped block runs twice, each pass computes its own keys and values. A naive design would therefore store two full caches for the looped layers. At a context of one million tokens, that can take a large share of GPU memory.

Z.ai describes a hybrid cache with two parts:

| Part of the cache | First pass | Second pass |
|---|---|---|
| Keys and values for long-range attention | Full sparse cache, as in GLM-5.3 | Reuses the sparse KV selected in the first pass |
| New keys and values from the second pass | Not needed | Kept only in a sliding window of recent tokens |
| Sparse attention index | Computed as usual | Reused from the first pass, no extra indexing |

In plain terms, the second pass reads the long-range memory that the first pass already built. It adds only a short window of its own fresh memory for nearby tokens. Z.ai says an extra loop therefore costs one sliding window of cache, not a full context cache, and keeps the cost increase over GLM-5.3 "modest" at 1M context.

An analogy: two readers share one set of notes on the whole book, and the second reader keeps only a sticky note for the current page. Neither has to copy the full notes.

### Why index reuse matters

The GLM-5 base uses DeepSeek Sparse Attention. Its Hugging Face card says this "largely reduc[es] deployment cost while preserving long-context capacity". In sparse attention, a light indexer first picks which past tokens each query should attend to. Then full attention runs only over those tokens. The site's [DeepSeek V4 guide](/articles/deepseek-v4-guide-sparse-attention-pricing) explains this indexer in detail.

Running the indexer twice would add cost. Z.ai says the second loop reuses the first loop's indices and that this performs "nearly identically" to recomputing them. This is plausible: both passes see the same tokens in the same order, so the most relevant past tokens are likely to be similar. But it is a company result, and no ablation table has been published yet.

### What the second pass still costs

Looping does not remove compute. Each token still passes through the looped layers twice, so the floating-point work per token for those layers roughly doubles. Z.ai says reaching 200 tokens per second needed close co-design with its inference stack and fused kernels. This is why the Coding Plan shows peak and off-peak speeds of 70 to 80 and up to 200 tokens per second.

Looping also does not shrink the weights. Self-hosting GLM-5.4, once weights are out, will still require storing a model at the 750B scale. Looping trades compute for memory, not the other way round.

## What is confirmed and what is not

Because the release came through a coding subscription first, many numbers are still missing.

| Item | Status on 24 November 2026 |
|---|---|
| Availability in GLM Coding Plan, ZCode, Z.ai Chat | Confirmed |
| Image input | Confirmed by Z.ai |
| Credit multipliers (4.6 input, 1.1 cached, 16 output) | Confirmed in Z.ai docs |
| Loop of 28 GLM-5 layers, two iterations | Z.ai blog, as reported |
| 2T to 3T equivalence | Company claim, no benchmark table |
| Pay-as-you-go API price | Not published |
| Open weights | Planned, no date |
| Official context window | Not stated in writing; the [1m] name suggests 1M |
| Flagship benchmark scores | Not published; Z.ai says they will follow |

Z.ai also names a limitation. The model sometimes falls into long "marathon thinking" loops. Z.ai says the extra self-correction still improves accuracy, but it costs time and credits.

## What it means in practice

**Looping has reached frontier scale.** Until now, looped models in the news were small: research models, laptop models and 9B-class models. GLM-5.4 is the first flagship from a major open-weight lab to ship this way. If its claims hold under independent tests, other labs will follow.

**For Coding Plan users, each credit now buys more tokens.** The docs list an output multiplier of 16 for GLM-5.4. Fello AI, comparing with GLM-5.3, reports 24 for the older model, so a credit buys about 1.5 times as many output tokens. Long reasoning runs can eat that saving.

**Prompt caching matters even more.** The cached-input multiplier of 1.1 is far below the input multiplier of 4.6. Z.ai's own quota estimates assume cache hit rates of 95% and above. Coding agents that keep a stable prompt prefix will get much more use out of a plan. The site's article on [coding agent context costs](/articles/context-price-coding-agents-prefix-caching) explains how prefix caching changes the bill.

**For self-hosters, wait.** Without weights, a published context window or an API, there is nothing to deploy yet. GLM-5.3 remains the current open option, covered on the site's [GLM-5.3 page](/tools/glm-5-3).

## What to do now

1. **Test it on your own tasks if you already pay for the plan.** Use the glm-5.4 model name in your coding tool and compare it with GLM-5.3 on a fixed set of tasks.
2. **Try both effort settings.** Long thinking helps hard builds but can run very slowly. Check whether a lower effort setting gives the same result on small tasks.
3. **Schedule heavy runs off-peak.** Off-peak use costs half the credits, and Z.ai reports higher output speeds off-peak than at peak load.
4. **Keep prompt prefixes stable.** Put system prompts and repository context first and unchanged, so cached-input pricing applies.
5. **Log thinking length.** Track output tokens per task to catch "marathon thinking" loops early and cap them in your harness.
6. **Wait for independent benchmarks.** Treat the 2T to 3T comparison as unproven until third parties publish results.
7. **Plan hardware before the weights arrive.** If you intend to self-host, budget for a 750B-scale model, plus a KV cache sized for your target context. The site's guide to [serving LLMs efficiently](/topics/generative-ai-llms/serving-and-cost) covers the options.
8. **Watch your serving stack.** Looped inference with a shared sparse cache needs engine support. Follow [SGLang](/tools/sglang) and [vLLM](/tools/vllm) release notes once the weights appear.

## Risks and open questions

**The headline claim has no table yet.** Z.ai says GLM-5.4 matches 2T to 3T-parameter models but has published no flagship benchmark scores. The only results so far are from the 30B test model and single early reviews.

**Extra compute may not always pay.** Looping doubles the work in the looped layers for every token. If the quality gain is small on a given task, the model is simply slower and costlier.

**Long thinking loops can waste budget.** Z.ai itself flags "marathon thinking". In an agent harness, a model that keeps re-checking its work can hit step or time limits.

**Index reuse may fail on edge cases.** Reusing first-pass sparse indices worked "nearly identically" in Z.ai's tests. It is unclear how it behaves on unusual inputs where the second pass should attend to different tokens.

**Release timing is open.** API pricing and open weights both wait on safety work with no date. Teams that need an SLA or self-hosting cannot plan around GLM-5.4 yet.

**Watch next:** Z.ai's promised benchmark results; the API price and context window; the open-weight release and its licence; independent scores from Artificial Analysis or LMArena; and the "significantly larger" next model that Z.ai says "will be ready soon".

## Frequently asked questions

### What is a loop transformer?

It is a transformer that runs some of its layers more than once for each token, reusing the same weights. This adds depth, and so more internal reasoning steps, without adding parameters. GLM-5.4 runs 28 layers of its base model twice, according to Z.ai.

### Is GLM-5.4 open source?

Not yet. Z.ai says open weights are planned after safety hardening but has given no date. Earlier GLM models, such as GLM-5, were released under the MIT licence, but Z.ai has not confirmed the licence for GLM-5.4.

### How can I use GLM-5.4 today?

Through the GLM Coding Plan, ZCode or Z.ai Chat. In Claude Code the model name is glm-5.4[1m], and in other tools it is glm-5.4. A pay-as-you-go API is "coming soon".

### Does looping make the model slower?

Each token passes through the looped layers twice, so compute per token rises. Z.ai says kernel and serving work keeps speed at up to 200 tokens per second off-peak and 70 to 80 at peak. Shorter outputs, which Z.ai measured in its 30B tests, can offset part of the cost.

### Why does the KV cache not double?

The second pass reuses the sparse keys and values the first pass selected. It keeps only a sliding window of its own new keys and values for nearby tokens. Z.ai says this means an extra loop costs one sliding window of cache rather than a full context cache.

## Summary

GLM-5.4, released by Z.ai on 23 November 2026, is the first flagship-scale loop transformer from a major open-weight lab. It runs 28 layers of the GLM-5 base twice to gain depth without new parameters. It uses per-token gates to keep the second pass stable, and a hybrid KV cache plus sparse index reuse to keep long-context memory close to GLM-5.3. It is live in the GLM Coding Plan with image input and lower credit costs per token. The API, open weights, context window and benchmark scores are all still pending, and Z.ai's claim of 2T to 3T-class intelligence remains unverified. For now it is worth testing if you already have the plan, and worth watching if you plan to self-host.

## Sources

- [Z.ai: Toward Generalized Coding with Our First Loop Transformer](https://z.ai/blog/glm-5.4)
- [Z.ai Developer Docs: GLM Coding Plan overview](https://docs.z.ai/devpack/overview)
- [TestingCatalog: Z.ai launches GLM-5.4, its first Loop Transformer model](https://www.testingcatalog.com/z-ai-launches-glm-5-4-its-first-loop-transformer-model/)
- [Let's Data Science: Z.ai launches GLM-5.4, its first Loop Transformer flagship](https://letsdatascience.com/news/zai-launches-glm-54-its-first-loop-transformer-flagship-7b50e4c7)
- [CellCog: GLM-5.4 is out on Z.ai's Coding Plan, what is confirmed](https://cellcog.ai/blog/glm-5-4/)
- [Fello AI: GLM 5.4, access and real cost](https://felloai.com/glm-5-4/)
- [Hugging Face: zai-org/GLM-5 model card](https://huggingface.co/zai-org/GLM-5)
- [arXiv: Universal Transformers](https://arxiv.org/abs/1807.03819)
- [arXiv: Scaling Latent Reasoning via Looped Language Models](https://arxiv.org/abs/2510.25741)
