GLM-5 is a next-generation foundation model (744B total, 40B active parameters) designed to shift AI from simple human-prompted "vibe coding" to autonomous "agentic engineering." By combining DeepSeek Sparse Attention (DSA) with a fully decoupled, asynchronous reinforcement learning pipeline, GLM-5 achieves state-of-the-art performance on complex, long-horizon coding and agent benchmarks while drastically reducing computational overhead.
What Problem Does This Paper Address?
As Large Language Models (LLMs) transition from passive knowledge retrieval systems to active, autonomous agents, they face two primary bottlenecks: massive computational costs (especially when processing long contexts) and a lack of real-world adaptability.
Traditional static benchmarks (like the original SWE-bench) evaluate models on isolated, single-commit edits. However, real-world software engineering requires agents to operate continuously for hours—navigating massive codebases, invoking tools, interpreting terminal outputs, and iteratively correcting errors. Standard synchronous training methods cause severe GPU idle time during these long-horizon rollouts, making large-scale agentic training prohibitively expensive.
Methods
The authors introduce several architectural and infrastructure innovations to build GLM-5:
Model Architecture: A Mixture-of-Experts (MoE) model scaling to 256 experts (80 layers) with Multi-latent Attention (MLA). They introduce a "Muon Split" optimizer adaptation to ensure MLA updates at optimal scales, matching standard Grouped-Query Attention (GQA) performance.
DeepSeek Sparse Attention (DSA): Instead of using dense attention or rigid sliding windows, GLM-5 dynamically selects important tokens. This reduces long-sequence attention computation by 1.5–2×, allowing the model to handle 128K contexts at half the GPU cost. Crucially, DSA was integrated via continued pre-training from a dense base model rather than training from scratch.
Asynchronous RL Infrastructure ("slime"): To eliminate GPU idling during long agent rollouts, the training pipeline completely decouples the inference/generation engines from the training engines.
Stability Mechanisms: They implement a Token-in-Token-out (TITO) gateway, which feeds raw token streams directly to the trainer to avoid the subtle step-alignment corruptions caused by text re-tokenization. They also use Direct Double-sided Importance Sampling to stably clip tokens under asynchronous off-policy conditions.
Datasets
GLM-5 was pre-trained on a massive 28.5 trillion token corpus, followed by a mid-training phase that progressively extended context lengths up to 200K tokens using long-context agentic data.
The model was evaluated on a robust suite of open benchmarks, including Humanity’s Last Exam (HLE), SWE-bench Verified, SWE-bench Multilingual, Terminal-Bench 2.0, BrowseComp, MCP-Atlas, $\tau^2$-Bench, and Vending Bench 2.
Additionally, the authors utilized two automated evaluation environments:
CC-Bench-V2: An internal, fully automated suite assessing frontend, backend, and long-horizon tasks using an "Agent-as-a-Judge" approach (simulating user interactions via Playwright).
SWE-rebench: A dynamic pipeline that continuously mines fresh GitHub issues to prevent data contamination and ensure time-robust evaluation.
Key Insights and Ideas
Sparsity is Lossless: The successful transition to DSA proves that roughly 90% of attention entries in long contexts are redundant. Token-level sparsity can be introduced mid-training without degrading model quality.
Deterministic Top-K is Crucial for RL: While non-deterministic CUDA-based top-k operators work fine for standard inference, they cause severe performance and entropy degradation during RL. Forcing a deterministic torch.topk operator stabilized the DSA indexer selection.
Text-in-Text-out Destabilizes Agents: Re-tokenizing text generated during multi-turn agent rollouts introduces tiny whitespace or boundary mismatches. Consuming the exact token IDs produced by the inference engine (TITO) is essential for aligning actions with rewards.
Key Results
GLM-5 established itself as a leader among open-weights models, becoming the first open model to score a 50 on the Artificial Analysis Intelligence Index v4.0.
Figure 1: Results of GLM-5, DeepSeek-V3.2, Claude Opus 4.5, Gemini 3 Pro, and GPT-5.2 (xhigh)
on 8 agentic, reasoning, and coding benchmarks: Humanity’s Last Exam, SWE-bench Verified, SWE-
bench Multilingual, Terminal-Bench 2.0, BrowseComp, MCP-Atlas, τ 2-Bench, Vending Bench 2.
Key quantitative highlights from the evaluation include:
SWE-bench Verified: Achieved 77.8%, outperforming DeepSeek-V3.2 (73.1%) and Gemini 3 Pro (76.2%).
Vending Bench 2: Ranked #1 among open-source models with a final simulated business bank balance of $4,432, approaching Claude Opus 4.5 ($4,967).
Long-Horizon Exploration: On CC-Bench-V2's Large Repo Exploration task, GLM-5 scored 65.6% Pass@1, beating Claude Opus 4.5 (64.5%) due to its superior strategic search capabilities.
Limitations and Future Work
Despite its strong performance, the authors note that compounding errors remain a major hurdle in multi-step chained tasks. If an agent makes a suboptimal edit early in a long development chain, it can silently break tests in subsequent tasks. The team identifies long-context consistency and autonomous long-horizon self-correction as primary focuses for their ongoing research. Furthermore, they plan to migrate the inference backend directly into the training engine to uniformly leverage Multi-Query Attention (MQA) during teacher distillation phases.
@misc{glm5team2026glm,
author = {GLM-5-Team and Aohan Zeng and Xin Lv and Zhenyu Hou and Zhengxiao Du and Qinkai Zheng and Bin Chen and Da Yin and Chendi Ge and Chenghua Huang and Chengxing Xie and Chenzheng Zhu and Congfeng Yin and Cunxiang Wang and Gengzheng Pan and Hao Zeng and Haoke Zhang and Haoran Wang and Huilong Chen and Jiajie Zhang and Jian Jiao and Jiaqi Guo and Jingsen Wang and Jingzhao Du and Jinzhu Wu and Kedong Wang and Lei Li and Lin Fan and Lucen Zhong and Mingdao Liu and Mingming Zhao and Pengfan Du and Qian Dong and Rui Lu and Shuang-Li and Shulin Cao and Song Liu and Ting Jiang and Xiaodong Chen and Xiaohan Zhang and Xuancheng Huang and Xuezhen Dong and Yabo Xu and Yao Wei and Yifan An and Yilin Niu and Yitong Zhu and Yuanhao Wen and Yukuo Cen and Yushi Bai and Zhongpei Qiao and Zihan Wang and Zikang Wang and Zilin Zhu and Ziqiang Liu and Zixuan Li and Bojie Wang and Bosi Wen and Can Huang and Changpeng Cai and Chao Yu and Chen Li and Chengwei Hu and Chenhui Zhang and Dan Zhang and Daoyan Lin and Dayong Yang and Di Wang and Ding Ai and Erle Zhu and Fangzhou Yi and Feiyu Chen and Guohong Wen and Hailong Sun and Haisha Zhao and Haiyi Hu and Hanchen Zhang and Hanrui Liu and Hanyu Zhang and Hao Peng and Hao Tai and Haobo Zhang and He Liu and Hongwei Wang and Hongxi Yan and Hongyu Ge and Huan Liu and Huanpeng Chu and Jia'ni Zhao and Jiachen Wang and Jiajing Zhao and Jiamin Ren and Jiapeng Wang and Jiaxin Zhang and Jiayi Gui and Jiayue Zhao and Jijie Li and Jing An and Jing Li and Jingwei Yuan and Jinhua Du and Jinxin Liu and Junkai Zhi and Junwen Duan and Kaiyue Zhou and Kangjian Wei and Ke Wang and Keyun Luo and Laiqiang Zhang and Leigang Sha and Liang Xu and Lindong Wu and Lintao Ding and Lu Chen and Minghao Li and Nianyi Lin and Pan Ta and Qiang Zou and Rongjun Song and Ruiqi Yang and Shangqing Tu and Shangtong Yang and Shaoxiang Wu and Shengyan Zhang and Shijie Li and Shuang Li and Shuyi Fan and Wei Qin and Wei Tian and Weining Zhang and Wenbo Yu and Wenjie Liang and Xiang Kuang and Xiangmeng Cheng and Xiangyang Li and Xiaoquan Yan and Xiaowei Hu and Xiaoying Ling and Xing Fan and Xingye Xia and Xinyuan Zhang and Xinze Zhang and Xirui Pan and Xu Zou and Xunkai Zhang and Yadi Liu and Yandong Wu and Yanfu Li and Yidong Wang and Yifan Zhu and Yijun Tan and Yilin Zhou and Yiming Pan and Ying Zhang and Yinpei Su and Yipeng Geng and Yong Yan and Yonglin Tan and Yuean Bi and Yuhan Shen and Yuhao Yang and Yujiang Li and Yunan Liu and Yunqing Wang and Yuntao Li and Yurong Wu and Yutao Zhang and Yuxi Duan and Yuxuan Zhang and Zezhen Liu and Zhengtao Jiang and Zhenhe Yan and Zheyu Zhang and Zhixiang Wei and Zhuo Chen and Zhuoer Feng and Zijun Yao and Ziwei Chai and Ziyuan Wang and Zuzhou Zhang and Bin Xu and Minlie Huang and Hongning Wang and Juanzi Li and Yuxiao Dong and Jie Tang},
title = {{GLM-5: from Vibe Coding to Agentic Engineering}},
year = {2026},
eprint = {2602.15763},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2602.15763},
}