Z.AI flagship model guide

GLM-5.2

GLM-5.2 is Z.AI's flagship open-weight model for long-horizon engineering. It combines a solid 1M-token context, 128K maximum output, flexible thinking effort, and stronger coding-agent performance than GLM-5.1.

1M
token context window
128K
maximum output
MIT
open-weight license
Core capabilities

What Makes GLM-5.2 Different

The official release centers on usable long context, stronger coding, more efficient sparse attention, and unrestricted open-weight access.

Solid 1M-Token Context

Specialized training for large implementations, automated research, optimization, and debugging helps the model sustain long, messy engineering trajectories.

Advanced Agentic Coding

High and Max thinking-effort controls let developers trade latency and token use for stronger performance on demanding coding tasks.

More Efficient Architecture

IndexShare reduces indexer work across sparse-attention layers, while the revised MTP stack improves speculative-decoding acceptance length by up to 20%.

Pure Open Weights

The model is released under the MIT license without regional restrictions and supports Transformers, vLLM, SGLang, xLLM, KTransformers, and other runtimes.

Official benchmark graphics

Official GLM-5.2 Benchmark Results

All three benchmark graphics below are copied from Z.AI's official GLM-5.2 release and served locally on MyClaw.

Official GLM-5.2 long-horizon benchmark chart for FrontierSWE, PostTrainBench, and SWE-Marathon

Long-Horizon Coding Benchmarks

GLM-5.2 reaches 74.4 on FrontierSWE, 34.3 on PostTrainBench, and 13.0 on SWE-Marathon. Z.AI reports it as the highest-ranked open-source model across all three long-horizon evaluations.

Official GLM-5.2 coding benchmark chart covering Terminal Bench and SWE-bench Pro

Standard Coding Benchmarks

The model scores 81.0 on Terminal Bench 2.1 and 62.1 on SWE-bench Pro, up from GLM-5.1's 63.5 and 58.4 respectively, while landing close to closed frontier systems on terminal work.

Official GLM-5.2 effort-level performance and token-budget chart

Flexible Effort Levels

High and Max effort modes let users allocate more inference compute to hard tasks. The official comparison places GLM-5.2 between Claude Opus 4.7 and 4.8 at similar token budgets, with Max extending capability further.

Cost and scale

GLM-5.2 Pricing and Model Size

Official pay-as-you-go API rates sit beside the open-weight checkpoint footprint so you can compare hosted and local deployment paths.

Official GLM-5.2 API Pricing

Input / 1M Tokens
$1.40
Cached Input / 1M Tokens
$0.26
Output / 1M Tokens
$4.40

Z.AI lists prices in USD per 1M tokens. Cached-input storage is marked limited-time free on the official pricing page.

GLM-5.2 Model Size

BF16 Checkpoint
1.51 TB
Stored Parameters
~753B
License
MIT

Hugging Face reports a 1,506,659,919,872-byte BF16 checkpoint. About 753B stored parameters is an estimate from two bytes per BF16 weight; Z.AI does not publish a separate activated-parameter count for GLM-5.2.

Official architecture graphics

Architecture for a Solid 1M Context

GLM-5.2 combines cross-layer index reuse, a revised speculative-decoding stack, and long-context serving optimizations.

Official GLM-5.2 IndexShare architecture diagram

IndexShare Architecture

Every four transformer layers share one lightweight indexer. Z.AI says this cuts per-token FLOPs by 2.9× at 1M context and skips indexer dot-product and top-k work in three of every four layers.

Official GLM-5.2 MTP, IndexShare, and KVShare diagram

MTP With IndexShare and KVShare

The first MTP step supplies shared top-k indices and KV state to following steps, reducing draft-model cost and narrowing the training-inference mismatch that limited GLM-5.1 speculative decoding.

Official GLM-5.2 long-context serving throughput chart

Long-Context Serving Throughput

Finer memory management, cache-transfer coordination, long-context kernel work, and CPU scheduling produce a larger throughput advantage as context length grows.

MTP Acceptance-Length Ablation

In Z.AI's seven-step MTP experiment, IndexShare, KVShare, rejection sampling, and end-to-end TV loss raise acceptance length from 4.56 to 5.47, a 20% gain.

MTP Acceptance-Length Ablation
MethodAcceptance Length
Baseline4.56
+ IndexShare + KV Share5.10
+ Rejection Sampling5.29
+ End-to-End TV Loss5.47 (+20%)
Post-training system

Agentic RL and Anti-Hack Training

The official release also details the systems used to train longer trajectories without letting reward shortcuts corrupt the signal.

Slime for Agentic RL

The slime framework organizes white-box and black-box rollouts, compact trajectories, sub-agent workflows, and parallel OPD training. Z.AI says more than ten expert models were merged in roughly two days.

Long-Horizon RL With Compaction

A critic-based PPO formulation learns from individual rollouts and includes all compacted sub-traces, avoiding group-size assumptions when long tasks split into different numbers of trajectories.

Two-Stage Anti-Hack Guard

A rule-based filter first flags suspicious tool use, then an LLM judge checks intent. Invalid calls are blocked with dummy results while the rollout continues instead of discarding the whole trajectory.

Four-model score table

GLM-5.2 Vs GPT 5.5 Vs Opus 4.8 Vs MiniMax M3

Compare GLM-5.2 with GPT 5.5, Claude Opus 4.8, and MiniMax M3 across the reasoning, coding, and agentic benchmarks published by Z.AI.

GLM-5.2 Vs GPT 5.5 Vs Opus 4.8 Vs MiniMax M3
BenchmarkGLM-5.2GPT-5.5Claude Opus 4.8MiniMax M3
Reasoning
HLE40.541.4*49.8*37
HLE (w/ Tools)54.752.2*57.9*
CritPt20.927.120.93.7
AIME 202699.298.395.7
HMMT Nov. 202594.496.596.584.4
HMMT Feb. 202692.596.796.784.4
IMOAnswerBench91.083.5
GPQA-Diamond91.293.693.693
Coding
SWE-bench Pro62.158.669.259
NL2Repo48.950.769.742.1
DeepSWE46.2705820
ProgramBench63.770.871.9
Terminal Bench 2.1 (Terminus-2)81.0848565
Terminal Bench 2.1 (Best Reported Harness)82.783.478.9
FrontierSWE (Dominance, 2026-06-16)74.472.675.1
PostTrainBench34.328.437.2
SWE-Marathon13.012.026.0
Agentic
MCP-Atlas (Public Set)76.875.377.874.2
Tool-Decathlon48.255.659.9

GLM-5.2, GPT 5.5, Opus 4.8, and MiniMax M3 scores come from Z.AI's official GLM-5.2 table. An asterisk marks a full-set HLE score. Harnesses and evaluation settings can differ.

Where it fits

Best Workflows for GLM-5.2

The 1M context and long-horizon training matter most when an agent must preserve constraints and keep working across many dependent steps.

Project-Level Codebase Takeover

Load architecture, API contracts, tests, conventions, and historical decisions into one reasoning workflow before planning a large implementation or audit.

Long-Horizon Refactoring

Use the model for multi-file migrations, module decoupling, SDK adaptation, and cross-language changes that require planning, implementation, verification, and closure.

Research and Performance Engineering

Apply the long context to paper reproduction, automated research, kernel optimization, performance debugging, and experiments with large code and evidence footprints.

Production Agent Workflows

Combine tool calling, MCP, structured output, streaming, context caching, and explicit effort levels for durable agents that must follow hard engineering constraints.

GLM-5.2 FAQs

Run GLM-5.2 in a Hosted MyClaw Agent

Put GLM-5.2 to work with files, tools, browser-ready workflows, persistent memory, and an always-on managed runtime.

Run GLM-5.2 in MyClaw