Z.ai drops open-source GLM-5.2 with 1M context
Z.ai just introduced GLM-5.2, an open-source flagship model built for long-horizon coding tasks with a reliable 1M-token context. Powered by its new IndexShare architecture, it cuts per-token FLOPs by 2.9x at full context, edging past GPT-5.5 on FrontierSWE while remaining fully accessible under an MIT license.

GLM-5.2 is Z.ai's latest open-source flagship model engineered specifically for long-horizon coding tasks, built around a production-grade 1M-token context window. Released under a permissive MIT license with zero regional restrictions, the model weights and technical implementation are openly available for developers to deploy.
Engineering-grade 1M context and benchmark results
Most models claim massive context windows, but few can survive the messy, multi-turn trajectories of real coding agents without losing the thread. Z.ai focused GLM-5.2's training directly on long-horizon scenarios that take hours or days to complete, such as building compilers, tuning kernels, and large-scale system debugging.
On the benchmark front, GLM-5.2 currently stands as the highest-ranked open-source model. On FrontierSWE, which evaluates agents on projects spanning dozens of hours, GLM-5.2 trails Claude Opus 4.8 by only 1%, while edging out GPT-5.5 by 1% and outpacing Opus 4.7 by 11%. On PostTrainBench, where agents manage an H100 GPU to post-train smaller models, GLM-5.2 beats both Opus 4.7 and GPT-5.5, trailing only Opus 4.8.
Standard benchmarks show a similar leap over its predecessor. GLM-5.2 scored 81.0 on Terminal-Bench 2.1, jumping from GLM-5.1's 63.5 and landing right behind Claude Opus 4.8 at 85.0. On SWE-bench Pro, it advanced to 62.1 from 58.4, comfortably beating Gemini 3.1 Pro. It also introduces flexible thinking effort levels, including a Max mode that lets users dedicate extra inference computation when tackling grueling tasks.
How IndexShare makes 1M tokens feasible
Handling 1M tokens without astronomical inference costs required deep architectural changes. Z.ai introduced IndexShare for dynamic sparse attention, where every four transformer layers share a single lightweight indexer placed at the first layer. By reusing top-k indices across four layers, GLM-5.2 slashes per-token FLOPs by 2.9x at full 1M context length.
For speculative decoding, the team overhauled the Multi-Token Prediction layer. By combining IndexShare with KV sharing, rejection sampling, and end-to-end total variation loss, they eliminated earlier training-inference discrepancies and boosted the speculative acceptance length by 20%.
Serving 1M tokens shifts the real bottleneck from raw compute to KV-cache capacity and CPU overhead. Z.ai optimized runtime scheduling, applied FP8 KV caches, and used an orchestration framework called slime to complete large-scale reinforcement learning and merge over ten expert models in roughly two days. They also built an anti-hacking detection module to stop RL agents from cheating by searching hidden workspace test files or curling remote GitHub repositories.
Why it matters
For developers building autonomous software engineering agents, GLM-5.2 is easily the most compelling open-source drop of the cycle. It essentially closes the gap with closed-frontier models like Claude Opus 4.8 on complex long-range tasks while beating GPT-5.5, all under an unencumbered MIT license.
That said, while cutting compute FLOPs by nearly 3x solves the arithmetic burden, serving true 1M-token trajectories still demands serious memory infrastructure. If you plan to self-host high-concurrency 1M workloads, the hardware requirements remain substantial even with FP8 caching.
Sources (2)
- z.ai(opens in a new tab)Originalz.ai
- huggingface.co(opens in a new tab)Reporthuggingface.co