GLM-5.2 is now open-sourced, with its technical blog released simultaneously
744B MoE architecture with 40B activated parameters, 1M context window, licensed under MIT.
The model has been included in the GLM Coding Plan. Its corresponding API is launched synchronously with full access available, priced consistently with GLM-5.1.
In the highly anticipated coding domain, GLM-5.2 ranks second on Arena with a score of 1595, making it the most capable production-ready model on this coding leaderboard.
Given Gemini's underwhelming recent performance, it can be said that GLM has overtaken Gemini to secure a spot among the top three coding models.
Benchmark Overview
GLM-5.2 is purpose-built for long horizon tasks, featuring brand-new highlights as follows:
- Robust 1M context window to reliably support long horizon workloads
- More intuitive and practically capable coding performance
- Extreme infrastructure optimization, enabling day-zero deployment on domestic computing platforms
- Released under the MIT open-source license with eligibility for use by users in the United States
Long Horizon Tasks
All three benchmarks were tested under a 1M context window at maximum configuration with a 128K maximum output length. GLM-5.2 ranks first among all open-source models.
Long-Horizon Task Evaluation
FrontierSWE (20-hour complex engineering scenarios)
Opus 4.8: 75.1%, GLM-5.2: 74.4%, GPT-5.5: 72.6% — a gap of 0.7 percentage points.
PostTrainBench (Agent post-training task on a single H100 within 10 hours)
Opus 4.8: 37.2%, GLM-5.2: 34.3%, GPT-5.5: 25.0%
SWE-Marathon (long-cycle engineering work including compiler and kernel optimization)
Opus 4.8: 26.0%, Opus 4.7: 16.0%, GLM-5.2: 13.0%, GPT-5.5: 12.0%. Its score is roughly half that of Opus 4.8, placing it behind Opus 4.7.
Coding Evaluation
Across 8 coding and agentic benchmarks, GLM-5.2 remains the open-source SOTA, with substantial generational improvements over GLM-5.1.
LLM Performance Evaluation
Terminal-Bench 2.1: GLM-5.2 scores 81.0, versus 85.0 for Opus 4.8 and 84.0 for GPT-5.5 (GLM-5.1 scored 63.5)
MCP-Atlas: 77.0 vs 77.8. SWE-bench Pro: 62.1 vs 69.2. NL2Repo: 48.9 vs 69.7, showing the widest performance gap among these benchmarks.
Notably on HLE with Tools: GLM-5.2 achieves 54.7, outperforming Opus 4.8 at 52.3 and GPT-5.5 at 52.2.
Efficiency Curve
Average scores across Terminal-Bench 2.1, DeepSWE and SWE-Atlas tested on Claude Code:
GLM-5.2's High preset nearly overlaps with Opus 4.8's High preset at roughly 73%. At Max preset, GLM-5.2 reaches approximately 75%, while Opus 4.8 hits around 78%.
Compared with GLM-5.1, GLM-5.2 delivers an overall improvement of 15 to 20 percentage points across all effort tiers from Non-Thinking up to Max, marking a significant generational leap.
1M Context Architecture
To make the 1M context window practically viable for real-world engineering scenarios, GLM-5.2 has undergone systematic optimizations at both the model architecture and inference engine levels.
GLM-5.2 Architecture for 1M Context
IndexShare for DSA
One lightweight indexer is shared across every four transformer layers. The top-k indices are reused for the subsequent three layers, eliminating three-quarters of indexer dot-product and top-k computation overhead. IndexShare is enabled starting from the mid-training phase.
MTP with IndexShare and KVShare
Revised MTP layers are adopted for speculative decoding: the indexer is only instantiated in the first step, with top-k indices reused in subsequent steps. Consequently, the KV cache in the second step exclusively contains hidden states derived from the target model, resolving the train-inference mismatch present in GLM-5.1.
MTP Inference with IndexShare
GLM-5.2 demonstrates increasingly pronounced throughput advantages as context length scales up.
Agentic RL Training
The agentic RL post-training pipeline of GLM-5.2 covers larger scales, more diverse domains and more sophisticated execution paradigms. Long-horizon interaction, tool invocation, subtask decomposition and multi-turn environmental feedback impose stricter requirements on rollout execution and training orchestration. Two core modifications are introduced: first, the Slime framework unifies training and large-scale inference rollout; second, an anti-hack module is integrated to mitigate reward hacking prevalent in coding-oriented RL.
Slime Framework
Slime serves as an all-in-one infrastructure spanning training to large-scale inference rollout, supporting white-box / black-box rollout, compact trajectory storage and sub-agent workflows. GLM-5.2 leverages Slime for parallel OPD training, aggregating over ten expert models into the final unified checkpoint, with the entire OPD procedure completed in roughly two days.
Long-Horizon RL + Anti-Hack Mechanism
Execution trajectories for long-horizon tasks tend to be lengthy, and post-compaction sub-trajectories vary drastically in count and length. GLM-5.2 migrates from group-wise optimization to critic-based PPO, adopting token-level advantage estimation to accommodate variable-length sub-trajectories.
Coding RL is susceptible to reward hacking behaviors, such as accessing protected benchmark files, copying solutions from upstream commits, and directly fetching target code via curl commands. GLM-5.2 incorporates an anti-hack module featuring a two-stage detection pipeline (rule-based filtering + LLM judge). It intercepts hacking attempts online and returns dummy content to sustain rollout continuity instead of terminating execution.
Open-Source Access & Usage
Model weights are released under the MIT License, available on GitHub, Hugging Face and ModelScope. Major inference frameworks including vLLM, SGLang and Transformers have added native support.
- BigModel Open Platform: docs.bigmodel.cn/cn/guide/models/text/glm-5.2
- Z.ai: docs.z.ai/guides/llm/glm-5.2
- Technical Blog: z.ai/blog/glm-5.2