跳转至

GLM-5.2: Built for Long-Horizon Tasks

📊 Level ⭐⭐⭐ | 12.9KB

背景:从 newsletter candidates 提取,2026-06-18 stars=4 通过评分门槛。 URL: https://z.ai/blog/glm-5.2

核心要点

We're introducing 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%
  • Pure Open: An MIT open-source license — no regional limits, technical access without borders

Supporting long-horizon tasks starts with making long context engineering-usable: the model must maintain quality across long, messy coding-agent trajectories, not just accept more tokens. A 1M context is easy to claim, but much harder to keep reliable under real engineering pressure. To this end, we substantially expanded 1M-context training for coding-agent scenarios, covering large-scale implementation, automated research, performance optimization, and complex debugging. The result is a long-context system that is not only wide in scope, but solid in execution: a practical substrate for sustained engineering work.

This capability is reflected in GLM-5.2's performance on three long-horizon coding benchmarks. FrontierSWE measures whether an agent can complete open-ended technical projects at the scale of hours to tens of hours, spanning systems optimization, large-scale code construction, and applied ML research. On this benchmark, GLM-5.2 trails Opus 4.8 by only 1%, while edging out GPT-5.5 by 1% and Opus 4.7 by 11%. On PostTrainBench, where each agent is given an H100 GPU and evaluated by how much it can improve small models through post-training, GLM-5.2 outperforms both Opus 4.7 and GPT-5.5, ranking second only to Opus 4.8. On SWE-Marathon, an ultra-long-horizon software engineering benchmark covering tasks such as building compilers, optimizing kernels, and developing production-grade services, GLM-5.2 still has room to grow, trailing Opus 4.8 by 13% while remaining second only to the Opus series. Across all three benchmarks, GLM-5.2 is the highest-ranked open-source model, showing that its 1M context has translated into practical long-horizon delivery capability.

Image 1: img_v3_0212n_dd3e6c79-bb10-4959-9080-56eb8525b92g

On standard coding benchmarks, GLM-5.2 is the strongest open-source model,

评估理由

  • value=8: Genuinely technical: describes IndexShare sparse attention architecture (2.9× FLOPs reduction at 1M context), MTP layer improvements for speculative decoding (20% acceptance length increase), and deta
  • confidence=8: 详细程度与来源可信度
  • stars=4: 独特技术洞察评分

第二来源:HuggingFace Model Card

  • 同样的 IndexShare 稀疏注意力架构、MTP 层改进
  • 模型权重与推理配置

第 5 来源 — 华为云部署与昇腾优化

来源:华为云开发者联盟,2026-06-18

GLM-5.2 上线华为云后,华为云从算力调度、网络通信、底层算子三个维度进行了全栈软硬协同优化,显著提升了推理效率:

  • 算力调度层:针对 MoE 架构在昇腾平台上实现了 Layer 级动态均衡调度,解决了传统 MoE 路由不均导致的计算长尾效应
  • 通信层:依托华为云 CloudMatrix 智算云服务高速互联架构,利用零拷贝技术消除了节点间的通信开销,实现千卡规模的高效协同
  • 算子层:结合昇腾硬件特性,对 Attention 及 Linear 等高频基础算子进行了深度融合与重构,大幅降低了推理时延

此外,华为云 MaaS 模型即服务平台已提供免部署、一键调用 GLM-5.2 API 的 Tokens 服务。华为云码道 CodeArts 代码智能体、华为云智果 AgentArts 企业级智能体平台也已完成与 GLM-5.2 的深度适配。

→ 原文存档 (华为云开发者联盟)

相关

Interconnects 分析视角(Nathan Lambert)

来源:Interconnects newsletter,2026-06-22

为什么是"step change"

Nathan Lambert 认为 GLM-5.2 代表了开源 agent 模型的质变: - Long-horizon task 首次在开源中可靠实现:1M context 不仅是数字,而是在真实工程压力下保持稳定 - 对 open agents 生态的影响:首次让开源社区能构建需要长时间运行的 agent(如 multi-step coding、automated research) - IndexShare 架构创新:每 4 层 sparse attention 共享 indexer,1M context 下 FLOPs 降低 2.9×

与闭源模型的竞争定位

文章分析了 GLM-5.2 在 open vs closed 模型竞争格局中的位置: - 开源模型首次在 long-horizon agent 任务上接近闭源水平 - MIT 许可证消除了区域限制,对全球开发者开放 - 对 Anthropic/OpenAI 的 agent 生态构成直接竞争

→ 原文存档


深度分析

Long-horizon 能力的"工程可用"门槛

GLM-5.2 的核心卖点不是"支持 1M context"这个数字本身,而是把长上下文从"能塞进去"推进到"在真实工程压力下可依赖"。官方明确指出 1M context 容易宣称、难以在杂乱的 coding-agent 轨迹上保持质量稳定,为此专门针对 coding-agent 场景(大规模实现、自动化研究、性能优化、复杂调试)扩展了 1M-context 训练。 从 benchmark 结构也能看出这一取向:FrontierSWE 从 GLM-5.1 的 30.5 跃升至 74.4,SWE-Marathon 从 1.0 升至 13.0——两者都是小时到数十小时级的开放任务,恰好是"上下文宽度"最容易在执行中途崩掉的场景。 说明提升主要来自长程训练配方而非单纯的架构容量:同样的 1M 窗口,GLM-5.1 填不满也用不好。这对应一个更普遍的判断:long-horizon 能力的瓶颈在 harness 层的上下文管理,而非模型参数量——参见 Harness 长时任务。相关实测证据见 GLM-5.2 百万上下文世界杯实测。

Benchmark 定位的结构性解读:开源最强,但与 Opus 的差距集中在"超长"

把三张长程表横向对比,可以读出一个清晰的能力分层:FrontierSWE (74.4) 距 Opus 4.8 仅差 0.7 分且超过 GPT-5.5;PostTrainBench (34.3) 仅次于 Opus 4.8;SWE-Marathon (13.0) 虽然落后 Opus 4.8 的 26.0 整整一倍,但已是唯一逼近闭源第一梯队的开源模型。 规律是:任务时长越长、开放度越高,与 Opus 的差距越大——开源阵营的追赶是分段的,而非整体跃迁。另一个值得注意的细节是 Terminal Bench 2.1:GLM-5.2 在 Best Reported Harness 配置下得 82.7,反超 Opus 4.8 的 78.9——harness 调优能抹平约 2 分的模型差距,印证了 Harness Engineering 对最终表现的决定性影响。 生态定位层面的进一步讨论见 GLM-5.2 开源 agent step change 与 ZCode GLM-5.2 Harness。

IndexShare + MTP:为 1M context 服务的推理经济学

架构改动要放在"1M context 的推理成本"框架下理解:IndexShare 让每 4 层稀疏注意力共享同一个 indexer,在 1M 长度下将 per-token FLOPs 降低 2.9×;MTP 层改进使 speculative decoding 的接受长度最多提升 20%。 两项改动指向同一个矛盾——长上下文 attention 成本随序列长度超线性增长,不从架构上削减,1M context 在实际服务中会贵到不可用。IndexShare 的本质是赌"稀疏注意力 indexer 在相邻层间高度冗余",用参数共享换计算量;MTP 则在解码端压低长输出的生成成本。官方部署矩阵(SGLang、vLLM、Transformers、KTransformers,及 Ascend NPU)说明推理栈生态已同步就绪。 这一"架构降本 + 部署开源"组合是长上下文从演示走向生产的前提,属于 推理优化 在 MoE 架构 上的具体落地。

软硬协同视角:华为云昇腾栈的信号

华为云对 GLM-5.2 做了三层全栈软硬协同优化(MoE Layer 级动态均衡调度、CloudMatrix 高速互联零拷贝、昇腾算子层深度融合,细节来自华为云独立来源),而 HF model card 确认 Ascend NPU 有官方部署支持(vLLM-Ascend、xLLM、SGLang),两者互相印证: 由此可读出 Interconnects 视角未展开的要点——IndexShare 稀疏注意力对非 NVIDIA 硬件相对友好,稀疏 indexer 的访存模式比 dense attention 更容易在国产算力上重算子化,这可能是昇腾栈优先深度适配 GLM-5.2 的技术原因之一。MIT 许可 + 无区域限制 + 非 NVIDIA 硬件可跑,使它成为地缘约束下稀缺的"可自主部署的旗舰级 long-horizon 模型"。

实践启示

  1. 选 long-horizon 开源模型时的判断标准:不要看"最大上下文"数字,而看它在该长度下的长程 benchmark 表现——FrontierSWE/SWE-Marathon 这类小时级任务分数才是"1M context 是否工程可用"的直接证据。GLM-5.1→5.2 的跃升(SWE-Marathon 1.0→13.0)说明同窗口不同训练配方的差距可以是 13 倍。
  2. Harness 投入的边际收益可量化:Terminal Bench 2.1 上 Best Reported Harness 比 Terminus-2 默认配置多拿 1.7 分并反超 Opus 4.8,说明当模型能力接近时,harness 调优是最后一段免费性能。为 GLM-5.2 搭 agent 时优先优化 harness 而非换模型。
  3. 长任务的成本规划:IndexShare 的 2.9× FLOPs 削减 + MTP 的 20% 接受长度提升意味着 GLM-5.2 在 1M context 下的实际推理成本远低于同规模 dense-attention 模型;规划长程 agent 服务的 token 预算时应以这些架构系数为基础估算,而不是按通用 attention 成本模型。
  4. 本地/私有化部署路径已成熟:SGLang v0.5.13.post1+、vLLM v0.23.0+、KTransformers v0.5.12+ 均有官方配方,Ascend NPU 有专门支持;MIT 许可使私有化部署无合规障碍。企业内部的长时 agent(合规敏感场景)可以此为默认选项。
  5. 开源追赶是分段的,别过度外推:GLM-5.2 在"数小时级"任务上已追平闭源第一梯队,但 SWE-Marathon 显示"数十小时级"仍有 2 倍差距。设计 agent 工作流时,把超过数小时的自主任务拆成带检查点的子任务,是当前开源模型的实际使用姿势。
  6. post-training 自主能力是新评估维度:PostTrainBench(给 agent 一块 H100,看它能把小模型 post-train 到什么程度)测的是"AI 改进 AI"的闭环能力,GLM-5.2 得 34.3 仅次于 Opus 4.8;评估模型用于自动化研究场景时应把这类 benchmark 纳入筛选标准。

关联