Skip to content

Agent World Model: Infinity Synthetic Environments for Agentic Reinforcement Learning

Skip →Agent Lightning (2025 → v1.0)
Agents stage 2 #11corefrontierpaperrubric 11/122026 · ICML 2026 · ~55 min

Zhaoyang Wang, Canwen Xu, Boyi Liu, …, Yuxiong He

Read first: Synthetic RL environments for agent training: a map · DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models

Status

TL;DR. Agent World Model (AWM) is a pipeline that has an LLM write whole applications for agents to practise in. Each app is a SQLite database with sample data, a set of MCP tools implemented in Python, ten tasks and verification code. GPT-5 produces 1,000 such apps (35,062 tools, 10,000 tasks) with execution-based self-correction. Qwen3 models trained with GRPO in 526 of them improve on BFCLv3, τ²-bench and MCP-Universe. They beat a baseline in which GPT-5 simulates the same tools, and they beat EnvScaler everywhere except τ²-bench.

Why it matters now. AWM is the clearest current argument for the “synthetic, code-backed” family: let the LLM write the world once, then run it as ordinary code, rather than ask an LLM to imagine every transition. It is also the environment-synthesis method studied in agentic data scaling. For an IR reader the gap is instructive. The authors focus on stateful apps “that necessitate database interactions instead of information retrieval”, so the same recipe for search environments remains open (see Building a retrieval environment).

Each environment is a POMDP whose parts are generated code. The state is a SQLite database. Actions are MCP tool calls. The transition is the generated tool implementation. The reward is verification code run on the final database plus an LLM judge.

Agent World Model: synthesize executable apps, then train an agent inside them Top row: the six synthesis stages, each run by GPT-5 with execution-based self-correction: scenario (1,000 apps), tasks (10 per app), database schema and sample data, toolset schema (about 35 tools per app), MCP server code (about 2,000 lines per app) and verification code that diffs the database. Bottom row: during RL the Qwen3 policy, trained on samples that keep the system prompt, the task, the first list_tools exchange and the last three turns, sends tool calls to an isolated MCP server backed by SQLite; the end state goes to a reward built from the database diff and an LLM judge (1 for completed, 0.1 for partial, 0 otherwise, minus 1 for format errors), and group advantages update the policy. At evaluation the context is extended to 131,072 tokens and the history window is loosened to ten turns on long-context tasks. Agent World Model: synthesize the app, then train in it Synthesis (GPT-5, execution-checked) 1 scenario 1,000 apps 2 tasks 10 per app 3 database schema, data 4 tool spec ~35 per app 5 MCP code ~2k lines 6 verifier DB-diff code each stage: execute, catch errors, retry up to 5 times; up to 10% failures tolerated RL (GRPO; each training sample keeps the task prefix + last 3 turns) Qwen3 policy 4B / 8B / 14B prefix + last 3 turns MCP server + SQLite fresh DB copy per rollout ≤ 20 turns reward r DB diff + judge 1 / 0.1 / 0; −1 format tool call result end state group-normalized advantage over 16 rollouts per task train on 526 envs / 3,315 tasks · evaluate on BFCLv3, τ²-bench, MCP-Universe evaluation: 131k-token context; history window loosened to 10 turns on long-context tasks
Original sketch. Top: AWM's six synthesis stages, each executed and repaired on error. Bottom: RL with an isolated MCP server and database per rollout, a hybrid reward, and training samples that keep a fixed task prefix plus the last three turns. Evaluation loosens the window to ten turns on long-context tasks.

Synthesis. Starting from 100 seed domain names, an LLM proposes scenarios; a classifier keeps those that need create/read/update/delete operations, and embedding de-duplication plus a per-category cap leave 1,000. For each scenario the LLM writes ten tasks that can be solved through an API after login. It then writes a database schema and sample data so every task is executable from the initial state, a toolset schema, the MCP server code and verification code. Every component is run in isolation, errors go back to the model for repair (up to five retries), and up to 10% failures per stage are tolerated. The average environment has 18.5 tables, 129.3 records, 35.1 tools and about 1,985 lines of code (Table 2).

Reward. A format check runs at every step; a violation ends the rollout with reward −1. Otherwise the outcome reward from the code-augmented judge is broadcast to all steps (Eq. 1):

Rτ={1.0Completed0.1Partially completed0otherwise.R_\tau = \begin{cases} 1.0 & \text{Completed} \\ 0.1 & \text{Partially completed} \\ 0 & \text{otherwise.} \end{cases}

History-aware GRPO. Deployed agents often see a truncated history, while many RL pipelines score every action against the full rollout. AWM instead trains each action on a truncated context httrunch^{\text{trunc}}_t. Each training sample keeps the system prompt, the initial user message and the first assistant–tool exchange (the list_tools call), plus the w=3w = 3 most recent turns; loss is computed only on the current turn’s tokens (Appendix A.5). The controlled history ablation (Table 11) uses the same policy at inference. The main evaluation extends the context to 131,072 tokens and loosens the window to w=10w = 10 on long-context tasks. The paper’s simplified objective, to be maximized, is

JGRPO=E[1G∑k=1GA(k)∑t=1Tklog⁡πθ(at(k)∣httrunc,(k))].\mathcal{J}_{\text{GRPO}} = \mathbb{E}\Big[\tfrac{1}{G}\sum_{k=1}^{G} A^{(k)} \sum_{t=1}^{T_k} \log \pi_\theta\big(a^{(k)}_t \mid h^{\text{trunc},(k)}_t\big)\Big].

Here A(k)=(R(k)−mean⁡jR(j))/std⁡jR(j)A^{(k)} = (R^{(k)} - \operatorname{mean}_j R^{(j)}) / \operatorname{std}_j R^{(j)} is the group-normalized advantage of rollout kk among the G=16G = 16 rollouts of one task, shared by all its turns. Negate the expression to use it as a loss to minimize. It is a surrogate that shows which context each action is conditioned on, not a full implementation: clipping and the KL term (coefficient 0.001, Table 12) are omitted.

  • Setup (§5). Qwen3 4B, 8B and 14B thinking models; 526 environments and 3,315 tasks; batch 64 tasks × 16 rollouts = 1,024 isolated environment instances per step; at most 20 turns; GPT-5 as synthesizer and judge.
  • Main table (Table 4, BFCLv3 overall). 8B: base 53.83, Simulator 52.53, EnvScaler 36.83, AWM 65.94. 4B: 54.92 / 55.52 / 54.06 / 64.50. 14B: base 61.25, Simulator 67.68, AWM 70.18.
  • τ²-bench Pass@1. 8B: base 26.44, Simulator 31.30, EnvScaler 39.39, AWM 33.45. EnvScaler wins here; the authors suggest task overlap with τ² domains.
  • MCP-Universe. 8B: 6.70 → 11.17 with AWM (EnvScaler 5.59). AWM is weaker on BFCL’s hallucination category, which the authors attribute to the format reward, which always encourages a tool call.
  • Where gains come from (Table 5, 8B). Biggest on easy items (BFCL simple +26.7, hard +1.1).
  • Environment quality (Table 6). Against EnvScaler on 100 sampled environments judged by GPT-5.1: feasibility 3.68 vs 2.94, blocked tasks 14.0% vs 57.1%. But 74% of AWM environments contain at least one bug (EnvScaler 88%), mostly unhandled edge inputs (44%); about 4% of RL rollouts hit an environment error.
  • Verification ablation (Table 9, 8B BFCLv3). LLM-only 55.46, code-only 60.00, code-augmented judge 65.94. The judge adds about 1.80 USD per training step.
  • Generators (Table 7). Claude-4.5 produced working environment code 99% of the time, Qwen3.5-122B-A10B 77%, so open models can run the pipeline with more repair.
  • Environments are generated once; nothing adapts them to the policy. Between 24% and 28% of tasks were never solved during training, which wastes GRPO groups.
  • Self-correction catches crashes, not wrong semantics; a tool that silently does the wrong thing can reward the wrong behaviour.
  • No conversation, refusal, browser or retrieval scenarios, and no tasks spanning several apps.
  • The judge is a frontier model, and the judge’s verdicts define the reward. Flip rate for a GPT-5.1 judge was 9.2% on repeated runs; for Qwen3.5 it was 23.7% (Table 10).

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    AWM's reward is 1.0 for Completed, 0.1 for Partially Completed, 0 otherwise, and −1 with early termination on a format violation. For one task with a GRPO group of 16 rollouts, suppose 2 are Completed, 4 Partial, 8 fail and 2 break format. Compute the group-mean baseline and the advantage of each outcome type (mean-centred, before std scaling). How would the ranking change if partial credit were 0.5, and what behaviour might that encourage?

    What a strong answer covers
    • Sum = 2(1) + 4(0.1) + 8(0) + 2(−1) = 2 + 0.4 − 2 = 0.4; mean = 0.4 / 16 = 0.025.
    • Advantages: Completed 0.975, Partial 0.075, fail −0.025, format error −1.025. Partial is barely above failure, so the gradient mostly separates full success from failure and punishes format errors.
    • With 0.5 partial credit: sum = 2 + 2 − 2 = 2, mean 0.125; Partial gets +0.375, close to half of Completed (+0.875), so the policy is paid well for doing part of the job.
    • Large partial credit invites stopping early or doing the easy sub-steps, a mild form of reward hacking; a judge that labels Partial generously would amplify it. Keeping it at 0.1 makes partial progress a tie-breaker rather than a target.
  2. Mechanism

    Walk through how AWM turns a one-line scenario into a trainable environment, and how it makes the environment trustworthy enough for RL: where execution checks are used, what the verifier sees, and why the authors add an LLM judge on top of verification code.

    What a strong answer covers
    • Scenario (from 100 seed names to 1,000 filtered scenarios) → 10 API-solvable tasks → SQLite schema and sample data that make every task executable from the start → toolset schema → MCP server code → verification code.
    • Each generated component is run in isolation; on error the message goes back to the LLM for repair, up to 5 retries, with up to 10% failures tolerated per stage. Table 1 reports first-try success above 85% and about 1.13 attempts per component.
    • The verifier runs on the final database, compares it with the initial state, and passes the changed records and success criteria to a GPT-5 judge together with the trajectory.
    • Code-only checks are brittle when the generated environment itself has bugs (false negatives); LLM-only judging is not grounded in state. The combination scored best (Table 9: BFCLv3 65.94 vs 60.00 code-only vs 55.46 LLM-only at 8B).
  3. What if…

    Table 11 compares history-aware training (sliding window w = 3 in both training and inference) with full-history training, under aligned and misaligned inference. Explain why truncating history during training matters, what the table shows, and what it implies for any agent trained in one harness and deployed in another.

    What a strong answer covers
    • Many RL frameworks score all actions of a rollout in one forward pass over the full history, but deployed agents often truncate or compact context. Training on full history then optimizes a different conditional distribution than the one used at test time.
    • AWM applies the same truncation during optimization (Eq. 3): each training sample keeps the system prompt, the initial user message and the first list_tools exchange, plus the three most recent turns, so each action is trained on the truncated context the agent sees under the matching inference policy (Appendix A.5). The main evaluation loosens the window to ten turns on long-context tasks.
    • At 4B, aligned history-limited training reaches 64.50 BFCLv3 versus 55.35 without the limit; running the history-limited model with full history (misaligned) hurts, with τ² Pass@1 dropping from 22.57 to 9.35. The full-history model is fairly insensitive to misalignment, so the cost of truncation-aware training is a dependence on the deployed context policy.
    • General lesson: the harness (context management, tool formats, compaction) is part of the environment; train in the harness you will deploy, or randomize over harnesses.
  4. Critique

    AWM wins clearly on BFCLv3 and MCP-Universe, but EnvScaler beats it on τ²-bench, and the authors judge environment quality with GPT-5.1 and Claude. Critique the evaluation: which comparisons are fair, which claims depend on the judge, and what the bug statistics mean for the reward signal.

    What a strong answer covers
    • Fair: the Simulator baseline uses the same tasks and tools with GPT-5 as the transition model, which isolates "executable state" from "LLM-imagined state". AWM beats it at all sizes on BFCLv3 (for example 65.94 vs 52.53 at 8B).
    • τ²-bench: EnvScaler scores higher (39.39 vs 33.45 Pass@1 at 8B); the authors suggest EnvScaler's tasks may overlap with τ² domains, but this is not tested. AWM also omits conversation and refusals, which τ² and BFCL hallucination tests stress.
    • Quality numbers (feasibility 3.68 vs 2.94, blocked tasks 14% vs 57%) come from LLM judges on 100 sampled environments; Claude gives similar but not identical numbers.
    • Bugs: 74% of sampled AWM environments have at least one bug (4.13 per environment, mostly unhandled edge inputs), yet only about 4% of rollouts hit environment errors. Bugs that silently accept wrong actions could reward wrong behaviour; the paper does not measure this.
    • MCP-Universe gains are small in absolute terms (6.70 → 11.17 at 8B) and the benchmark includes browser and retrieval tasks AWM never trains on.
  5. Design

    Adapt AWM to synthesize retrieval environments for a search agent instead of CRUD apps. Specify what replaces the SQLite state, the toolset, the tasks and the verification code, and what new failure modes you would have to check that AWM did not face.

    What a strong answer covers
    • State: a document collection plus an index (BM25 and dense), possibly with a mutable notes or memory store; the "database" is read-mostly, so the end state no longer encodes success.
    • Tools: search with different retrievers, fetch document, open section, optionally filter by date or source; the generated tool code is the retrieval pipeline.
    • Tasks and verification: questions built from known evidence chains, verified by answer matching plus a check that cited documents contain the evidence; a DB diff has no analogue, so a judge must compare the answer and citations.
    • New failure modes: answers guessable without search, leakage of answers into snippets, retriever bugs that hide the evidence, and judges rewarding fluent but unsupported answers.
  6. Research idea

    AWM lists three limitations: environments are generated once, self-correction only catches runtime errors, and there are no cross-environment tasks. Pick one and design a study that would show whether fixing it improves agents, including the control condition and the metric.

    What a strong answer covers
    • Self-evolving environments: regenerate or harden environments where the policy saturates or where tasks are never solved (27%, 24% and 28% of tasks were never solved by the 4B, 8B and 14B models during training); compare with a fixed set at matched RL compute.
    • Semantic correctness: add property tests or a second LLM that writes adversarial tests for tool code; measure bug rate and whether training on cleaner environments improves held-out scores.
    • Cross-environment tasks: compose two apps (for example calendar and email) with a shared task; test transfer to multi-app benchmarks against single-app training.
    • Metrics: held-out real benchmarks (BFCLv3, τ²-bench, MCP-Universe), environment-error rate during RL, and a reward-hacking audit of high-reward rollouts.

Done with this page?

Status