Source-linked AI summary
GLM-5: from Vibe Coding to Agentic Engineering
GLM-5-Team, :, Aohan Zeng, Xin Lv, Zhenyu Hou, Zhengxiao Du, Qinkai Zheng, Bin Chen, Da Yin, Chendi Ge, Chenghua Huang, Chengxing Xie, Chenzheng Zhu, Congfeng Yin, Cunxiang Wang, Gengzheng Pan, Hao Zeng, Haoke Zhang, Haoran Wang, Huilong Chen, Jiajie Zhang, Jian Jiao, Jiaqi Guo, Jingsen Wang, Jingzhao Du, Jinzhu Wu, Kedong Wang, Lei Li, Lin Fan, Lucen Zhong, Mingdao Liu, Mingming Zhao, Pengfan Du, Qian Dong, Rui Lu, Shuang-Li, Shulin Cao, Song Liu, Ting Jiang, Xiaodong Chen, Xiaohan Zhang, Xuancheng Huang, Xuezhen Dong, Yabo Xu, Yao Wei, Yifan An, Yilin Niu, Yitong Zhu, Yuanhao Wen, Yukuo Cen, Yushi Bai, Zhongpei Qiao, Zihan Wang, Zikang Wang, Zilin Zhu, Ziqiang Liu, Zixuan Li, Bojie Wang, Bosi Wen, Can Huang, Changpeng Cai, Chao Yu, Chen Li, Chengwei Hu, Chenhui Zhang, Dan Zhang, Daoyan Lin, Dayong Yang, Di Wang, Ding Ai, Erle Zhu, Fangzhou Yi, Feiyu Chen, Guohong Wen, Hailong Sun, Haisha Zhao, Haiyi Hu, Hanchen Zhang, Hanrui Liu, Hanyu Zhang, Hao Peng, Hao Tai, Haobo Zhang, He Liu, Hongwei Wang, Hongxi Yan, Hongyu Ge, Huan Liu, Huanpeng Chu, Jia'ni Zhao, Jiachen Wang, Jiajing Zhao, Jiamin Ren, Jiapeng Wang, Jiaxin Zhang, Jiayi Gui, Jiayue Zhao, Jijie Li, Jing An, Jing Li, Jingwei Yuan, Jinhua Du, Jinxin Liu, Junkai Zhi, Junwen Duan, Kaiyue Zhou, Kangjian Wei, Ke Wang, Keyun Luo, Laiqiang Zhang, Leigang Sha, Liang Xu, Lindong Wu, Lintao Ding, Lu Chen, Minghao Li, Nianyi Lin, Pan Ta, Qiang Zou, Rongjun Song, Ruiqi Yang, Shangqing Tu, Shangtong Yang, Shaoxiang Wu, Shengyan Zhang, Shijie Li, Shuang Li, Shuyi Fan, Wei Qin, Wei Tian, Weining Zhang, Wenbo Yu, Wenjie Liang, Xiang Kuang, Xiangmeng Cheng, Xiangyang Li, Xiaoquan Yan, Xiaowei Hu, Xiaoying Ling, Xing Fan, Xingye Xia, Xinyuan Zhang, Xinze Zhang, Xirui Pan, Xu Zou, Xunkai Zhang, Yadi Liu, Yandong Wu, Yanfu Li, Yidong Wang, Yifan Zhu, Yijun Tan, Yilin Zhou, Yiming Pan, Ying Zhang, Yinpei Su, Yipeng Geng, Yong Yan, Yonglin Tan, Yuean Bi, Yuhan Shen, Yuhao Yang, Yujiang Li, Yunan Liu, Yunqing Wang, Yuntao Li, Yurong Wu, Yutao Zhang, Yuxi Duan, Yuxuan Zhang, Zezhen Liu, Zhengtao Jiang, Zhenhe Yan, Zheyu Zhang, Zhixiang Wei, Zhuo Chen, Zhuoer Feng, Zijun Yao, Ziwei Chai, Ziyuan Wang, Zuzhou Zhang, Bin Xu, Minlie Huang, Hongning Wang, Juanzi Li, Yuxiao Dong, Jie Tang
TL;DR
GLM-5 addresses the computational-cost and real-world adaptability challenges that limit active problem-solving models. It uses DSA, asynchronous RL infrastructure and algorithms, and multi-stage training to improve efficiency and agentic capability. GLM-5 achieves state-of-the-art results on major open benchmarks and strong performance on long-horizon, end-to-end software engineering tasks.
Problem
Large language models face computational-cost and real-world adaptability bottlenecks, particularly in complex software engineering.
Method
GLM-5 combines DSA, asynchronous reinforcement learning infrastructure and algorithms, long-context training, and staged post-training for reasoning, coding, and agentic abilities.
Results
GLM-5 achieves state-of-the-art performance on major open benchmarks, about 20% improvement over GLM-4.7 across eight benchmarks, and strong long-horizon coding performance.
Takeaways & Limitations
GLM-5 demonstrates that an open-weight model can rival top-tier proprietary systems in complex, real-world workflows while serving as a more efficient foundation for AI agents.
Takeaways & Limitations
The gap between open-weight models and the absolute proprietary frontier is narrowing, but the race is far from over.
Abstract
from arXiv · showhide
We present GLM-5, a next-generation foundation model designed to transition the paradigm of vibe coding to agentic engineering. Building upon the agentic, reasoning, and coding (ARC) capabilities of its predecessor, GLM-5 adopts DSA to significantly reduce training and inference costs while maintaining long-context fidelity. To advance model alignment and autonomy, we implement a new asynchronous reinforcement learning infrastructure that drastically improves post-training efficiency by decoupling generation from training. Furthermore, we propose novel asynchronous agent RL algorithms that further improve RL quality, enabling the model to learn from complex, long-horizon interactions more effectively. Through these innovations, GLM-5 achieves state-of-the-art performance on major open benchmarks. Most critically, GLM-5 demonstrates unprecedented capability in real-world coding tasks, surpassing previous baselines in handling end-to-end software engineering challenges. Code, models, and more information are available at https://github.com/zai-org/GLM-5.
1 Introduction
GLM-5 targets the computational-cost and real-world adaptability bottlenecks facing active problem-solving models. It combines efficient attention, asynchronous reinforcement learning, and expanded training with strong benchmark and long-horizon coding results.
- GLM-5 addresses computational cost and real-world adaptability, especially for complex software engineering tasks.
- About 20% improvement over GLM-4.7 across eight agentic, reasoning, and coding benchmarks makes GLM-5 comparable to Claude Opus 4.5 and GPT-5.2 (xhigh).
- 50 on the Intelligence Index v4.0 makes GLM-5 the new open weights leader, up 8 points from GLM-4.7’s 42.
- GLM-5 is the #1 open model in both LMArena Text Arena and Code Arena, while overall performance is on par with Claude-Opus-4.5 and Gemini-3-pro.
- GLM-5 ranks #1 among open-source models on Vending-Bench 2 with a final account balance of $4,432 and improves over GLM-4.7 across CC-Bench-V2 task categories.
- The training pipeline combines a 27 trillion token corpus, context extension from 4K to 200K, sequential reasoning, agentic, and general RL, DSA, and asynchronous RL infrastructure and algorithms.
2 Pre-Training
GLM-5 combines long-context training, efficient attention, and architectural changes to improve scalability while preserving performance. DSA is positioned as the central efficiency mechanism, avoiding the quality losses observed with alternative efficient-attention designs.
- Model scaling: 28.5T total training tokens support a base model with 744B total and 40B active parameters, compared with GLM-4.5’s 355B total and 32B active parameters.The model uses 256 experts and 80 layers to reduce expert-parallelism communication overhead.
- DeepSeek Sparse Attention: DSA dynamically selects important tokens instead of applying dense O(L^2) attention, reducing long-sequence attention computation by roughly 1.5–2×.The approach is designed for 128K contexts while retaining long-context understanding and reasoning depth.
- DeepSeek Sparse Attention: DSA adaptation uses a 1,000-step warm-up followed by 20B tokens of sparse adaptation and matches the original MLA model’s long-context performance closely.The adaptation begins from the base model at the end of mid-training.
- Efficient attention ablations: Search-based SWA layer selection substantially outperforms fixed interleaving and generalizes across tested context lengths, while retaining full attention in selected layers.The pattern is searched at 16K context length using beam search and then applied to other input lengths.
- Efficient attention ablations: Efficient attention variants incur fine-grained retrieval losses of up to 5.69 points on RULER@128K and 7.33 on RepoQA@128K, whereas DSA is described as lossless.DSA’s indexer provides token-level sparsity without discarding long-range dependencies, allowing application to all layers without quality degradation.
- Efficient attention ablations: Full DSA training closes nearly all the residual RULER gap, surpassing baseline performance at 16K, 32K, and 64K while trailing by 0.35 points at 128K.The reported changes are +0.86 at 16K, +0.49 at 32K, +1.72 at 64K, and −0.35 at 128K.
3 Post-Training
GLM-5 uses progressive supervised fine-tuning and specialized reinforcement-learning stages to develop reasoning, coding, agentic, and human-aligned capabilities. Its asynchronous infrastructure addresses the inefficiency of long-horizon agent rollouts, while cross-stage distillation helps recover earlier skills.
- Progressive Post-Training: GLM-5’s post-training progresses from multi-task SFT through reasoning and agentic RL to general RL for human-style alignment.The SFT data spans General Chat, Reasoning, and Coding & Agent tasks, with distinct thinking modes and progressively specialized optimization.
- Thinking Modes: Three thinking modes support different interaction needs: interleaved thinking before responses and tool calls, preserved thinking across coding-agent turns, and turn-level control.These modes target instruction following, reasoning continuity, and latency-cost control across lightweight and complex tasks.
- Data and Behavior: Coding and Agent SFT uses execution environments, long-horizon real-world trajectories, expert reinforcement learning, and masked errors to teach error correction without reinforcing incorrect actions.Erroneous trajectory segments remain available as context but are excluded from the loss.
- RL Stability: A deterministic top-k operator stabilizes DSA reinforcement learning by resolving training-inference mismatch, whereas nondeterministic operators cause sharp entropy and performance declines.The deterministic implementation is slightly slower but produces more consistent outputs and substantial RL gains.
- Reasoning RL: The reasoning RL stage mixes mathematics, science, code, and tool-integrated reasoning, emphasizing difficult problems that stronger teacher models can solve.The supplied passage describes difficulty filtering and mixed-domain training across four reasoning domains.
- Asynchronous Agent RL: Asynchronous RL decouples inference from training through a Multi-Task Rollout Orchestrator, reducing GPU idle time during long-horizon coding and search-agent rollouts.The framework enables high-throughput joint training across diverse agentic workloads.
4 Agentic Engineering
GLM-5 shifts coding toward autonomous agentic engineering through asynchronous, decoupled reinforcement learning and specialized environments. Context management and selective reward refinement support longer, more stable agent workflows.
- Asynchronous Reinforcement Learning: Group-wise policy optimization samples K agent traces from the previous policy and optimizes the current policy using model-generated tokens.Environment feedback is ignored in loss computation.
- Asynchronous Reinforcement Learning: Asynchronous RL decouples generation and training to reduce rollout bubbles, GPU idle time, and post-training bottlenecks.Inference continuously generates trajectories, while training updates batches after a threshold and periodically synchronizes weights.
- Training Stability: Asynchronous training reuses rollout log-probabilities for token-level importance sampling, accepting controlled off-policy bias while improving training stability.This avoids maintaining extensive historical policy checkpoints and masks tokens outside the clipping interval.
- Agent Environments: GLM-5 constructs executable environments for coding and content-generation workflows, including real-world software issues and synthesized terminal-agent tasks.The infrastructure supports diverse agentic tasks and multi-task rollout orchestration.
- Context Management: Keep-recent-k folds observations older than the latest five interaction rounds, improving GLM-5 from 55.3% to 62.0%.The strategy controls context length while preserving recent interaction history.
- Context Management: The combined context-management strategy reaches a final score of 75.9 across compute budgets, outperforming open-source models equipped with context management.It consistently improves over Discard-all alone.
- Slide Generation: A multi-level reward design for HTML-based slide generation raises strict 16:9 compliance from 40% to 92% and yields a 67.5% overall human-evaluation win rate over GLM-4.5.Win rates are 60% for content quality, 57.5% for layout rationality, and 65% for visual aesthetics.
5 Adapting GLM-5 to Chinese Chip Infrastructure
GLM-5 is adapted across seven mainstream Chinese chip platforms through full-stack optimization. Hardware-aware quantization, kernels, scheduling, caching, and parallelism improve deployment efficiency for long-context inference.
- Platform Adaptation: GLM-5 achieves full-stack adaptation across seven Chinese chip platforms, including Huawei Ascend, Moore Threads, Hygon, Cambricon, Kunlunxin, MetaX, and Enflame.The optimization spans underlying kernels through upper-level inference frameworks.
- Model Compression: W4A8 mixed-precision quantization uses W8A8 for Attention and MLP blocks and W4A8 for MoE experts to reduce memory footprint without significant accuracy loss.The strategy fits the 750B-parameter model onto a single Atlas 800T A3 machine.
- Kernel Optimization: Custom fusion kernels optimize sparse attention by combining index, TopK, attention, and preprocessing operations for greater computation and memory efficiency.The kernels include Lightning Indexer, Sparse Flash Attention, and MLAPO.
- Inference Optimization: Inference-engine adaptations use asynchronous scheduling, context caching, and hybrid attention/expert parallelism to improve hardware utilization.The adapted engines are vLLM-Ascend and SGLang.
- Deployment Results: 50% lower deployment cost in long-sequence scenarios is achieved on a single Chinese node while matching the performance of dual-GPU international clusters.Multi-Token Prediction also increases NPU computation density and reduces sequence generation time.
6 Evaluation
GLM-5 improves over GLM-4.7 across agentic, reasoning, coding, and real-world engineering evaluations, reaching state-of-the-art open-source performance. End-to-end coding tests show strong build and check-item completion, but an instance-level gap remains against Claude Opus 4.5.
- ARC Benchmarks: GLM-5 delivers significant ARC-benchmark gains over GLM-4.7 and state-of-the-art performance among open-source models, narrowing the gap with proprietary systems.The benchmark suite covers agentic, reasoning, and coding capabilities.
- Coding Benchmarks: GLM-5 reaches state-of-the-art open-source coding performance, outperforming Gemini 3 Pro on SWE-bench Verified and beating Gemini 3 Pro and GPT-5.2 on SWE-bench Multilingual.Its Terminal-Bench 2.0 results are comparable to Claude Opus 4.5 and improve when ambiguous instructions are fixed.
- Agentic Benchmarks: GLM-5 significantly improves on agentic benchmarks, leads frontier models on BrowseComp, and matches Claude Opus 4.5 on three tool-use tasks.The evaluated tasks include browsing, tool use, and long-horizon business operation.
- Real-World Engineering Evaluation: Agent-as-a-Judge verdicts agree with human experts on 94% of sampled check-items, with disagreements concentrated on subjective visual-quality criteria.CC-Bench-V2 combines static verification with interactive GUI-agent testing.
- Real-World Engineering Evaluation: 98.0% BSR shows reliable project execution, while a persistent ISR gap versus Claude Opus 4.5 indicates weaker complete-task success across all three stacks.GLM-5 remains competitive with Claude Opus 4.5 in CSR.
- Long-Horizon Evaluation: GLM-5 outperforms Claude Opus 4.5 on the large-repository exploration task, where agents locate implementation files from user-facing descriptions.The benchmark targets deep, opaque, non-duplicated files in large repositories.
- General Capabilities: Across five real-world capability domains, GLM-5 consistently improves machine translation, multilingual dialogue, instruction following, world knowledge, and tool-calling.
7 Conclusion
GLM-5 is presented as an open-weight foundation model bridging high-performance reasoning with computational efficiency for complex, real-world workflows. Its central framing is a transition from vibe coding to agentic engineering.
- GLM-5 is presented as bridging high-performance reasoning and extreme computational efficiency while moving from vibe coding to agentic engineering.
8 Easter Eggs
GLM-5’s anonymous OpenRouter release, presented as the “Pony Alpha” experiment, drew strong community attention for coding and agentic tasks. Its later identification as GLM-5 was framed as evidence of engineering-level reliability, while the authors acknowledged that the frontier race continues.
- The anonymous OpenRouter release became known as the “Pony Alpha” experiment.The authors described anonymity as a way to obtain feedback they considered unbiased.
- Within days, developers noticed Pony Alpha’s performance in complex coding tasks, agentic workflows, and roleplay scenarios.
- 25% of users guessed Claude Sonnet 5, 20% guessed DeepSeek, and 10% guessed Grok.The remaining users attributed the model to GLM-5 or other possibilities, according to the preliminary statistic.
- The confirmed identity as GLM-5 was presented as supporting competition at the frontier and a shift toward engineering-level reliability.The authors distinguished this significance from raw benchmark performance alone.
- The authors state that the gap between open-weight models and the absolute proprietary frontier is narrowing, but the race is far from over.
9 Contribution
This contribution section records the paper’s contributor list, architecture-reference material, and selected training settings. It also points to a comparison of GLM-5 and GLM-4.5 model architectures.
- The contributors’ names are listed in alphabetical order by first name.
- The contribution includes a long contributor list spanning the names recorded in the paper.
- Training follows GLM-4.5 settings including the Muon optimizer, cosine decay, and batch-size warmup.The learning rate warms from 0 to 2e-4, decays to 4e-5 during pre-training, and decreases linearly from 4e-5 to 1e-5 during mid-training.
- Table 10 presents the model architecture of GLM-4.5 and GLM-5.Parameter counts include MTP-layer parameters but exclude word embeddings and the output layer.
B.1 Evaluation of Base Models
The base model evaluation covers English, Chinese, code, and mathematics benchmarks, with the results reported in Table 11.
- GLM-5’s base model is evaluated on English, Chinese, code, and mathematics benchmarks.The corresponding results are reported in Table 11.
B.2 Evaluation of ARC Benchmarks
The ARC benchmark evaluation spans reasoning, coding, browsing, tool-use, terminal, and agentic tasks, with task-specific environments and controls. Several evaluations use tailored prompts, context policies, judges, resource limits, or repeated runs.
- Reasoning benchmarks: HLE uses up to 131,072 generated tokens and GPT-5.2 medium as judge, while HLE-with-tools uses a 202,752-token maximum context.
- Coding benchmarks: SWE-bench is run with OpenHands using a tailored prompt, a 200K context window, and up to 16,384 new tokens.
- Browsing benchmarks: BrowseComp uses either the five most recent turns or a discard-all context-management strategy matching DeepSeek-V3.2 and Kimi K2.5.
- Terminal and coding agents: Terminal-Bench evaluations impose task-specific context, timeout, CPU, memory, and run-count settings across Terminus 2 and Claude Code.The Claude Code evaluation averages scores over five runs, while Terminus 2 uses 16 CPUs and 32 GB RAM limits.
- Agentic benchmarks: τ 2-Bench uses prompt adjustments for Retail and Telecom to avoid premature user termination, while Airline receives domain fixes from the Claude Opus 4.5 system card.The optimized prompts are shown in Figures 12 and 13.
B.4.1 Frontend Evaluation
The frontend evaluation covers diverse application scenarios, technology stacks, and structured test cases designed to measure practical engineering proficiency. Its validation pipeline combines expert-designed tasks, refined checklists, and dedicated execution environments.
- Seven frontend scenarios evaluate engineering proficiency across business systems, web games, rendering, creative tools, showcase pages, forms and tables, and data visualization.
- The benchmark covers vanilla HTML/CSS/JS, React, and Vue 3 with Vite.
- Each test case contains a task, checklist, and dedicated environment.
- A representative React task requires building a drawing tool with selectable brush and eraser settings, mouse-based drawing and erasing, and local image saving.
- The representative implementation satisfies the interaction, erasing, and local-save requirements.
- The data pipeline uses four stages, beginning with expert task synthesis and checklist generation and refinement using model-generated candidates followed by expert auditing.