AI
Z.ai GLM-5.4 Loop Transformer: Architecture, KingBench 4 Results, and Coding Plan Trade-Offs
Launched on November 23, 2026 on Z.ai's GLM Coding Plan, ZCode, and Z.ai Chat, GLM-5.4 is Z.ai's first flagship Loop Transformer—running 28 layers of the ~750B GLM-5 base twice per forward pass, adding vision input, and cutting Coding Plan credit multipliers by a third. Here is how the hybrid KV-cache loop works, why KingBench 4 took 431 minutes at Max effort, and what remains unconfirmed without public API pricing or open weights.
8 min read
Z.ai GLM-5.4 Loop Transformer: Architecture, KingBench 4 Results, and Coding Plan Trade-Offs
Executive Summary
- Core Release: On November 23, 2026, Z.ai (Zhipu AI) launched GLM-5.4, its first flagship model built on a Loop Transformer architecture, rolling out immediately to GLM Coding Plan subscribers, ZCode, and Z.ai Chat (DataCamp, CellCog).
- Architecture & Modalities: Instead of pre-training a larger base model from scratch, GLM-5.4 adapts the existing GLM-5 base (~750B total parameters per Z.ai's description; early-access testers reported ~700B) via continued training, running a block of 28 layers twice per forward pass while adding vision input and a
1M-token context option (glm-5.4[1m]). - Key Numbers & Caveats: Z.ai cuts Coding Plan credit multipliers by one-third (
4.6input /1.1cached /16output vs.6.9 / 1.7 / 24on GLM-5.3), delivering 50% more tokens per credit (Fello AI). However, as of November 23, 2026, Z.ai had published no official benchmark table, no model card, no pay-as-you-go API pricing, and no open weights. In independent testing by AICodeKing, GLM-5.4 scored 33.2/60 on KingBench 4 (7th overall, 1st among open-style models) but consumed 431 minutes and ~1.04M tokens at Max effort compared with Gemini 4 Neon's 109 minutes and ~70,000 tokens. - Primary Developer Takeaway: Set the reasoning effort level explicitly (
highfor reviews,lowfor small tasks) to avoid defaultmaxtimeouts, and deploy GLM-5.4 as a second-pass security or code reviewer rather than a primary low-latency coding agent until API pricing and open weights ship.
When frontier model families hit diminishing returns on parameter scaling, labs increasingly trade inference-time compute for architectural depth. Three days after Thinking Machines Lab introduced the local 26.4B looped model Inkling 2 Mini, Z.ai brought the same looped-depth thesis to flagship scale with GLM-5.4.
Architecture and How It Works: Looping 28 Layers Without Full KV Duplication
In a standard Transformer, every layer executes once per forward pass from input embedding to next-token prediction. In a Loop Transformer (a lineage tracing back to the 2018 Universal Transformer), a block of weight-shared layers executes multiple times per token so each pass refines the hidden states produced by the previous pass.
According to DataCamp and Fello AI, Z.ai noted that looped models trained from scratch still lag standard Transformers at equal pre-training compute. Instead, Z.ai converted the pre-trained GLM-5 Mixture-of-Experts base through continued training so 28 layers execute twice per forward pass—adding effective depth without adding full parameter blocks.
flowchart LR
Input["Input Tokens + Image Vision"] --> Pass1["Pass 1: 28 Weight-Shared<br/>GLM-5 Layers"]
Pass1 -->|"Small Gated Write +<br/>Sparse Attention Indices"| Cache["Hybrid KV Cache<br/>(Full Pass-1 + Sliding Window)"]
Pass1 -->|"Hidden States"| Pass2["Pass 2: Same 28 Layers<br/>Reused Weights + Indices"]
Cache -->|"Reused Context"| Pass2
Pass2 -->|"Full Gated Write"| Output["Output Token<br/>(Effort: low / high / max)"]Three Mechanisms Containing Serving Overhead
Naively looping a 1M-context Transformer would double Key-Value (KV) cache memory and trigger activation-norm blowups across passes. Z.ai's launch architecture addresses those bottlenecks with three mechanisms:
- Per-Token Gated Progressive Updates: Independent per-token gates regulate how much each pass writes back into the residual stream. After continued training, Pass 1 writes conservatively to build global context (writing more aggressively only on difficult tokens), while Pass 2 opens the gates to refine the final prediction.
- Hybrid KV Cache: Pass 2 reuses the sparse KV cache selected during Pass 1 and allocates fresh KV storage only across a local sliding window—capping the extra memory footprint at one sliding window rather than a second full 1M-token cache.
- Sparse Attention Index Reuse: Pass 2 reuses the attention indices already computed by Pass 1's indexer, adding zero indexing overhead while using fused GPU kernels to maintain up to 200 tokens/sec off-peak and 70–80 tokens/sec under peak load.
Configuring GLM-5.4 in Claude Code
On November 23, 2026, GLM-5.4 is live on the GLM Coding Plan (Lite starts at $18/month), ZCode, and Z.ai Chat (chat.z.ai). To route Claude Code to GLM-5.4 via Z.ai's Anthropic-compatible endpoint, Z.ai documents updating ~/.claude/settings.json with the 1M-context identifier glm-5.4[1m] (while Zhipu's Chinese guide recommends a 512000 compact window for tighter coding stability):
{
"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]"
}
}
Important: If no reasoning effort is specified, Z.ai's Coding Plan defaults to max. Use /effort explicitly in Claude Code (low maps from low/light/minimal/none; high maps from medium/high; max maps from xhigh/max/ultra).
Benchmarks, Effort Levels, and Coding Plan Cost Analysis
Confidence & Evidence Caveat: As of November 23, 2026, Z.ai had not published an official benchmark table, model card, Hugging Face repository, or pay-as-you-go API price for GLM-5.4 (the linked docs page returned 404 when checked by Fello AI at 13:37–13:40 UTC). Consequently, Z.ai's claim that GLM-5.4 matches "2T–3T parameter models" remains an unverified vendor claim backed publicly only by a controlled 30B iso-parameter ablation (where 10% more training compute raised AIME25 from 19.17 to 30.42, GPQA-Diamond from 47.58 to 56.26, and AA-LCR from 40.33 to 47.67).
GLM-5.4 vs. GLM-5.3 Feature & Pricing Comparison
| Attribute | GLM-5.4 (Nov 23, 2026) | GLM-5.3 (Aug 14, 2026) |
|---|---|---|
| Architecture | Loop Transformer (28 layers x2 pass) | Standard Transformer (1x pass) |
| Scale | ~750B total (vendor) / ~700B (testers) | Flagship MoE base |
| Modalities | Text + Vision (image input) | Text only |
| Context Window | 1M via glm-5.4[1m] (not in written spec) |
1M tokens (128K max output) |
| Coding Plan Credits (In / Cached / Out) | 4.6 / 1.1 / 16 per 10k units |
6.9 / 1.7 / 24 per 10k units |
| Weekly Token Estimate (Lite, 95% cache) | 72M–146M tokens/week |
48M–97M tokens/week |
| Pay-as-you-go API Price | Not published ("Coming Soon") | $1.40 in / $0.26 cached / $4.40 out per 1M |
| Open Weights | Not yet (promised after safety hardening) | Yes (GLM-5.3 License) |
| KingBench 4 (AICodeKing) | 33.2 / 60 (31.8 same-prompt) |
27.5 / 60 (partial build) |
Independent Effort-Level Telemetry (KingBench 4 & Small Tasks)
Early independent testing by reviewer AICodeKing illustrates why GLM-5.4's bottleneck is token volume ("marathon thinking") rather than token-per-second throughput. On the full KingBench 4 suite, GLM-5.4 took 431 minutes (1,128 reasoning steps, ~1.04M tokens) versus Gemini 4 Neon's 109 minutes (244 steps, ~70,000 tokens)—a roughly 15x token gap. Across all four effort levels:
| Effort Setting | KingBench 4 Score (out of 60) | 5 Small Tasks Passed | 5 Small Tasks Total Time |
|---|---|---|---|
| Low | 25.2 |
25 / 25 |
66 s |
| Medium | 24.1 |
24 / 25 |
175 s |
| High | 28.8 |
20 / 25 |
426 s |
| Max | 31.8 (33.2 with rerun) |
20 / 25 |
454 s |
On small tasks, both High and Max timed out at 180 s while still reasoning. Similarly, in a tool-calling evaluation across 17 models, GLM-5.4 posted a 1.56% tool-call failure rate (11th of 17) but recovered 66% of failed calls via retries—higher recovery than any tested Claude or Codex model.
Why "50% More Quota" Can Still Cost More on Max Effort
Because Coding Plan weekly credit caps remain unchanged (10,000 Lite / 60,000 Pro / 140,000 Max), the 1.5x quota boost comes strictly from lower credit multipliers. On a benchmarked 1M-input (95% cached) / 100K-output session at peak hours (Mon–Fri 14:00–18:00 UTC+8), GLM-5.4 costs 287.5 credits versus GLM-5.3's 436 credits. However, output tokens carry the highest multiplier (16), so if max effort generates 200K reasoning/output tokens instead of 100K, the session jumps to 447.5 credits—exceeding GLM-5.3's cost.
Production Deployment and Trade-Offs
- Use GLM-5.4 (
High) as a Second-Pass Reviewer: Independent testing found GLM-5.4 surfaced application bugs and security vulnerabilities that Claude Fable 5.2 missed, making it well-suited for pre-release security audits and multi-model review councils rather than interactive front-end or 3D generation. - Drop to
Lowfor Quick Fixes & CI Checks: Leaving/effortunset defaults tomax, which risks180 stimeouts and wasted output credits on routine edits. - Stay on GLM-5.3 or Alternative APIs for Production Services: Until Z.ai publishes per-token API pricing, official benchmarks, and Hugging Face weights, teams needing SLA-backed APIs, OpenRouter routing, or self-hosted weights cannot deploy GLM-5.4 in automated backend pipelines.
Frequently Asked Questions
1. Is GLM-5.4 open source as of November 23, 2026?
No. Although Z.ai stated it plans to release weights after "safety hardening," no release date, license, or Hugging Face repository existed as of November 23, 2026. The newest open-weight GLM releases remain GLM-5.3 and GLM-5.3-Flash.
2. How does GLM-5.4's Loop Transformer avoid doubling KV-cache memory?
GLM-5.4 uses a hybrid KV cache where the second pass reuses the sparse KV cache and attention indices from the first pass, allocating new KV storage only within a local sliding window.
3. Why is GLM-5.4 slower than Gemini 4 Neon if it outputs up to 200 tokens/sec?
Its bottleneck is reasoning length, not emission speed. In AICodeKing's KingBench 4 run, GLM-5.4 took 1,128 steps and ~1.04M tokens (431 minutes) compared with Gemini 4 Neon's 244 steps and ~70,000 tokens (109 minutes).
4. What is the difference between glm-5.4 and glm-5.4[1m]?
In Claude Code, glm-5.4[1m] activates the 1-million-token context window (paired with CLAUDE_CODE_AUTO_COMPACT_WINDOW: "1000000"), whereas other OpenAI-compatible clients use glm-5.4.
5. Which reasoning effort setting should I use on the GLM Coding Plan?
Set /effort explicitly: use low for small deterministic tasks and quick fixes, high as the everyday default for code and security reviews, and reserve max for long multi-file builds with generous timeouts.
Sources
- DataCamp (Secondary Technical Breakdown) — GLM-5.4: Z.ai's First Loop Transformer and the Push Toward Generalized Coding by Matt Crabtree: https://www.datacamp.com/blog/glm-5-4 (Published November 23, 2026)
- Fello AI (Primary Availability & Pricing Audit) — GLM 5.4: Z.ai's Loop Transformer, Access and Real Cost by Lenka Vojtechova (quoting
@Zai_org,@ZixuanLi_, and@aicodekingprimary posts): https://felloai.com/glm-5-4/ (Updated November 23, 2026) - AI/TLDR (Release Index) — GLM-5.4 — Loop Transformer, availability: https://ai-tldr.dev/models/glm-5-4/ (Updated November 23, 2026)
- CellCog (Verification & Confirmation Audit) — GLM-5.4 Is Out on Z.ai's Coding Plan: What Is Confirmed by Nitish Garg: https://cellcog.ai/blog/glm-5-4/ (Published November 23, 2026)