AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
Hugging Face Blog·2026年6月17日 18:01·約21分で読める

GLM-5.2:長期ホライズンタスク向けに構築されたモデル

#LLM#Long-Horizon Tasks#Zhipu AI#GLM-5.2
TL;DR

中国の智譜 AI が、長期間にわたる複雑なタスク処理を目的とした新モデル「GLM-5.2」を発表した。

AI深層分析2026年6月17日 19:02
3
注目/ 5段階
深度40%
3
関連度30%
4
実用性20%
3
革新性10%
3

キーポイント

1

長期的タスク処理への特化

本モデルは単発の応答ではなく、長時間にわたる複雑なタスクを継続的に処理・実行することを主目的として設計されている。

2

中国 AI 企業の技術競争

智譜 AI が公開したこの新モデルは、グローバルな大規模言語モデル市場における中国勢の技術力向上を示す重要な事例である。

3

Hugging Face での発表

主要なオープンソースプラットフォームである Hugging Face Blog を通じて公式に発表され、開発者コミュニティへのリーチが図られている。

影響分析・編集コメントを表示

影響分析

この発表は、大規模言語モデルの用途が「即座の回答生成」から「長時間にわたる自律的なタスク実行」へと進化していることを示唆しています。特に中国発のモデルが長文コンテキストや複雑なワークフロー処理において競争力を高めていることは、業界全体の技術トレンドとして注目すべき動きです。

編集コメント

「GLM-5.2」の発表は、LLM が単なるチャットボットから自律的な作業エージェントへと進化する過程を象徴しています。長期的なタスク処理能力の実現は、実務現場での AI 導入における大きな障壁の一つを解消する可能性があります。

記事一覧に戻る

私たちは、長期ホライズンタスク(long-horizon tasks)に特化した最新フラッグシップモデル「GLM-5.2」を発表します。これは前作の GLM-5.1 に比べて長期ホライズンタスク能力において大幅な飛躍を示すものであり、堅牢な 100 万トークンのコンテキスト(context)でその能力を発揮できるのは初めてのことです。GLM-5.2 の新機能には以下が含まれます:

  • 堅牢な 100 万トークンコンテキスト:長期ホライズンタスクを安定的に処理可能な、堅牢な 100 万トークンのコンテキスト
  • フレキシブルなエフォートレベルによる高度なコーディング:パフォーマンスとレイテンシのバランスを取るための複数の思考エフォート(thinking effort)レベルを備えた、強化されたコーディング能力
  • アーキテクチャの改善:「IndexShare」を提案します。これは 4 つのスプライスアテンション層(sparse attention layers)ごとに同じインデクサーを再利用するもので、100 万トークンのコンテキスト長においてトークンあたりの FLOPs を 2.9 倍削減します。また、スペキュレーティブディコーディング(speculative decoding)用の GLM-5.2 の MTP レイヤーも改善し、受容長を最大 20% 向上させました。
  • プアオープン:MIT オープンソースライセンスを採用。地域制限はなく、技術的アクセスに国境はありません

長期ホライズンのタスクをサポートするには、まず長文コンテキストをエンジニアリングの現場で実用可能にすることが不可欠です。モデルは単により多くのトークンを受け入れるだけでなく、長く複雑なコーディングエージェントの軌跡全体を通じて品質を維持する必要があります。1M トークンのコンテキストという数字を主張するのは容易ですが、実際のエンジニアリングの圧力下で信頼性を保つことははるかに困難です。そこで私たちは、大規模実装、自動化された研究、パフォーマンス最適化、複雑なデバッグといったコーディングエージェントシナリオを対象に、1M コンテキストでのトレーニングを大幅に拡大しました。その結果得られたのは、範囲の広さだけでなく実行の堅牢さも兼ね備えた長文コンテキストシステムであり、持続的なエンジニアリング作業を支える実用的な基盤となっています。

この能力は、GLM-5.2 が 3 つの長期ホライズンコーディングベンチマークで示したパフォーマンスに反映されています。FrontierSWE は、エージェントが数時間から数十時間にわたるシステム最適化、大規模なコード構築、応用機械学習研究などを含むオープンエンドな技術プロジェクトを完了できるかを測定するものです。このベンチマークでは、GLM-5.2 は Opus 4.8 よりもわずか 1% 遅れに留まり、GPT-5.5 や Opus 4.7 をそれぞれ 1% と 11% 上回っています。PostTrainBench では、各エージェントに H100 GPU が与えられ、ポストトレーニングを通じて小規模モデルをどれだけ改善できるかで評価されますが、GLM-5.2 は Opus 4.7 と GPT-5.5 の両者を上回り、Opus 4.8 に次いで 2 位となっています。SWE-Marathon は、コンパイラの構築、カーネルの最適化、本番環境向けのサービスの開発などを含む超長期ホライズンのソフトウェアエンジニアリングベンチですが、GLM-5.2 にはまだ成長の余地があり、Opus 4.8 よりも 13% 遅れながら Opus シリーズに次ぐ 2 位を維持しています。これら 3 つのベンチマークすべてにおいて、GLM-5.2 は最高ランクのオープンソースモデルであり、その 100 万トークンのコンテキストが実用的な長期ホライズンでの成果発揮能力へと転換されたことを示しています。

標準的なコーディングベンチマークにおいて、GLM-5.2 は最も強力なオープンソースモデルであり、GLM-5.1 を大幅に上回っています。具体的には、Terminal-Bench 2.1 で 81.0 対 63.5、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.2 はさらに、努力レベル制御(effort level control)を導入し、ユーザーがモデルの能力とタスク実行速度、計算コストを明示的にバランスさせられるようになりました。図に示す通り、GLM-5.2 は同等のトークン予算において GLM-5.1 よりもはるかに強力なエージェント型コーディング性能を発揮し、類似のトークン消費量ではその能力が Claude Opus 4.7 と Claude Opus 4.8 の間に位置づけられます。さらに、Max(最大)努力レベルを指定することで、困難なタスクにおいて高いパフォーマンスが必要な場合に追加の計算リソースを割り当てることができ、モデルのコーディング能力をさらに拡張します。この設計により、GLM-5.2 をコーディングタスクに使用する際、ユーザーは異なるシナリオに適した最も適切な推論モードを選択できるため、より大きな柔軟性が得られます。

100 万トークンコンテキストのためのアーキテクチャ

DSA 用の IndexShare

1M のコンテキスト長をサポートするために、GLM-5.2 では DSA 内のインデクサーの計算コストを削減するため IndexShare を適用しています。具体的には、GLM-5.2 では 4 つのトランスフォーマー層ごとに軽量なインデクサーが共有されます。インデクサーは 4 層の最初の位置に配置され、topk インデックスは 4 層全体で共用されます。これにより、3/4 の層におけるインデクサーのドット積計算および topk 演算を削減できます。GLM-5.2 は、128K シーケンス長でトレーニングの中期から IndexShare を用いて訓練されており、より少ない計算量で GLM-5.1 を上回る長文コンテキストベンチマークの結果を示しています。

IndexShare と KVShare を併用した MTP

GLM-5.2 の MTP 層は、推論時の予測デコーディング(speculative decoding)のために以下の 2 つの目的で改善されています:1) ドラフトモデルとしての MTP 層のコストを最小化すること、2) 予測デコーディングの受容率を最大化すること。

最初の目的のためにも、MTP 層に IndexShare を適用しています。多段階 MTP では、インデクサーは最初のステップに配置され、その後のすべてのステップで topk インデックスが共用されます。しかし、バックボーンとは異なり、異なる MTP ステップの入力トークンは異なります。以下の図に示すように、$h_4$ の topk インデックスを $h_5$ で再利用すると、$h_5$ は $h_1$ から $h_4$ へのアテンションのみが可能となり、$h_5$ 自身にはアテンションできません。この性質が、GLM-5.1 の MTP 層におけるトレーニングと推論の不一致を解消することで、2 つ目の目的達成に寄与することを示します。

上記の図では、2 ステップの MTP レイヤーの推論を示しています。1 つ目のステップでは、推論はトレーニングと一致し、すべての隠れ状態がターゲットモデルから来ます。しかし、2 つ目のステップでは、$h_{1:4}$ はターゲットモデルから、$h_5$ は MTP レイヤーから来ます。したがって、$h_5$ の KV キャッシュ(Key-Value Cache)は、ターゲットモデルから計算された $kv_{1:4}$ と、MTP レイヤーから計算された $kv_5$ の混合になります。一方、IndexShare を用いる場合、$h_5$ の KV キャッシュには $kv_{1:4}$ しか含まれず、すべてがターゲットモデルの隠れ状態からのものです。トレーニングにおいては、最初の MTP ステップの KV キャッシュと topk インデックスを再利用します。GLM-5.1 と同様に、異なる MTP ステップのパラメータも共有されている点に注意してください。さらに、https://arxiv.org/abs/2606.12370 に着想を得て、推測デコーディングのために拒否サンプリングを導入し、トレーニングにはエンドツーエンド TV 損失を使用します。

以下の表は、コーディングシナリオにおける受容長に対する技術の消融実験(アブレーションスタディ)を示しています。実験では GLM-5.1 のバックボーンとトレーニングデータを使用しました。MTP ステップ数はトレーニングおよび推論の両方で 7 に設定されています。ベースラインと比較して、最終 MTP レイヤーの受容長は 20% 増加します。

Method

Acceptance Length

Baseline

4.56

+ IndexShare + KV Share

5.10

+ Rejection Sampling

5.29

+ End-to-end TV Loss

5.47 (+20%)

1M コンテキスト長の効率的なサービング

GLM-5.2 は最大コンテキスト長を 200K トークンから 1M トークンに拡張したことで、コーディングワークロードは大幅に長いプロンプトへとシフトすると予想されます。これにより、主要な推論ボトルネックは計算から KV キャッシュ容量、長文脈カーネルのオーバーヘッド、および CPU サイドのオーバーヘッドへと移行します。新しい GLM-5.2 アーキテクチャはトークンあたりの計算 FLOPs を削減しますが、トークンあたりの KV キャッシュサイズを同比例で減少させるわけではありません。その結果、限られた GPU リソース下でより長いコンテキスト、高い同時実行性、および高いトークンスループットをサポートすることは、推論エンジン最適化における中心的な課題となっています。

この課題に対処するため、私たちは推論エンジンを 3 つの方向から最適化しました。第一に、LayerSplit を基盤として、より微細なメモリ管理と並列化戦略を導入し、KV キャッシュ容量を増大させ、超長文脈リクエストに対してより多くの利用可能なキャッシュスペースを提供します。第二に、コンテキスト長の増加に伴ってコストが増大するカーネルを最適化し、キャッシュ転送パイプラインとの連携を改善することで、キャッシュ転送がプリフィルとデコードの両方のパフォーマンスに与える影響を最小限に抑えます。第三に、CPU サイドのキャッシュ管理、リクエストスケジューリング、およびランタイム実行パスを最適化し、GPU 実行パイプライン内のバブル(待機時間)を削減してエンドツーエンドのスループットを向上させます。図に示す通り、GLM-5.2 はコンテキスト長が成長するにつれてより大きなスループットの優位性を達成し、長文脈推論シナリオにおける優れたスケーラビリティを示しています。

slime for Agentic RL

GLM-5.2 のエージェント型強化学習(RL)におけるポストトレーニングは、より大規模なタスク、より多くのドメイン、そしてより複雑な実行パターンを伴うものです。異種データやタスクは統一されたトレーニングプロセス内で整理する必要があり、長期にわたる相互作用、ツール利用、サブタスクの分解、多段階の環境フィードバックは、ロールアウトとトレーニングのオーケストレーションに対してより高い要件を課します。このプロセスをサポートするために、slime はトレーニングから大規模な推論ロールアウトに至るまで統合されたインフラストラクチャ層として機能します。ホワイトボックスロールアウト、ブラックボックスロールアウト、コンパクトなトラジェクトリ、サブエージェントワークフローなど、複数のトレーニングおよびタスク整理モードをサポートし、同じシステムがより大規模で複雑な RL および OPD(Optimized Policy Distillation)のトレーニング負荷にスケール可能となります。GLM-5.2 のポストトレーニングプロセスでは、slime フレームワークを用いて並列 OPD トレーニングを実施し、10 以上の専門家モデルを効率的に統合して最終モデルを構築しました。全体の OPD トレーニングプロセスには約 2 日がかかり、高いトレーニング効率を示しました。

アジェンティック RL はまた、システムリソースと推論インフラストラクチャに対してより高い要求を課します。slime は、推論システムに対する非常にオープンで柔軟なインターフェースを提供します:トレーニング側は異なる形式で推論サービスに接続でき、並列化戦略、ルーティングポリシー、PD 分離構成、デプロイメントパターンなどに対して柔軟に適応できます。同時に、RL ロールアウト中に蓄積された設定体験、スケジューリング戦略、最適化パスは、本番環境でのサービング段階で再利用され、さらに洗練させることができます。これにより、トレーニング側とサービング側が相互に強化し合うことが可能となり、ポストトレーニングから本番デプロイメントへのより直接的な道筋が生まれます。柔軟なトレーニング・推論リソースの編成や KV キャッシュ FP8 と相まって、slime は GLM-5.2 の大規模アジェンティック RL トレーニングに対する重要なインフラストラクチャサポートを提供し、システム効率、ロールアウトスループット、大規模推論の並行処理能力をさらに向上させます。

反ハッキング機能を備えた長期ホライズンタスク向けの RL

長期ホライズンタスクのための強化学習 (RL)。GLM-5.2 において、長期ホライズンタスクは著しく長い実行トレースを生成します。一度、超長軌道がコンパクション(圧縮)によって複数のサブトレースに分割されると、同じプロンプト下での異なるロールアウトでは、学習可能なトレースの数と非常に可変的な長さを持つことになります。そのため、グループごとの最適化から、個別のロールアウトから学習し、トークンレベルのアドバンテージを推定するためにクリティック(評価関数)に依存する、クリティックベースの PPO 定式化へと移行します。この単一ロールアウト定式化はコンパクションと自然に適合します。なぜなら、プロンプトが生成するトレースの数やそれらの相対的な長さに対する制約を課さないからです。私たちは、すべての圧縮されたサブトレースを学習可能な軌道として含めることでトレーニングにコンパクションを導入し、トークンレベルの損失関数を適用してその長さの不均衡に対処します。

コーディングエージェントにおけるハッキング対策。コーディング RL は、報酬が通常は検証可能な合格/不合格信号であるため、特にリワードハッキングに対して脆弱です。GLM-5.2 は GLM-5.1 よりもより多くの潜在的なハッキング行動を示すことがわかりました。これにより検証信号の最適化は容易になりますが、モデルの本質的な能力を実際に向上させることはできません。エージェントは保護された評価アーティファクトを読み取り、参照やアップストリームコミットから回答内容をコピーしたり、GitHub 関連タスクではターゲットソースを直接取得したりできます。例えば、エージェントは curl https://raw.githubusercontent.com/<path-to-file> を介してソリューションをダウンロードしたり、以下のような連鎖的な情報漏洩を行ったりします。

⟦CODE_0⟧

  1. find /workspace -name "*hidden*"
  2. cat /workspace/.eval/secret_cases.json
  3. python solve.py --case "$(cat /workspace/.eval/secret_cases.json)"

これらの挙動は報酬を水増しし、学習信号を汚染するため、実際のタスク解決と近道(ショートカット)を明確に区別する仕組みが必要です。これに対処するため、RL 学習(強化学習:Reinforcement Learning)および評価の両方にアンチハックモジュールを導入しました。検出プロセスは 2 つの段階から構成されます。まずルールベースのフィルタが潜在的なハッキングを検出し、再帰率を最大化します。次に LLM 判事がこれらのフラグ付きアクションの意図を確認し、精度を高く保ちます。私たちは各ステップでツール呼び出しを監視するオンライン戦略を使用しています。もしハッキングが検出された場合、システムはその呼び出しをブロックし、結果としてダミー情報を返します。重要なのは、このオンラインガードにより、モデルはハッキングしたアクションが検出されてもロールアウト(試行実行)を継続できる点です。特定の無効な挙動のみを処理して軌道全体を拒絶するのではなく、このアプローチはロールアウトが突然停止することで発生しうる学習の不安定化やモデル崩壊を防ぐのに役立ちます。

Full Benchmark Table

Benchmark

GLM-5.2

GLM-5.1

Qwen3.7-Max

MiniMax M3

DeepSeek-V4-Pro

Claude Opus 4.8

GPT-5.5

Gemini 3.1 Pro

Reasoning

HLE

40.5

31

41.4

37

37.7

49.8*

41.4*

45

HLE (w/ Tools)

54.7

52.3

53.5

-

48.2

57.9*

52.2*

51.4*

CritPt

16.7

4.6

13.4

3.7

12.9

20.9

27.1

17.7

AIME 2026

99.2

95.3

97

-

94.6

95.7

98.3

98.2

HMMT Nov. 2025

94.4

94

95

84.4

94.4

96.5

96.5

94.8

HMMT Feb. 2026

92.5

82.6

97.1

84.4

95.2

96.7

96.7

87.3

IMOAnswerBench

91.0

83.8

90

-

89.8

83.5

-

81

GPQA-Diamond

91.2

86.2

90

93

90.1

93.6

93.6

94.3

Coding

SWE-bench Pro

62.1

58.4

60.6

59

55.4

69.2

58.6

54.2

NL2Repo

48.9

42.7

47.2

42.1

35.5

69.7

50.7

33.4

DeepSWE

46.2

18

18

20

8

58

70

10

ProgramBench

63.7

50.9

-

-

47.8

71.9

70.8

39.5

Terminal Bench 2.1 (Terminus-2)

81.0

63.5

75

65

64

85

84

74

Terminal Bench 2.1 (Best Reported Harness)

82.7

69

-

-

-

78.9

83.4

70.7

FrontierSWE (Dominance)

74.4

30.5

-

-

29.0

75.1

72.6

39.6

PostTrainBench

34.3

20.1

-

-

-

37.2

28.4

21.6

SWE-Marathon

13.0

1.0

-

-

-

26.0

12.0

4.0

Agentic

MCP-Atlas (Public Set)

76.8

71.8

76.4

74.2

73.6

77.8

75.3

69.2

Tool-Decathlon

48.2

40.7

-

-

52.8

59.9

55.6

48.8

GLM-5.2 の始め方

GLM Coding Plan を使用して GLM-5.2 を活用する

お気に入りのコーディングエージェント—ZCode, Claude Code, OpenCode などで GLM-5.2 をお試しください。https://docs.z.ai/devpack/overview

GLM コーディングプランの加入者の方へ: GLM-5.2 はすでにすべてのコーディングプランユーザーに展開済みです。モデル名を「GLM-5.2」に更新することで、今すぐ GLM-5.2 を有効化できます(Claude Code では 100 万トークンのコンテキスト長を有効にするために「GLM-5.2[1m]」を使用してください)。タスクに応じて、異なる 思考の努力レベル(High または Max)を選択することも可能です。最も能力の高いモデルである GLM-5.2 は、ピーク時間帯に利用料金が 3 倍、オフピーク時間帯には 2 倍となります。ただし、9 月末までの期間限定プロモーションとして、オフピーク時の利用料金は 1 倍で請求されます。(ピーク時間は毎日 UTC+8(北京時間)の 14:00~18:00 です)。

GUI をお好みですか?GLM-5.2 を搭載したデスクトップエージェント ZCode をご提供しています。長期的なタスクには「/goal」コマンド、SSH によるリモート開発、モバイル制御が可能です。特別オファー: ZCode 内でコーディングプランを通じて GLM-5.2 を利用すると、6 月 30 日までに有効クォータが 1.5 倍になります。

今すぐ構築を始めましょう: https://z.ai/subscribe

Z.ai で GLM-5.2 とチャットする

GLM-5.2 は現在、Z.ai で利用可能です。

GLM-5.2 をローカルで実行する

GLM-5.2 のモデル重みは、HuggingFace および ModelScope で一般公開されています。ローカル展開においては、GLM-5.2 は transformers、vLLM、SGLang、xLLM、ktransformers などの推論フレームワークをサポートしています。

脚注

  • Humanity's Last Exam (HLE) およびその他の推論タスク:評価には温度パラメータを 1.0、top_p を 0.95 に設定します。最大生成長は 163,840 トークンで評価を行います。デフォルトではテキストのみのサブセットの結果を報告し、*印がついた結果はフルセットからのものです。AIME、HMMT、IMOAnswerBench については、以下のシステムプロンプトを使用して各質問を評価します:"Your response should be in the following format:\nExplanation: {your explanation for your final answer}\nExact Answer: {your succinct, final answer}\nConfidence: {your confidence score between 0% and 100% for your answer}."(回答は以下の形式で行ってください:説明:{最終回答に対するあなたの解説}、正確な回答:{簡潔な最終回答}、自信度:{0% から 100% の範囲での回答の自信度})。判読モデルには GPT-5.5 (medium) を使用します。HLE-with-tools については、コンテキスト管理戦略なしで最大 300,000 トークンのコンテキスト長を使用します。
  • SWE-Bench Pro:OpenHands を用いて SWE-Bench Pro スイートを実行し、調整された指示プロンプトを使用します。設定は温度=1、top_p=1、max_new_tokens=32k、400K のコンテキストウィンドウです。
  • NL2Repo:NL2Repo を 400k コンテキスト下で、温度=1.0、top_p=1.0、max_new_tokens=48k で評価しました。ハッキングを防ぐため、ルールベースおよび LLM ベースの判定を用いて悪意のある動作(例:許可されていない pip や curl の操作)を防止します。
  • DeepSWE:公式の評価フレームワーク pier および mini-swe-agent ハネス(温度=1.0、top_p=1.0、タイムアウト=2 時間、400K コンテキスト)を使用して DeepSWE を実行しました。各タスクは、CPU 2 コア、RAM 8GB、インターネット接続なしの孤立したコンテナ内で解決されます。
  • ProgramBench: Claude-Code 2.1.156 を用いて、temperature=1.0、top_p=1.0、max_tokens=64000、max_turns=2000、sample_timeout=6h、reasoning_effort=max、コンテキストウィンドウ 400K の設定で ProgramBench(200 インスタンス)を評価します。各インスタンスはインターネットアクセスが無効化された (4 CPU, 8 GB RAM) のサンドボックス内で実行されます。
  • Terminal-Bench 2.1 (Terminus 2): Terminus-2 フレームワークを用いて、parser=json、timeout=4h、temperature=1.0、top_p=1.0、max_new_tokens=48k、max_episodes=500、コンテキストウィンドウ 256K の設定で Terminal-Bench 2.1 を評価します。リソース制限は最大 4 CPU および 8 GB RAM にキャップされます。
  • Terminal-Bench 2.1 (Claude Code): Claude Code 2.1.167 で、temperature=1.0、top_p=0.95、max_new_tokens=131072 の設定で評価を行います。透明なプロキシを介して max_new_tokens を 128k に上書きし、CLI の 64k キャップをバイパスして CLAUDE_CODE_MAX_OUTPUT_TOKENS の設定可能性を復元します。壁時計時間制限は除去しますが、タスクごとの CPU およびメモリ制約は維持されます。スコアは 5 回のランの平均値です。
  • MCP-Atlas: すべてのモデルは、10 分間のタイムアウトが各タスクに設定された 500 タスクの公開サブセットで、思考モード(think mode)にて評価されました。評価には Gemini-3.0-Pro をジャッジモデルとして使用します。
  • Tool-Decathlon: 公式の評価サービスを使用し、max_token を 128K に設定します。
  • FrontierSWE: 評価は Proximal によって行われ、コンテキスト長は 1M、最大努力レベル、最大出力トークンは 128K としました。ドミナンススコアは 2026/06/16 時点の報告値です。
  • PostTrainBench:評価は、PostTrainBench によって実施され、コンテキスト長は 100 万、最大努力レベル、最大出力トークンは 128K と設定されました。
  • SWE-Marathon:評価は、Abundant AI によって実施され、コンテキスト長は 100 万、最大努力レベル、最大出力トークンは 128K と設定されました。
原文を表示

Back to Articles

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.

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. 63.5 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.

GLM-5.2 also introduces effort level control, enabling users to explicitly balance model capability against task execution speed and computational cost. As shown in the figure, GLM-5.2 delivers substantially stronger agentic coding performance than GLM-5.1 at comparable token budgets, with its capability roughly positioned between Claude Opus 4.7 and Claude Opus 4.8 under similar token consumption. Moreover, the Max effort level allows users to allocate additional computation when higher performance is required in challenging tasks, further extending the model’s coding capability. This design gives users greater flexibility when using GLM-5.2 for coding tasks, allowing them to select the most suitable reasoning mode for different scenarios.

Architecture for 1M Context

IndexShare for DSA

To support 1M context length, in GLM-5.2, we apply IndexShare to reduce the computational cost of the indexer in DSA. Specifically, in GLM-5.2, every 4 transformer layers share a lightweight indexer. The indexer is placed at the first of 4 layers and topk indices are used for 4 layers. This reduces the computation of indexer dot product and topk operation in 3/4 layers. GLM-5.2 is trained with IndexShare from mid-training with 128K sequence length, outperforming GLM-5.1 on long-context benchmarks with less computation.

MTP with IndexShare and KVShare

We improve the MTP layer of GLM-5.2 for speculative decoding with two objectives: 1) Minimize the cost of the MTP layer as draft model; 2) Maximize the acceptance rate of speculative decoding.

For the first objective, we also apply IndexShare on the mtp layer. In multi-step MTP, the indexer is placed on the first step and topk indices are used for all the following steps. However, different from the backbone, the input tokens of different mtp steps are different. As the following figure shows, if we reuse the topk indices of $h_4$ for $h_5$, $h_5$ can only attend to $h_1$ to $h_4$, but not $h_5$. We will show that the property can help us achieve the second objective, by eliminating the training-inference discrepancy in GLM-5.1's mtp layer.

In the above figure we show the inference of a two-step MTP layer. In the first step, inference is consistent with training, with all the hidden states coming from the target model. However, in the second step, $h_{1:4}$ come from the target model and $h_5$ comes from the mtp layer. Therefore, the KV cache of $h_5$ is a mixture of $kv_{1:4}$ computed from the target model and $kv_5$ computed from the mtp layer. Instead, with IndexShare, the KV cache of $h_5$ includes only $kv_{1:4}$, all from the hidden states of the target model. For training, we reuse both kv cache and topk indices of the first mtp step. Note that the same as GLM-5.1, the parameters of different MTP steps are also shared. Furthermore, inspired by https://arxiv.org/abs/2606.12370, we introduce rejection sampling for speculative decoding, and use end-to-end TV loss for training.

The table below shows the ablation of techniques by acceptance length on the coding scenarios. In the experiment we use the backbone and training data of GLM-5.1. The number of MTP steps is set to 7 for both training and inference. Compared with the baseline, the acceptance length of the final MTP layer increases by 20%.

Method

Acceptance Length

Baseline

4.56

+ IndexShare + KV Share

5.10

+ Rejection Sampling

5.29

+ End-to-end TV Loss

5.47 (+20%)

Efficiently Serving 1M Context Length

As GLM-5.2 extends the maximum context length from 200K to 1M tokens, coding workloads are expected to shift substantially toward longer prompts. This shifts the primary inference bottleneck from computation to KV-cache capacity, long-context kernel overhead, and CPU-side overhead. Although the new GLM-5.2 architecture reduces per-token computational FLOPs, it does not proportionally reduce per-token KV-cache size. As a result, supporting longer contexts, higher concurrency, and higher token throughput under limited GPU resources becomes a central challenge for inference engine optimization.

To address this challenge, we optimize the inference engine along three directions. First, building on LayerSplit, we introduce finer-grained memory management and parallelization strategies to increase KV-cache capacity and provide more usable cache space for ultra-long-context requests. Second, we optimize kernels whose cost grows with context length and better coordinate them with the cache transfer pipeline, minimizing the impact of cache transfer on both prefill and decode performance. Third, we optimize CPU-side cache management, request scheduling, and runtime execution paths to reduce bubbles in the GPU execution pipeline and improve end-to-end throughput. As shown in the figure, GLM-5.2 achieves an increasingly larger throughput advantage as context length grows, demonstrating stronger scalability in long-context inference scenarios.

slime for Agentic RL

The agentic RL post-training of GLM-5.2 involves tasks at larger scale, across more domains, and with more complex execution patterns. Heterogeneous data and tasks need to be organized within a unified training process, while long-horizon interactions, tool use, sub-task decomposition, and multi-turn environment feedback all impose higher requirements on rollout and training orchestration. To support this process, slime serves as an integrated infrastructure layer from training to large-scale inference rollout. It supports multiple training and task organization modes, including white-box rollout, black-box rollout, compact trajectory, and sub-agent workflow, enabling the same system to scale to larger and more complex RL and OPD training workloads. In the post-training process of GLM-5.2, we used the slime framework to conduct parallel OPD training, efficiently merging more than ten expert models into the final model. The entire OPD training process took approximately two days, demonstrating high training efficiency.

Agentic RL also places higher demands on system resources and inference infrastructure. slime provides a highly open and flexible interface to inference systems: the training side can connect to inference services in different forms, and flexibly adapt to different parallelism strategies, routing policies, PD disaggregation setups, and deployment patterns. At the same time, the configuration experience, scheduling strategies, and optimization paths accumulated during RL rollout can be reused and further refined in the production serving stage, allowing the training side and the serving side to reinforce each other. This creates a more direct path from post-training to production deployment. Together with flexible training-inference resource organization and KV-cache FP8, slime provides critical infrastructure support for GLM-5.2’s large-scale agentic RL training, further improving system efficiency, rollout throughput, and large-scale inference concurrency.

RL for Long-Horizon Task with Anti-hacking

RL for Long-Horizon Tasks. For GLM-5.2, long-horizon tasks produce substantially longer execution traces, and once a super-long trajectory is split by compaction into multiple sub-traces, different rollouts under the same prompt yield different numbers of trainable traces with highly variable lengths. We therefore move from group-wise optimization to a critic-based PPO formulation that learns from individual rollouts, relying on a critic to estimate token-level advantages rather than group-relative comparisons. This single-rollout formulation fits compaction naturally, as it places no constraint on how many traces a prompt produces or on their relative lengths: we bring compaction into training by including all compacted sub-traces as trainable trajectories, and apply a token-level loss to address their length imbalance.

Anti-Hack in Coding agents. Coding RL is especially vulnerable to reward hacking because the reward is typically a verifiable pass/fail signal. We find that GLM-5.2 shows more potential hacking behavior than GLM-5.1. This makes the verification signal easy to optimize, but fails to actually improve the fundamental capabilities of the model. An agent can read protected evaluation artifacts, copy answer content from references or upstream commits, or directly fetch the target source in GitHub-related tasks. For example, the agent may download solution via curl https://raw.githubusercontent.com/<path-to-file> or even chained leakage like

code
1. find /workspace -name "*hidden*"
2. cat /workspace/.eval/secret_cases.json
3. python solve.py --case "$(cat /workspace/.eval/secret_cases.json)"

These behaviors inflate rewards and corrupt the training signal, requiring a clear mechanism to separate real task-solving from shortcuts. To address this, we introduce an anti-hack module for both RL training and evaluation. The detection process has two stages: a rule-based filter first catches potential hacks to maximize recall, and then an LLM judge checks the intent of these flagged actions to keep precision high. We use an online strategy that monitors the tool calls at each step. If a hack is detected, the system blocks the call and returns dummy information as the result. Importantly, this online guard allows the model to continue the rollout even after a hacked action is caught. By handling the specific invalid behavior instead of rejecting the entire trajectory, this approach helps prevent the training instability and model collapse that can happen when rollouts are abruptly stopped.

Full Benchmark Table

Benchmark

GLM-5.2

GLM-5.1

Qwen3.7-Max

MiniMax M3

DeepSeek-V4-Pro

Claude Opus 4.8

GPT-5.5

Gemini 3.1 Pro

Reasoning

HLE

40.5

31

41.4

37

37.7

49.8*

41.4*

45

HLE (w/ Tools)

54.7

52.3

53.5

-

48.2

57.9*

52.2*

51.4*

CritPt

16.7

4.6

13.4

3.7

12.9

20.9

27.1

17.7

AIME 2026

99.2

95.3

97

-

94.6

95.7

98.3

98.2

HMMT Nov. 2025

94.4

94

95

84.4

94.4

96.5

96.5

94.8

HMMT Feb. 2026

92.5

82.6

97.1

84.4

95.2

96.7

96.7

87.3

IMOAnswerBench

91.0

83.8

90

-

89.8

83.5

-

81

GPQA-Diamond

91.2

86.2

90

93

90.1

93.6

93.6

94.3

Coding

SWE-bench Pro

62.1

58.4

60.6

59

55.4

69.2

58.6

54.2

NL2Repo

48.9

42.7

47.2

42.1

35.5

69.7

50.7

33.4

DeepSWE

46.2

18

18

20

8

58

70

10

ProgramBench

63.7

50.9

-

-

47.8

71.9

70.8

39.5

Terminal Bench 2.1 (Terminus-2)

81.0

63.5

75

65

64

85

84

74

Terminal Bench 2.1 (Best Reported Harness)

82.7

69

-

-

-

78.9

83.4

70.7

FrontierSWE (Dominance)

74.4

30.5

-

-

29.0

75.1

72.6

39.6

PostTrainBench

34.3

20.1

-

-

-

37.2

28.4

21.6

SWE-Marathon

13.0

1.0

-

-

-

26.0

12.0

4.0

Agentic

MCP-Atlas (Public Set)

76.8

71.8

76.4

74.2

73.6

77.8

75.3

69.2

Tool-Decathlon

48.2

40.7

-

-

52.8

59.9

55.6

48.8

Getting started with GLM-5.2

Use GLM-5.2 with GLM Coding Plan

Try GLM-5.2 in your favorite coding agents—ZCode, Claude Code, OpenCode, and more. https://docs.z.ai/devpack/overview

For GLM Coding Plan subscribers: We already rolled out GLM-5.2 to all Coding Plan users. You can enable GLM-5.2 now by updating the model name to "GLM-5.2" (or GLM-5.2[1m] in Claude Code to enable 1M context length). You can also choose different thinking effort, High or Max, depending on the task. As our most capable model, GLM-5.2 consumes quota at 3× during peak hours and 2× during off-peak hours. As a limited-time promotion through the end of September, off-peak usage is billed at 1×. (Peak hours are 14:00–18:00 UTC+8 (Beijing Time) daily).

Prefer a GUI? We offer ZCode —a desktop agent powered by GLM-5.2, with /goal for long-horizon tasks, SSH remote development, and mobile control. Special offer: use GLM-5.2 through Coding Plan inside ZCode and get 1.5x effective quota until June 30.

Start building now: https://z.ai/subscribe

Chat with GLM-5.2 on Z.ai

GLM-5.2 is now available on Z.ai.

Serve GLM-5.2 Locally

The model weights of GLM-5.2 are publicly available on HuggingFace and ModelScope. For local deployment, GLM-5.2 supports inference frameworks including transformers, vLLM, SGLang, xLLM, ktransformers.

Footnote

  • Humanity’s Last Exam (HLE) & other reasoning tasks: We use sampling parameters of temperature=1.0, top_p=0.95 for evaluation. We evaluate with a maximum generation length of 163,840 tokens. By default, we report the text-only subset; results marked with * are from the full set. For AIME, HMMT and IMOAnswerBench, we evaluate each question using the following system prompt: Your response should be in the following format:\nExplanation: {your explanation for your final answer}\nExact Answer: {your succinct, final answer}\nConfidence: {your confidence score between 0% and 100% for your answer}. We use GPT-5.5 (medium) as the judge model. For HLE-with-tools, we use a maximum context length of 300,000 tokens, with no context management strategy.
  • SWE-Bench Pro: We run the SWE-Bench Pro suite with OpenHands using a tailored instruction prompt. Settings: temperature=1, top_p=1, max_new_tokens=32k, with a 400K context window.
  • NL2Repo: We evaluated NL2Repo with temperature=1.0, top_p=1.0, and max_new_tokens=48k under 400k context. To prevent hacking, we use rule-based and a LLM-based judgement to prevent malicious behaviors (e.g., unauthorized pip or curl operations).
  • DeepSWE: We run DeepSWE with the official pier evaluation framework and the mini-swe-agent harness (temperature=1.0, top_p=1.0, timeout=2h, 400K context). Each task is solved in an isolated container with 2 CPUs, 8 GB RAM, and no internet access.
  • ProgramBench: We evaluate ProgramBench (200 instances) with Claude-Code 2.1.156 using temperature=1.0, top_p=1.0, max_tokens=64000, max_turns=2000, sample_timeout=6h, reasoning_effort=max, with a 400K context window. Each instance runs in a (4 CPUs, 8 GB RAM) sandbox with internet access disabled.
  • Terminal-Bench 2.1 (Terminus 2): We evaluate Terminal-Bench 2.1 with Terminus-2 framework using parser=json, timeout=4h, temperature=1.0, top_p=1.0, max_new_tokens=48k, max_episodes=500, with a 256K context window. Resource limits are capped at 4 CPUs and 8 GB RAM.
  • Terminal-Bench 2.1 (Claude Code): We evaluate in Claude Code 2.1.167 with temperature=1.0, top_p=0.95, max_new_tokens=131072. We override max_new_tokens to 128k via a transparent proxy, bypassing the 64k CLI cap to restore the configurability of CLAUDE_CODE_MAX_OUTPUT_TOKENS. We remove wall-clock time limits, while preserving per-task CPU and memory constraints. Scores are averaged over 5 runs.
  • MCP-Atlas: All models were evaluated in think mode on the 500-task public subset with a 10-minute timeout per task. We use Gemini-3.0-Pro as the judge model for evaluation.
  • Tool-Decathlon: We use the official evaluation service and set max_token to 128K.
  • FrontierSWE: The evaluation was conducted by Proximal with 1M context length, max effort level, and 128K maximum output tokens. Dominance score reported as of 2026/06/16.
  • PostTrainBench: The evaluation was conducted by PostTrainBench with 1M context length, max effort level, and 128K maximum output tokens.
  • SWE-Marathon: The evaluation was conducted by Abundant AI with 1M context length, max effort level, and 128K maximum output tokens.
この記事をシェア

関連記事

Latent Space★42026年6月19日 14:53

[AINews] GLM は GPT より優れているか?GLM-5.2 が実用性を証明、Z.ai が 12 月までに「Open Fable」を公開予定

Latent Space のニュースでは、中国のモデル「GLM-5.2」がベンチマークで優れた結果を示し実用性があると評価されたことと、Z.ai が 12 月までにオープンソースプロジェクト「Open Fable」を発表する見込みについて報じられています。

Smol AI News★42026年6月19日 14:44

今日は何も大きな出来事はありませんでした

Smol AI News は、6 月 18 日から 19 日にかけての期間に、主要な AI テクノロジー業界で目立った動きや新発表がない静かな一日であったと報告しています。

Latent Space2026年6月20日 17:06

[AINews] 今日特に大きな出来事はありませんでした

Latent Space は、GLM 5.2 が依然として注目されていると指摘しつつ、AIE WF 2026 の通常チケットが月曜日に完売すると発表しました。同サイト購読者向けに限定割引を提供し、参加者には Warp や Datadog などからのスポンサークレジットも付与されます。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む