Z.ai releases GLM-5.4 with a 28-layer Loop Transformer
Z.ai released GLM-5.4, a Loop Transformer model that runs its 28 layers twice. It supports images and a 1M-token context, with API pricing unchanged from GLM-5.3.

TL;DR
- GLM-5.4’s API is live across Z.ai and partners, with GLM-5.3 pricing retained in Z.ai’s announcement.
- A shared 28-layer block runs twice at roughly 750B parameters, according to OpenRouter’s architecture description.
- Native image and video input replace GLM-5.3’s text-only input, as OpenRouter’s follow-up explains; context remains 1M tokens.
- Published numerical gains concern a 30B ablation in Z.ai’s technical post; CyouSakura reported internal evaluation improvements without scores.
Z.ai’s launch demos include a six-axis robotic arm built in FreeCAD and a bird-watching scene made with custom GLSL shaders. The company converted an already pretrained base through continued training, after finding that looped models trained from scratch trailed unshared models at equal pretraining compute.
What shipped
- Native API:
glm-5.4is available on Z.ai’s platform and across partners, per the API announcement. - Input price: GLM-5.3 → GLM-5.4 stays $1.40 → $1.40 per million tokens, 0% change, in Z.ai’s pricing table.
- Output price: $4.40 → $4.40 per million tokens, 0% change, in the same tariff.
- Cached input: $0.26 → $0.26 per million tokens, 0% change; cache storage is temporarily free under native pricing.
- Modalities: Text-only → text, images, video, and files; output remains text, according to the model documentation.
- Capacity: The specification lists a 1M-token context and up to 128K output tokens.
- Coding Plan: All users have access; weekly-quota plans receive 1× → 1.5× GLM-5.3’s allowance, +50%, according to the access documentation.
Benchmarks that moved
First-party
Z.ai’s controlled experiment compares unlooped and two-pass 30B models, with identical parameter counts and approximately 10% more total training compute for the looped version. Evaluation used thinking mode after what the company calls “200K long-context SFT.”
The scores below are transcribed from the official table in Locsic’s independent analysis:
- AIME25: 19.17% → 30.42%, +11.25 points, per Locsic’s transcription.
- GPQA-Diamond: 47.58% → 56.26%, +8.68 points, per the same transcription.
- AA-LCR: 40.33% → 47.67%, +7.34 points, per Locsic.
- MMLU-Pro: 71.65% → 75.05%, +3.40 points, per Locsic.
- IFBench: 50.20% → 53.47%, +3.27 points, per Locsic.
None of those five benchmarks measures coding. The flagship’s claimed equivalence to 2T–3T models comes without a named comparison model or a GLM-5.3 versus GLM-5.4 scorecard; CyouSakura separately reported improvements in internal evaluations without supplying numbers.
Third-party evaluators
The New Stack ran each model once per task with the same prompts and file, editing, and command tools. Its optimization score awards 10 points per speed doubling for each pipeline stage, with incorrect output scoring zero, according to the test methodology.
- Pipeline optimization, Sonnet 5.5 → GLM-5.4: 457.3 → 483.0, +25.7 points, with correct output on all six stages in The New Stack’s test.
Customer-reported
No scored customer comparisons accompanied the Databricks announcement or Vercel announcement.
Where it regressed
Z.ai acknowledges overly long “marathon thinking”, while saying the prolonged reflection and self-correction improves accuracy. Its native API documentation accepts only thinking.type: enabled.
The available negative measurements below compare Sonnet 5.5 → GLM-5.4, rather than successive GLM versions:
- Screenshot reconstruction: 153/153 → 147/153, −6 points, in The New Stack’s single-run comparison.
- Screenshot working time: 127 → 2,383 seconds, +2,256 seconds, in the same test.
- Pipeline optimization time: 103 → 2,226 seconds, +2,123 seconds, in the optimization run.
All six lost screenshot points came from three accented place names; the reviewer found chart geometry almost exact. GLM-5.4’s screenshot working time also excludes almost two hours waiting for its Coding Plan usage limit, according to the review.
On a larger SQLGlot repair task, the November 30 test exhausted its weekly subscription allowance after 202 turns, with two of 41 bugs fully fixed. The reviewer left that result explicitly unfinished; the December API opening subsequently added pay-per-token access.
teortaxesTex also criticized GLM-5.4’s overthinking while sharing a separate DeepSeek-V4.1 looping experiment. The attached efficiency chart measures that DeepSeek experiment.
Under the hood
The loop covers a middle block of the backbone. Locsic counts the execution path as 26 + 28 + 28 + 24: 78 → 106 layer executions per token, +28 executions, or approximately 35.9%, while noting that the passes have different costs.
Z.ai describes three architectural changes that make the retrofit work:
- Gated progressive updates. Independent per-token gates regulate each pass’s residual update, preventing activation scales from blowing up. The first pass writes conservatively while building global context; the second makes stronger refinements.
- Hybrid KV cache. The second pass reads sparse KV entries selected during the first pass and retains its own local sliding-window cache. Adding a pass therefore adds a window of cache rather than another full-context cache.
- Sparse-attention index reuse. The second pass reuses the first pass’s selected attention positions. Z.ai reports zero additional indexing overhead and nearly identical performance to recomputing the indices.
The gates vary update strength with token difficulty, but every token still takes two passes. Adaptive per-token iteration counts remain future work.
For native API calls, Z.ai’s published settings recommend temperature: 1, top_p: 0.95, reasoning_effort: max, and thinking.clear_thinking: false. Image input uses image_url blocks in messages[].content[], accepting URLs or Base64 data URLs.
Where it shows up
- Databricks: Day-zero serving uses its own GPUs and infrastructure, according to the rollout announcement.
- Vercel AI Gateway: The identifier is
zai/glm-5.4, as Vercel announced. Its changelog adds Zero Data Retention routing and agent setup throughnpx vercel ai-gateway setup. - Modal: Inference and post-training are available; its Model APIs page describes token billing, an OpenAI-compatible endpoint, and connections to Claude Code, Codex, and OpenCode.
- OpenRouter: The identifier is
z-ai/glm-5.4; its catalog exposes provider routing and failover. - Baseten: GLM-5.4 is available through Model APIs, with specifications and rates on its model page.
Published modality support differs by surface. OpenRouter advertises image and video input, while Modal’s API page lists text and images; Baseten’s model details also list text and images, although its overview mentions video and files.
Cached-input pricing differs too: Baseten lists $0.14 per million tokens, $0.12 less than the $0.26 charged by Z.ai and Modal.
Z.ai’s November 23 launch post promised public model weights after necessary safety hardening.