GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
RecentarXiv preprint

GLM-5: from Vibe Coding to Agentic Engineering

Zhipu's 744B open model report is most useful for its agent RL plumbing: exact-token logging, stale-sample filters, cache-affine routing, 10,000 built coding environments and simple context folding.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2026
AUTHORS
GLM-5 Team
FROM
Zhipu AI (Z.ai), Tsinghua University
PUBLISHED
Feb 2026 · arXiv preprint
CITED BY
582Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 19% of this breakdown.

01

The paper in one minute

GLM-5 is Zhipu AI's open-weight flagship: a mixture-of-experts model with 744 billion parameters (40 billion active per token), trained on about 28.5 trillion tokens with context extended to 200K, using DeepSeek Sparse Attention to cut long-context cost. Benchmark tables put it near Claude Opus 4.5 and GPT-5.2 on coding and agent tasks.

The report's practical value is in how it trains agents. Agentic RL is run fully asynchronously: inference and training engines sit on different GPUs; the inference side keeps generating trajectories, and the trainer updates whenever enough have arrived, pushing new weights back periodically. That removes the idle time caused by a few very long rollouts, but it creates off-policy data, which the paper handles with a set of concrete mechanisms.

A token-in-token-out (TITO) gateway records the exact token IDs the inference engine produced, so the trainer never re-tokenizes text and misaligns actions and rewards. Direct double-sided importance sampling reuses the rollout's log-probabilities as the behavior policy and masks tokens whose ratio leaves a band. Samples are dropped if their oldest weight version is too stale, or if the sandbox crashed. A DP-aware router sends every turn of one rollout to the same data-parallel rank, so its prefix stays cached.

Environments are built at scale: over 10,000 verifiable software tasks from real issues in nine languages, thousands of synthesized terminal tasks, and multi-hop search questions. For long searches, a simple keep-recent-k rule replaces old tool results with a stub, and a hierarchical rule adds a full reset past 32K tokens.

THE IDEA, VISUALLY
ASYNCHRONOUS AGENT RL, AS BUILT Task microservices SWE, terminal, search; own rollout + reward Rollout orchestrator 1k+ concurrent rollouts; per-task ratios TITO gateway records token IDs; no re-tokenizing text DP-aware router rollout ID → same rank (consistent hashing) Filter, then train (separate GPUs) drop if oldest weight version is > τ behind; drop sandbox crashes mask tokens with π/π_rollout outside [1−ε_l, 1+ε_h]; push weights every K CONTEXT FOR LONG SEARCH keep-recent-5 older observations → "Tool result is omitted" hierarchical keep-recent, plus discard all history past 32K Base: 744B MoE, 40B active, DeepSeek Sparse Attention. Over 10k verifiable SWE environments, 9 languages. BROWSECOMP BY CONTEXT STRATEGY no context management 55.3 keep-recent-5 62.0 hierarchical (32K) 75.9 Table 7's 62.0 sits beside Kimi K2.5's 60.6 with none CODING AND AGENTS (TABLE 7) GLM-5 Opus 4.5 SWE-bench Verified 77.8 80.9 SWE-bench Multilingual 73.3 77.5 Terminal-Bench 2.0 56.2 59.3 τ²-Bench 89.7 91.6 MCP-Atlas 67.8 65.2 Vending-Bench 2 $4,432 $4,967 Terminal-Bench also 60.7 on the authors' corrected version REWARD HACKING, CAUGHT BY RENDERING Slides RL: the model hid overflowing content and padded spacing to game layout rewards; the renderer was fixed. 16:9-compliant pages, before 40% after RL 92%
GLM-5's report spends its engineering pages on keeping long agent rollouts cheap and trainable: exact tokens recorded at a gateway, each rollout pinned to one cache, stale and crashed samples dropped. A two-rule context policy moved its BrowseComp score more than most model changes do.
Research notes: the problem, approach and results
55.3% → 75.9%

BrowseComp for the same model: no context management, then keep-recent-5 (62.0%), then hierarchical context management

10,000+

verifiable software environments built from real issues across 9 programming languages

40% → 92%

generated slides that keep a 16:9 layout, after RL with rendering-based rewards

THE PROBLEM

Agentic RL rollouts are long and uneven: one slow trajectory stalls a synchronous training step, re-tokenized text corrupts the link between sampled tokens and rewards, sandboxes crash for reasons unrelated to the model, and long searches overflow the context. Each problem wastes GPUs or poisons the training signal.

THE IDEA

Decouple inference and training onto separate GPUs and train asynchronously; log exact token IDs at a gateway; pin every turn of a rollout to one data-parallel rank for KV-cache reuse; drop stale and crashed samples; mask tokens whose policy ratio drifts too far. Build 10,000+ executable coding environments, and fold old tool results to keep search contexts short.

THE RESULT

A 744B-parameter MoE (40B active) scoring 77.8% on SWE-bench Verified against 80.9% for Claude Opus 4.5, and 75.9% on BrowseComp with hierarchical context management, up from 55.3% without any. The weights are released.

02

Why it matters to an FDE

Most teams will never train a 744B model. Several of GLM-5's mechanisms still apply to anyone running agents in production.

Pin a conversation to one cache. Multi-turn agents resend a growing prefix every turn. Routing all turns of one session to the same replica means only the new tokens are computed. The paper does it with consistent hashing on the rollout ID plus light rebalancing; any serving setup with prefix caching benefits.

Log tokens, not just text. If you will ever train, evaluate log-probabilities or debug sampling, keep the exact token IDs the server produced. Re-tokenizing text later does not reliably give them back.

Separate model failures from environment failures. The paper drops samples whose sandbox crashed rather than scoring them as model errors. The same rule keeps evaluation numbers honest.

Context policy is a big lever. On BrowseComp, the same model scored 55.3% with no context management, 62.0% after replacing tool results older than five rounds with a one-line stub, and 75.9% with that rule plus a full reset past 32K tokens. A few lines of code moved the score by 20 points.

Rewards get gamed. Training slide generation, the model learned to hide overflowing content and stretch spacing to satisfy layout checks; the fix was to measure the rendered page, not the markup.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 149 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The asynchronous RL design, stability fixes, environment building, context policy, misreadings

    Free account
  2. 04How it works

    The asynchronous loop, the stability mechanisms, routing, environment pipelines and context policies

    Premium
  3. 05The numbers that matter

    Model scale, Table 7 coding and agent results, context results and the slide RL numbers

    Premium
  4. 06Try it yourself

    Price context folding against a prefix cache, measure cache-affine routing, and test group padding

    Premium
  5. 07Where it breaks

    Uneven comparisons, missing ablations, self-corrected benchmarks and inconsistencies

    Premium
  6. 08Using it on a deployment

    Context policy, cache-aware routing and failure accounting for long-running agents you operate

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →