What is GLM-5.4? Z.ai's Loop Transformer Model Explained
What is GLM-5.4? It's Z.ai's first flagship model built on a Loop Transformer, released on November 23, 2026. Instead of running every layer once, it runs a shared block of 28 layers twice per token, which gives a deeper network without adding parameters. Z.ai says the 750B-scale model reaches "intelligence levels comparable to 2T-3T parameter models." You can use it today through the GLM Coding Plan, ZCode and Z.ai Chat; the pay-as-you-go API is marked "Coming Soon" and open weights are planned for later.
What is GLM-5.4?
GLM-5.4 is a 750B-scale coding model from Z.ai that loops 28 layers of the GLM-5 base model for two iterations per forward pass. Z.ai built it by continued training of an existing base model, not from scratch. It supports a 1M-token context window, accepts images, and targets what Z.ai calls "Generalized Coding."
"Generalized Coding" means using code as the route into other work: the launch post shows GLM-5.4 coding a narrated music video, a 6-axis robotic arm in FreeCAD, a complete game and a GLSL-shaded 3D scene.
The short version for developers:
| Item | GLM-5.4 |
|---|---|
| Developer | Z.ai |
| Released | November 23, 2026 |
| Architecture | Loop Transformer (28 shared layers, 2 iterations) |
| Scale | 750B base |
| Context window | 1M tokens (glm-5.4[1m] in Claude Code) |
| Input | Text and images |
| Model name | glm-5.4 |
| Where to use it | GLM Coding Plan, ZCode, Z.ai Chat |
| API | Coming soon |
| Open weights | Planned, after safety hardening |
If you followed the previous release, our GLM-5.3 explainer and the GLM-5.3-Flash overview cover the models GLM-5.4 now sits beside on the Coding Plan.
How does a Loop Transformer work?
A Loop Transformer runs a group of weight-shared layers more than once per token, and each pass refines the hidden states the previous pass produced. In Z.ai's words: "In a standard Transformer, each layer runs once per forward pass. In a Loop Transformer, a group of weight-shared layers runs for multiple iterations." You get more depth and more compute per token at the same parameter count.
The idea isn't new. The 2018 Universal Transformer proposed weight-shared depth, and Thinking Machines Lab shipped Inkling 2 Mini three days earlier with its middle layers running three times per token. Z.ai's argument is about how you get there: looped models trained from scratch still trail unshared models at the same pre-training budget, so Z.ai converted an already-trained base into a looped one.
Z.ai's reasoning: memory-heavy tasks gain from more parameters, while reasoning-heavy tasks such as large refactors, security work and CAD gain from more compute per token.
What did Z.ai change to make the loop work at 750B?
Looping a trained model's middle layers breaks things in predictable ways. Z.ai made three changes:
- Gated progressive updates. Overwriting hidden states on every pass made activation norms blow up, so later layers saw inputs outside their usual range. GLM-5.4 adds a per-token gate for each iteration. After training, the first pass writes small, conservative updates to build context and the second pass opens the gate to refine. On harder tokens, the first pass writes more.
- Hybrid KV cache. A naive loop keeps a full KV cache per iteration, which doubles memory. GLM-5.4's second pass reuses the sparse KV picked in the first pass and keeps only a local sliding window of its own. An extra loop costs one sliding window, not a full 1M-token cache.
- Sparse attention index reuse. The base model uses sparse attention. The second pass reuses the first pass's attention indices, so it adds zero indexing work. Z.ai reports results "nearly identical" to recomputing indices every pass.
Z.ai says it validated the design on 1B, 4B, 30B and 750B base models before committing the flagship to it.
What do the results show?
Z.ai's controlled test used a 30B model with the same architecture as the 750B base. With identical parameter counts and about 10% more total training compute, the looped version beat the unlooped one. The post shows those results as charts and doesn't print a full benchmark table for the 750B model, so treat the claims below as Z.ai's until independent evaluations appear.
Two findings stand out:
- Longer reasoning chains gain the most. The biggest improvements were in math, scientific reasoning and long-context tasks.
- Fewer thinking tokens. On benchmarks such as GPQA-Diamond and MMLU-Pro, average output length dropped 10 to 14%, mostly from shorter chains of thought. Part of the reasoning moves into the loop's hidden depth instead of visible tokens.
Z.ai reports up to 200 tokens per second off-peak and 70 to 80 at peak load, helped by fused kernels.
Independent testers are only starting. Simon Willison tried GLM-5.4 on launch day through the Coding Plan and found its output "much more comparable" to OpenAI and Anthropic models than GLM-5.1 and 5.2.
What are GLM-5.4's limitations?
Z.ai names one limitation itself: GLM-5.4 "tends to get caught in overly long 'marathon thinking' loops." That self-correction improves accuracy, Z.ai says, but it burns time and output tokens on simple requests.
The practical limits right now:
- No pay-as-you-go API yet. The launch post lists the API as "Coming Soon."
- No open weights yet. Z.ai plans to release them "after completing necessary safety hardening," with no date.
- No independent benchmark table yet. The public numbers come from Z.ai's own 30B ablation.
- Coding Plan only works in supported tools. Z.ai's usage policy says the plan "may only be used within officially supported tools and products." Don't wire a Coding Plan key into your own backend.
How can you use GLM-5.4 today?
You can use GLM-5.4 today in three places: the GLM Coding Plan inside a supported coding agent, Z.ai's ZCode editor, or Z.ai Chat in the browser. The Coding Plan is the route most developers will take, and every tier (Lite, Pro and Max) includes GLM-5.4, GLM-5.3 and GLM-5.3-Flash.
According to Z.ai's model switching guide, each tool points at a different base URL:
| Tool | Base URL |
|---|---|
| Claude Code, Goose | https://api.z.ai/api/anthropic |
| Codex | https://api.z.ai/api/v1 |
| Cline and other OpenAI-compatible tools | https://api.z.ai/api/coding/paas/v4 |
In Claude Code, add these keys to ~/.claude/settings.json (merge them, don't replace the file):
{
"env": {
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.4[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.4[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.4[1m]"
}
}
The [1m] suffix turns on the 1M context window. Run claude, type /status and check that the model reads glm-5.4[1m]. Effort defaults to max; type /effort to lower it for quick edits, which also limits the marathon-thinking problem. Our GLM-5.3-Flash setup guide for Claude Code and Cline walks through the base configuration if you're starting fresh.
How much does GLM-5.4 cost?
The GLM Coding Plan starts at $18 per month, according to Z.ai's Coding Plan overview read on November 24, 2026. Each plan has a 5-hour and a weekly credit budget, and every model burns credits at its own rate.
| Plan | 5-hour credits | Weekly credits | GLM-5.4 tokens per week (95% cache hits) |
|---|---|---|---|
| Lite | 2,000 | 10,000 | 72M to 146M |
| Pro | 12,000 | 60,000 | 440M to 870M |
| Max | 28,000 | 140,000 | 1,014M to 2,028M |
The low end assumes all usage lands in peak hours (weekdays, 14:00 to 18:00 Singapore time); the high end assumes off-peak, when usage costs 50% of the standard rate.
The surprise is the credit rate. GLM-5.4 uses multipliers of 4.6 for input, 1.1 for cached input and 16 for output, against 6.9, 1.7 and 24 for GLM-5.3. That makes the newer, larger-acting model about a third cheaper per token on the plan than its predecessor.
Get your API test ready with Apidog CLI
The pay-as-you-go API isn't open yet, so this is the right moment to have a test waiting for it. Your coding agent can build one with Apidog CLI against GLM-5.3 on the regular Z.ai API today, then you change one field when GLM-5.4 lands. Keep it on an API platform key, not your Coding Plan key.
Set up the CLI and its agent skill:
npm install -g apidog-cli@latest
apidog login --with-token <YOUR_APIDOG_TOKEN>
npx -y skills add https://apidog.com # pick your agent when prompted
Then give your agent one prompt:
In Apidog project <projectId>, add an endpoint POST /chat/completions for the
Z.ai API at https://api.z.ai/api/paas/v4 with a Bearer token from the
ZAI_API_KEY environment variable. Create a test case that sends model
"glm-5.3" and one coding question, and asserts a 200 status, a non-empty
choices[0].message.content and a usage.completion_tokens field. Run it,
summarize the result, and keep the model name in an environment variable
so I can switch it to glm-5.4 when the API opens.
The agent checks the schema, writes the endpoint and case, and runs it:
apidog endpoint list --project <projectId>
apidog cli-schema get test-case-create
apidog cli-schema validate test-case-create --file glm-case.json
apidog test-case create --project <projectId> --file glm-case.json
apidog test-case run <caseId> --project <projectId> -e <envId> -r cli,json
When GLM-5.4 reaches the API, change the model variable and run the same case with -n 5 to compare latency and usage.completion_tokens across several runs. That's where you'll see whether the 10 to 14% shorter reasoning holds on your own prompts. The Apidog CLI in Claude Code guide covers agent setup, and the apidog run command reference lists every flag. Apidog's Free plan covers up to 4 users.
Conclusion
GLM-5.4 is Z.ai's bet on loop depth at 750B scale: 28 shared layers, two passes, and three engineering fixes that keep the extra memory and indexing cost of looping small. Z.ai's own numbers point to deeper reasoning with shorter visible thinking, and the Coding Plan charges about a third less per token for it than GLM-5.3. Try it in your coding agent today, watch for marathon thinking, and have an API test ready for when the endpoint opens.
FAQ
Is GLM-5.4 open source? Not yet. Z.ai says it plans to release the weights "after completing necessary safety hardening" and hasn't given a date.
Is the GLM-5.4 API available? Not on pay-as-you-go as of November 24, 2026. Z.ai lists the API as "Coming Soon." Today you reach GLM-5.4 through the GLM Coding Plan in supported tools, ZCode or Z.ai Chat.
What is a Loop Transformer? A Transformer that runs a block of weight-shared layers more than once per token, refining the hidden state on each pass. GLM-5.4 runs 28 layers twice, adding depth without adding parameters.
How big is GLM-5.4? Z.ai describes it as a 750B-scale model and claims intelligence "comparable to 2T-3T parameter models." That comparison is Z.ai's own and hasn't been independently tested yet.
What context window does GLM-5.4 support? 1M tokens. In Claude Code you enable it with the model name glm-5.4[1m], and in Cline you set the context window size to 1000000.
Can I use GLM-5.4 in Claude Code? Yes, with a GLM Coding Plan subscription. Point Claude Code at https://api.z.ai/api/anthropic and set the default models to glm-5.4[1m] in ~/.claude/settings.json.




Top comments (0)