Hugging FaceZ.AIAnnouncement
GLM-5.2: Built for Long-Horizon Tasks
Summary
GLM-5.2 is presented as a flagship model for long-horizon tasks, extending GLM-5.1’s capability to a solid 1M-token context for sustained engineering work. It was trained extensively on 1M-context coding-agent scenarios involving large-scale implementation, automated research, performance optimization, and complex debugging, and adds effort-level controls to balance capability, latency, and computational cost. Its architecture uses IndexShare, sharing one lightweight indexer across every four transformer layers and reducing per-token FLOPs by 2.9× at 1M context; MTP changes for speculative decoding increase acceptance length by up to 20%. On reported long-horizon and standard coding benchmarks, GLM-5.2 is described as the highest-ranked open-source model: it trails Opus 4.8 by 1% on FrontierSWE, ranks second only to Opus 4.8 on PostTrainBench, and scores 81.0 on Terminal-Bench 2.1 versus GLM-5.1’s 63.5.
Context
Long-horizon coding-agent work requires a 1M-token context that maintains quality and reliability across messy, extended trajectories, rather than merely accepting more tokens. Extending context also shifts inference pressure toward KV-cache capacity, long-context kernel overhead, CPU-side management, concurrency, and throughput under limited GPU resources.
Approach / What changed
GLM-5.2 expands 1M-context training for coding-agent scenarios, adds selectable effort levels, and uses IndexShare to share a lightweight indexer across four transformer layers. Its speculative-decoding MTP layer combines IndexShare, KV sharing, rejection sampling, and end-to-end TV loss. The inference engine adds finer-grained memory management and parallelization, long-context kernel and cache-transfer coordination, and CPU-side cache and scheduling optimizations.
Takeaways
IndexShare places one lightweight indexer at the first layer of each four-layer group and reuses its top-k indices, reducing indexer dot-product and top-k computation in three of the four layers.
An MTP ablation on GLM-5.1’s backbone and training data increased final-layer acceptance length from 4.56 to 5.47, a 20% improvement, after adding IndexShare, KV sharing, rejection sampling, and end-to-end TV loss.
GLM-5.2 weights are publicly available on HuggingFace and ModelScope, with local inference support listed for transformers, vLLM, SGLang, xLLM, and ktransformers.
Source and freshness
- Source
- huggingface.co
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.