GLM-5 Documentation

GLM-5: From Vibe Coding to Agentic Engineering

6,267 stars Unknown 1 file · ~3,180 tokens #agentic-ai#coding#llm#long-horizon
RAW Doc

File: README.md

GLM-5.2 & GLM-5.1 & GLM-5

Introduction

GLM-5.2

GLM-5.2, our latest flagship model for long-horizon tasks. It marks a substantial leap in long-horizon task capability over its predecessor GLM-5.1 and, for the first time, delivers that capability on a solid 1M-token context.

GLM-5.2's new capabilities include:

  • Solid 1M Context: A solid 1M-token context that stably sustains long-horizon work
  • Advanced Coding with Flexible Effort: Stronger coding capabilities with multiple thinking effort levels to balance performance and latency
  • Improved Architecture: We propose IndexShare, which reuses the same indexer across every four sparse attention layers, reducing per-token FLOPs by 2.9× at a 1M context length. We also improve GLM-5.2’s MTP layer for speculative decoding, increasing the acceptance length by up to 20%

On standard coding benchmarks, GLM-5.2 is the strongest open-source model, improving on GLM-5.1 by a wide margin: 81.0 vs. 62.0 on Terminal-Bench 2.1 and 62.1 vs. 58.4 on SWE-bench Pro. It also closes much of the gap to the closed-source frontier — on Terminal-Bench 2.1 (81.0) it lands within a few points of Claude Opus 4.8 (85.0) — while staying ahead of Gemini 3.1 Pro.

For more detail, check our blog.

GLM-5.1

GLM-5.1 is our next-generation flagship model for agentic engineering, with significantly stronger coding capabilities than its predecessor. It achieves state-of-the-art performance on SWE-Bench Pro and leads GLM-5 by a wide margin on NL2Repo (repo generation) and Terminal-Bench 2.0 (real-world terminal tasks).

But the most meaningful leap goes beyond first-pass performance. Previous models—including GLM-5—tend to exhaust their repertoire early: they apply familiar techniques for quick initial gains, then plateau. Giving them more time doesn't help.

GLM-5.1, by contrast, is built to stay effective on agentic tasks over much longer horizons. We've found that the model handles ambiguous problems with better judgment and stays productive over longer sessions. It breaks complex problems down, runs experiments, reads results, and identifies blockers with real precision. By revisiting its reasoning and revising its strategy through repeated iteration, GLM-5.1 sustains optimization over hundreds of rounds and thousands of tool calls. The longer it runs, the better the result.

GLM-5

We are launching GLM-5, targeting complex systems engineering and long-horizon agentic tasks. Scaling is still one of the most important ways to improve the intelligence efficiency of Artificial General Intelligence (AGI). Compared to GLM-4.5, GLM-5 scales from 355B parameters (32B active) to 744B parameters (40B active), and increases pre-training data from 23T to 28.5T tokens. GLM-5 also integrates DeepSeek Sparse Attention (DSA), largely reducing deployment cost while preserving long-context capacity.

Reinforcement learning aims to bridge the gap between competence and excellence in pre-trained models. However, deploying it at scale for LLMs is a challenge due to the RL training inefficiency. To this end, we developed slime, a novel asynchronous RL infrastructure that substantially improves training throughput and efficiency, enabling more fine-grained post-training iterations. With advances in both pre-training and post-training, GLM-5 delivers significant improvement compared to GLM-4.7 across a wide range of academic benchmarks and achieves best-in-class performance among all open-source models in the world on reasoning, coding, and agentic tasks, closing the gap with frontier models.

GLM-5 is purpose-built for complex systems engineering and long-horizon agentic tasks. On our internal evaluation suite CC-Bench-V2, GLM-5 significantly outperforms GLM-4.7 across frontend, backend, and long-horizon tasks, narrowing the gap to Claude Opus 4.5.

On Vending Bench 2, a benchmark that measures long-term operational capability, GLM-5 ranks #1 among open-source models. Vending Bench 2 requires the model to run a simulated vending machine business over a one-year horizon; GLM-5 finishes with a final account balance of $4,432, approaching Claude Opus 4.5 and demonstrating strong long-term planning and resource management.

Download Model

Model Download Links Model Size Precision
GLM-5.2 🤗 Hugging Face 🤖 ModelScope 744B-A40B BF16
GLM-5.2-FP8 🤗 Hugging Face 🤖 ModelScope 744B-A40B FP8
GLM-5.1 🤗 Hugging Face 🤖 ModelScope 744B-A40B BF16
GLM-5.1-FP8 🤗 Hugging Face 🤖 ModelScope 744B-A40B FP8
GLM-5 🤗 Hugging Face 🤖 ModelScope 744B-A40B BF16
GLM-5-FP8 🤗 Hugging Face 🤖 ModelScope 744B-A40B FP8

Serve GLM-5 Series Models Locally

The GLM-5 series supports deployment with the following frameworks. Feel free to try them out:

GLM-5 supports controlling the thinking budget through the reasoning_effort parameter, which accepts two levels: max and high. max is the default — if reasoning_effort is left unset (or set to any value other than high), the model runs at Max. To use the High level, you must explicitly pass reasoning_effort="high". For default scenarios such as benchmark/leaderboard reproduction, keep Max (no setting required); only set reasoning_effort="high" when you specifically want the High level. Thinking can be turned off entirely by setting enable_thinking=false.

Fine-tuning GLM-5 Series Models

The GLM-5 series supports fine-tuning with the following frameworks. Feel free to try them out:

  • Slime (v0.3.0+), the reinforcement learning framework used by the GLM team.
  • ms-swift (v4.4.0+), supporting SFT, PPO, and GRPO.

Citation

If you find GLM-5 series model useful in your research, please cite our technical report:

text
/* Detailed source-code truncated for AI context efficiency. */

File: README_zh.md

GLM-5.2 & GLM-5.1 & GLM-5

简介

GLM-5.2

GLM-5.2,面向长程任务的最新旗舰模型。相比前代 GLM-5.1,它在长周期任务能力上实现了重大飞跃,并且首次在稳定的 100 万 token 上下文上交付这一能力。

GLM-5.2 的新能力包括:

  • 稳定的 100 万上下文: 提供稳定的 100 万 token 上下文,可持续支撑长周期工作
  • 支持弹性思考力度的高级编码:更强的编码能力,并提供多档思考力度(thinking effort),以平衡性能与延迟
  • 改进的架构:我们提出了 IndexShare,在每四个稀疏注意力层之间复用同一个索引器,在 100 万上下文长度下将每 token 的 FLOPs 降低 2.9 倍。我们还改进了 GLM-5.2 用于推测解码的 MTP 层,将接受长度提升最多 20%。

在标准编码基准测试中,GLM-5.2 是最强的开源模型,相比 GLM-5.1 大幅领先:在 Terminal-Bench 2.1 上为 81.0 对 62.0,在 SWE-bench Pro 上为 62.1 对 58.4。它还大幅缩小了与闭源前沿模型的差距——在 Terminal-Bench 2.1(81.0)上,与 Claude Opus 4.8(85.0)仅相差几分——同时保持领先于 Gemini 3.1 Pro。

更多细节,请查看我们的博客。

GLM-5.1

GLM-5.1 是我们面向智能体工程的新一代旗舰模型,代码能力较前代有显著跃升。在 SWE-Bench Pro 上达到业界领先水平,并在 NL2Repo(仓库级代码生成)和 Terminal-Bench 2.0(真实终端任务)上大幅超越 GLM-5。

但最具意义的突破,不在于单次表现的上限,而在于持续优化的能力。此前的模型——包括 GLM-5——往往很快就"用尽招数":凭借熟悉的策略快速取得初始收益后便陷入瓶颈,给再多时间也无济于事。

GLM-5.1 则不同。它天生适合在更长的时间跨度上执行智能体任务。我们发现,面对模糊问题,它展现出更优的判断力,并能在长时间会话中保持高效产出——拆解复杂问题、设计实验、解读结果、精准定位瓶颈。通过反复审视自身推理、动态调整策略,GLM-5.1 能够在数百轮迭代、数千次工具调用中持续优化。运行越久,结果越好。

GLM-5

我们推出了 GLM-5,旨在解决复杂系统工程和长周期智能体任务。扩展(Scaling)仍然是提升通用人工智能(AGI)智能效率的最重要途径之一。与 GLM-4.5 相比,GLM-5 的参数规模从 355B(激活 32B)扩展到 744B(激活 40B),预训练数据量从 23T 增加到 28.5T tokens。GLM-5 还集成了 DeepSeek 稀疏注意力(DSA),在保持长上下文能力的同时大幅降低了部署成本。

强化学习旨在弥合预训练模型中"能力"与"卓越"之间的差距。然而,由于 RL 训练效率低下,在大规模 LLM 上部署强化学习是一项挑战。为此,我们开发了 slime,一种全新的异步 RL 基础设施,大幅提升了训练吞吐量和效率,使更细粒度的后训练迭代成为可能。凭借预训练和后训练两方面的进步,GLM-5 在广泛的学术基准测试上相比 GLM-4.7 取得了显著提升,并在推理、编程和智能体任务上达到了全球开源模型的最佳性能,缩小了与前沿模型的差距。

GLM-5 专为复杂系统工程和长周期智能体任务而设计。在我们的内部评估套件 CC-Bench-V2 上,GLM-5 在前端、后端和长周期任务上均显著超越 GLM-4.7,缩小了与 Claude Opus 4.5 的差距。

在 Vending Bench 2(一个衡量长期运营能力的基准测试)上,GLM-5 在开源模型中排名第一。Vending Bench 2 要求模型在一年时间跨度内运营一个模拟自动售货机业务;GLM-5 最终以 4,432 美元的账户余额完成测试,接近 Claude Opus 4.5,展现出强大的长期规划和资源管理能力。

下载模型

模型 下载链接 模型规模 精度
GLM-5.2 🤗 Hugging Face 🤖 ModelScope 744B-A40B BF16
GLM-5.2-FP8 🤗 Hugging Face 🤖 ModelScope 744B-A40B FP8
GLM-5.1 🤗 Hugging Face 🤖 ModelScope 744B-A40B BF16
GLM-5.1-FP8 🤗 Hugging Face 🤖 ModelScope 744B-A40B FP8
GLM-5 🤗 Hugging Face 🤖 ModelScope 744B-A40B BF16
GLM-5-FP8 🤗 Hugging Face 🤖 ModelScope 744B-A40B FP8

本地部署 GLM-5 系列模型

GLM-5 系列支持使用以下多种框架部署,欢迎尝试:

GLM-5 支持通过 reasoning_effort 参数控制思考力度,可选 max 和 high 两档。默认为 max —— 若不设置 reasoning_effort(或设置为 high 以外的任意值),模型均按 Max 运行;如需使用 High 档,必须显式传入 reasoning_effort="high"。 对于榜单复现等默认场景,请保持 Max(无需任何设置);仅当确实需要 High 档时再设置 reasoning_effort="high"。如需完全关闭思考,可设置 enable_thinking=false。

微调 GLM-5 系列模型

GLM-5 系列支持使用以下多种框架进行微调,欢迎尝试:

  • Slime (v0.3.0+), GLM团队使用的强化学习框架。
  • ms-swift (v4.4.0+),支持 SFT,PPO,GRPO。

引用

如果您在研究中发现 GLM-5 系列模型有帮助,请引用我们的技术报告:

text
/* Detailed source-code truncated for AI context efficiency. */