IN THIS BREAKDOWN · 10 SECTIONS
You can read 19% of this breakdown.
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.
Research notes: the problem, approach and results
BrowseComp for the same model: no context management, then keep-recent-5 (62.0%), then hierarchical context management
verifiable software environments built from real issues across 9 programming languages
generated slides that keep a 16:9 layout, after RL with rendering-based rewards
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.
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.
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.
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.
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
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
The asynchronous RL design, stability fixes, environment building, context policy, misreadings
Free account - 04How it works
The asynchronous loop, the stability mechanisms, routing, environment pipelines and context policies
Premium - 05The numbers that matter
Model scale, Table 7 coding and agent results, context results and the slide RL numbers
Premium - 06Try it yourself
Price context folding against a prefix cache, measure cache-affine routing, and test group padding
Premium - 07Where it breaks
Uneven comparisons, missing ablations, self-corrected benchmarks and inconsistencies
Premium - 08Using it on a deployment
Context policy, cache-aware routing and failure accounting for long-running agents you operate
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
