Notice: Black Friday 2026 × Cyber Monday: Get up to 30% extra on top-ups, DeepSeek free to use · View the promotion
Blog

News

GLM-5.4 API Explained: Specs, Win Rates, Loop Transformer Architecture, and Release Progress

GLM-5.4 is Z.ai's first Loop Transformer flagship model, supporting video, image, text, and file input with a 1M context. This article covers the specs, official win rates, architecture highlights, and API release progress, plus code for integrating GLM-5.3 today.

Nov 24, 2026
GLM-5.4 API Explained: Specs, Win Rates, Loop Transformer Architecture, and Release Progress
On this page

GLM-5.4 is the new flagship model released by Zhipu Z.ai in November 2026, and the first Z.ai flagship model built on the Loop Transformer architecture. It runs the 28 layers of the GLM-5 base twice, deepening reasoning without adding parameters, and the official claim is that its intelligence approaches that of 2T–3T parameter models. Input expands from text alone to video, images, text, and files, with a 1M context and 128K maximum output.

GLM-5.4 is already available to all GLM Coding Plan users, and the pay-as-you-go Model API will open after safety evaluation is complete. If you want to bring Zhipu's latest generation of capabilities into your product now, you can start with the same series' GLM-5.3; the code below is ready to run.

Cover generated with gpt-image-2/text-to-image on HiAPI, illustrating the Loop Transformer idea of "the same set of layers running twice".

GLM-5.4 specs at a glance

Comparison with the previous generation GLM-5.3 (sources: Z.ai official documentation GLM-5.4, GLM-5.3).

ItemGLM-5.4GLM-5.3
InputVideo, image, text, fileText
OutputTextText
Context length1M1M
Maximum output128K tokens128K tokens
ArchitectureLoop Transformer: the 28 layers of the GLM-5 base run twiceSame base as GLM-5.2; improvements come from post-training
ScaleBased on a 750B-scale base; intelligence approaching 2T–3T parameter models—
Thinking modeSupportedAlways on, with low / high / max levels
Streaming, function calling, context caching, structured outputSupportedSupported
Generation speedUp to 200 tokens/s off-peak, 70–80 tokens/s at peak—

The biggest change is on the input side: GLM-5.3 handles only text, while GLM-5.4 can read video, images, and files directly. Context and maximum output remain 1M and 128K, so how you work with long documents and large codebases does not need to change.

Win rates: wins more than half against GLM-5.3

Z.ai published head-to-head win rates for GLM-5.4 against three models:

OpponentGLM-5.4 winsTiesLosses
GLM-5.351.1%25.7%23.1%
Kimi K3.1 Pro41.8%26.9%31.3%
DeepSeek-V4.1-Flash-101736.6%30.2%33.2%
Win / tie / loss ratios for GLM-5.4 against GLM-5.3, Kimi K3.1 Pro, and DeepSeek-V4.1-Flash-1017. Source: Z.ai official

Against the previous generation GLM-5.3, GLM-5.4's win rate is more than double its loss rate. Against Kimi K3.1 Pro and DeepSeek-V4.1-Flash-1017, the win rates are also higher than the loss rates.

How the Loop Transformer works

In an ordinary Transformer, each layer runs only once per forward pass. A Loop Transformer lets a group of layers with shared weights run multiple times, with each pass continuing to refine the previous result. The network gets deeper while the parameter count stays the same.

GLM-5.4 architecture: the first 26 layers (Prelude) run once, layers 27–54, 28 layers in total, run twice, and the final 24 layers (Coda) run once. Source: Z.ai official

GLM-5.4 was not trained from scratch; it continues training on the pretrained GLM-5 base and is restructured into a loop. There are three key changes:

  • Gated progressive updates: each loop pass has its own per-token gate that writes updates back into the residual stream in proportion. The first pass builds global context and writes more conservatively; the second pass refines the output on that basis. On difficult tokens, the first pass writes more updates so that later refinement has more to work with.
  • Hybrid KV cache: the second pass reuses the sparse KV selected in the first pass and keeps only one extra sliding-window KV. An extra loop pass adds only one window of cache, so at a 1M context the extra deployment cost of GLM-5.4 over GLM-5.3 is limited.
  • Sparse attention index reuse: the second pass reuses the attention indices from the first pass directly, with no additional index overhead.

Z.ai ran a same-parameter-count comparison on a 30B model with the same architecture as the 750B base: using only about 10% more training compute, the loop version improved on all 5 benchmarks in the table, and output was shorter on most of them.

Score and average output length changes for the 30B comparison model before and after adding the loop (after 200K long-context SFT, with thinking mode on). Source: Z.ai official

The largest gains are in mathematics (AIME25 up 11.3 points), scientific reasoning (GPQA-Diamond up 8.7 points), and long context (AA-LCR up 7.3 points). Average output length on GPQA-Diamond, MMLU-Pro, and IFBench dropped 11.7%–14.9%, with some reasoning moving from explicit thinking tokens into the depth provided by the loop.

Z.ai also points out a known issue: GLM-5.4 sometimes enters excessively long thinking loops ("marathon thinking"). For latency-sensitive scenarios, it is worth measuring the time on real tasks after integration.

Generalized Coding: tasks beyond code

Z.ai positions GLM-5.4 as the starting point for "Generalized Coding": using a coding approach to complete tasks outside software development. The official blog gives three demos:

  • Video: write code to generate and edit a music video with its own narration, "Hello World".
  • Engineering: complete engineering-grade CAD modeling in FreeCAD and build a 6-axis robotic arm.
  • 3D: use only mathematical geometry and custom GLSL shaders to generate an interactive 3D macro birdwatching scene from scratch.

Z.ai attributes this generalization to simultaneous improvements in coding and vision capabilities.

Release progress

ChannelStatus (2026-11-24)Who it is for
GLM Coding PlanAvailable. In weekly-quota plans, GLM-5.4's quota is 1.5 times that of GLM-5.3Individuals and teams writing code in coding tools
Z.ai Model APIOpens after safety evaluation is completeDevelopers integrating the model into their own products

Pricing, release date, and the model name for the pay-as-you-go API are still awaiting official announcement; the pricing page does not yet list GLM-5.4. Z.ai has also not detailed the evaluation tasks behind the win-rate chart. We will update this article once that information is published.

Use Zhipu's latest capabilities now: start with GLM-5.3

If you want to bring Zhipu's flagship capabilities into your product now, GLM-5.3 is the most direct choice: also 1M context and 128K output, focused on complex software engineering and long-chain agent tasks. Use it to set up your call path first; switching to a new model later only requires changing the model name.

HiAPI's text models use the OpenAI-compatible Chat Completions interface. The request below is one we actually ran on 2026-11-24:

curl https://api.hiapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $HIAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3",
    "messages": [
      {"role": "user", "content": "Write a Python function that checks whether a string is a valid IPv4 address. Return only the code."}
    ],
    "reasoning_effort": "low"
  }'

This request took about 6.9 seconds, with 33 input tokens and 92 output tokens. The returned code was:

def is_valid_ipv4(address: str) -> bool:
    parts = address.split(".")
    if len(parts) != 4:
        return False
    for part in parts:
        if not part.isdigit():
            return False
        if len(part) > 1 and part[0] == "0":
            return False
        if int(part) > 255:
            return False
    return True

With the OpenAI Python SDK, point base_url at HiAPI and put the model name in your configuration:

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.hiapi.ai/v1",
    api_key=os.environ["HIAPI_API_KEY"],
)

# Keep the model name in config so you can switch models without code changes
MODEL = os.environ.get("GLM_MODEL", "glm-5.3")

resp = client.chat.completions.create(
    model=MODEL,
    messages=[{"role": "user", "content": "Summarize the main risks in this diff: `- timeout=30` `+ timeout=None`"}],
    reasoning_effort="high",
)
print(resp.choices[0].message.content)
print(resp.usage)

Three usage tips:

  • Choose the thinking level based on the task. GLM-5.3's thinking is always on; reasoning_effort accepts low, high, and max, with max as the default. We ran each once: the low request above used 0 thinking tokens and took about 6.9 seconds; the Python example using high to analyze a two-line diff used 1,230 thinking tokens, produced 1,557 output tokens in total, and took about 45.5 seconds. The prompts differ, but the effect of the level on latency and tokens is clear. For simple tasks, low is enough.
  • Put the model name in configuration. When switching models, change it in one place without touching code.
  • Use GLM-5.3 for text tasks. For now, video and image inputs go to other multimodal models.

For more parameters and usage, see the GLM-5.3 model page and the GLM-5.3 API guide.

FAQ

When will the GLM-5.4 API be available?

Z.ai's Model API will open after safety evaluation is complete. GLM Coding Plan users can already use GLM-5.4.

What is the difference between GLM-5.4 and GLM-5.3?

GLM-5.4 uses the Loop Transformer architecture, running the same set of 28 layers twice; GLM-5.3 keeps the GLM-5.2 base, with improvements coming from post-training. GLM-5.4 supports video, image, text, and file input, while GLM-5.3 supports only text. Both have a 1M context and 128K maximum output. In the official win-rate comparison, GLM-5.4 wins 51.1% and loses 23.1% against GLM-5.3.

How many parameters does GLM-5.4 have?

GLM-5.4 is based on the 750B-scale GLM-5 base and deepens the network through loops without adding parameters; Z.ai says its intelligence approaches that of 2T–3T parameter models.

How fast is GLM-5.4?

Official figures are up to 200 tokens/s off-peak and 70–80 tokens/s at peak.

Sources

Related articles

View all articles →

Start building with persistent AI artifacts

Get your API key and call image, video and audio models through one task-based API.

Read the API docs