Z.ai releases GLM-5.2, an open model built for long coding jobs
Z.ai's new GLM-5.2 model adds a stable 1M-token context and narrows the coding-benchmark gap with closed models like Claude Opus 4.8.
What Z.ai announced
In a blog post on Hugging Face, Z.ai introduces GLM-5.2, described as its latest flagship model for long-horizon tasks. The company says it marks a substantial leap in long-horizon task capability over its predecessor, GLM-5.1, and for the first time delivers that capability on what it calls a solid 1M-token context. Z.ai says it substantially expanded 1M-context training for coding-agent scenarios, covering large-scale implementation, automated research, performance optimization, and complex debugging, so that the model "must maintain quality across long, messy coding-agent trajectories, not just accept more tokens." The model ships under an MIT open-source license, which Z.ai describes as having no regional limits.
How it performs on long jobs
Z.ai reports GLM-5.2's results on three long-horizon coding benchmarks. On FrontierSWE, which measures whether an agent can complete open-ended technical projects spanning hours to tens of hours, GLM-5.2 trails Opus 4.8 by only 1% while edging out GPT-5.5 by 1% and Opus 4.7 by 11%. On PostTrainBench, where each agent gets an H100 GPU and is scored on how much it improves small models through post-training, GLM-5.2 outperforms both Opus 4.7 and GPT-5.5, ranking second only to Opus 4.8. On SWE-Marathon, an ultra-long-horizon benchmark covering tasks like building compilers and optimizing kernels, GLM-5.2 trails Opus 4.8 by 13% while remaining second only to the Opus series. Z.ai says GLM-5.2 is the highest-ranked open-source model across all three benchmarks.
Standard coding benchmarks
On standard coding benchmarks, Z.ai reports GLM-5.2 is the strongest open-source model, improving on GLM-5.1 by a wide margin: 81.0 versus 63.5 on Terminal-Bench 2.1, and 62.1 versus 58.4 on SWE-bench Pro. The company says this closes much of the gap to the closed-source frontier: on Terminal-Bench 2.1, GLM-5.2's score of 81.0 lands within a few points of Claude Opus 4.8's 85.0, while staying ahead of Gemini 3.1 Pro. GLM-5.2 also introduces effort-level control, letting users balance capability against speed and cost; Z.ai says its capability sits roughly between Claude Opus 4.7 and Claude Opus 4.8 at comparable token budgets, and that a "Max" effort level lets users spend more computation on harder tasks.
The 1M-context architecture
To support the 1M-token context, Z.ai applies a technique it calls IndexShare, which reuses the same indexer across every four sparse-attention layers. The company says this reduces per-token computation by 2.9 times at a 1M-context length. Z.ai also improved the model's MTP layer used for speculative decoding, which it says increases the acceptance length by up to 20%. Because GLM-5.2 extends the maximum context length from 200K to 1M tokens, Z.ai says coding workloads are expected to shift toward longer prompts, and it reports an increasingly larger throughput advantage as context length grows, which it attributes to optimizing memory management, kernel performance, and CPU-side scheduling in its inference engine.
Key facts
- GLM-5.2 is Z.ai's flagship model for long-horizon tasks, released under an MIT open-source license.
- It supports a stable 1M-token context, up from 200K, via a technique called IndexShare that cuts per-token compute by 2.9 times at that length.
- On Terminal-Bench 2.1, GLM-5.2 scores 81.0, up from GLM-5.1's 63.5, and within a few points of Claude Opus 4.8's 85.0.
- On SWE-bench Pro, GLM-5.2 scores 62.1, up from GLM-5.1's 58.4.
- On FrontierSWE, GLM-5.2 trails Opus 4.8 by only 1% while edging out GPT-5.5 by 1% and Opus 4.7 by 11%.
Why it matters
Z.ai is positioning GLM-5.2 as evidence that open-weight models can now sustain quality across long, multi-hour coding-agent sessions rather than just accepting a larger context window on paper. Because the model is MIT-licensed, teams that need to self-host or fine-tune a coding model without per-seat licensing can adopt it directly, and the benchmark gap Z.ai reports against Claude Opus 4.8 is now framed in single-digit or low double-digit percentage points rather than a wide margin.
Check your understanding
According to Z.ai, how much does the IndexShare technique reduce per-token computation at a 1M-token context length?
What scores does Z.ai report for GLM-5.2 versus GLM-5.1 on the Terminal-Bench 2.1 benchmark?