LLM-simulated environments: DreamGym and Simia
Read first: Synthetic RL environments for agent training: a map
TL;DR. If writing environments is the bottleneck, let a model be the environment. DreamGym (Meta and collaborators, Nov 2025) trains a reasoning “experience model” that, given the history, the task and retrieved similar past transitions, reasons step by step and outputs the next abstract text state and the reward. A curriculum generator proposes task variants where the agent’s rewards vary most. On WebShop and ALFWorld, RL purely inside DreamGym matches GRPO and PPO trained on 80K real transitions; warm-starting in DreamGym and then using 5K real transitions (DreamGym-S2R) beats both. Simia (Microsoft, Nov 2025) skips training a simulator: a reasoning model (GPT-5 or o4-mini) simulates tool responses from a tool description, amplifying small seed sets into large SFT corpora, and o4-mini simulates the environment and judges success for RL. Both papers show that the environment’s faithfulness now matters more than its existence.
Key idea
Section titled “Key idea”DreamGym’s three parts.
- Experience model. SFT on offline trajectories annotated with reasoning. At each step it receives the history, task and top-k transitions retrieved from a replay buffer by embedding similarity. It produces a chain of thought, then the next state and reward.
- Replay buffer. Seeded with real offline data, then refreshed with synthetic transitions so it co-evolves with the policy.
- Curriculum task generator. For seed tasks, compute the reward variance of a group of rollouts and generate variants of the high-variance ones. Nonzero variance means the task is “feasible yet challenging”.
Rewards are outcome-based. Any standard RL algorithm (PPO, GRPO) runs on top.
Simia’s two pipelines.
- Simia-SFT amplifies seeds into trajectories: APIGen-MT ~5K to 90K, AgentTuning’s 668 samples to 15K, OfficeBench’s 76 one-app tasks to 30K multi-app ones. GPT-5 and o4-mini generate at temperature 1.0. LLM pre-filtering and rule-based checks clean the output.
- Simia-RL runs the policy against o4-mini acting as the environment, which then assigns reward 1 or 0 for task success.
Results. DreamGym (Table 1) matches GRPO and PPO trained with 80K real transitions on WebShop and ALFWorld, and DreamGym-S2R with 5K real transitions beats them. Table 2 ablations on WebShop / WebArena: full model 63.9 / 13.3, without replay buffer 59.2 / 9.7, without reasoning 55.8 / 7.3, without task generation 57.3 / 7.3. Simia-Tau (Qwen2.5-32B) averages 58.9 on τ²-Bench Airline and Retail (56.0 and 61.7). That beats GPT-4o by 4.7 and xLAM-2-70B (56.3) by 2.6, and trails o4-mini by 4.3. With equal data size, simulated trajectories match real ones on OfficeBench and AgentBench and do better on τ²-Bench; they also keep improving as size grows. RL in the simulated OfficeBench beats RL in the real one (64.7 vs 60.8 on 2-apps; 34.5 vs 28.6 on 3-apps). Code: microsoft/Simia-Agent-Training.
Connections
Section titled “Connections”- The search-specific version: ZeroSearch has an LLM write the retrieved documents, with a noise curriculum. Turning that into a full environment design is covered in Building a retrieval environment.
- Industrial use: Kimi K2’s stateful tool simulator, “functionally equivalent to a world model”, in lab pipelines.
- The opposing camp, which executes generated code instead of simulating: Agent World Model, AgentScaler and EnvScaler.
- When the judge is a model, the policy can game it: verifier robustness, noisy verifiers.
- Variance-based task selection: DAPO dynamic sampling, RLVE adaptive difficulty.
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.
- Mechanism
DreamGym's experience model conditions on the interaction history, the task, and the top-k past transitions retrieved by cosine similarity of (state, action) embeddings, and reasons before predicting the next state and reward. Explain why retrieval is in the loop, what Table 2 shows when it is removed, and how this resembles retrieval-augmented generation.
What a strong answer covers
- The model predicts states in an abstract text space; without grounding it can invent page contents or outcomes that the real environment would never produce.
- Retrieved transitions from a replay buffer (seeded with offline real data, then enriched online) act as evidence for what the environment does in similar situations, which the paper says reduces hallucinations.
- Removing the replay buffer drops WebShop from 63.9 to 59.2 and WebArena from 13.3 to 9.7; removing reasoning hurts more (55.8 and 7.3).
- This is RAG with the environment as the generator: retrieval quality and corpus coverage (the buffer) bound simulator faithfulness, and a stale buffer drifts from the current policy's states.
- Derive / compute
DreamGym's task generator prefers seed tasks whose group of rollouts has high reward variance, V = (1/n) times the sum over i of (r_i minus the mean reward) squared. For binary rewards with success rate p, derive V and the p that maximizes it, and connect this to the RLVE and DeepSeek-V3.2 difficulty filters.
What a strong answer covers
- With binary rewards the mean is p and V = p(1 − p), maximized at p = 0.5, where successes and failures are balanced.
- V = 0 at p = 0 or 1: GRPO advantages vanish, so such tasks give no gradient; high-variance tasks are "feasible yet challenging".
- RLVE raises difficulty when accuracy passes a threshold and uses DAPO dynamic sampling to discard actual identical-reward groups; DeepSeek-V3.2 drops tasks with no success in 100 selection runs, which removes never-solved tasks but does not guarantee mixed outcomes in later groups (always-solved tasks also stay). DreamGym uses variance to choose seeds for new tasks, not as a group filter. They target the same signal at different points in the pipeline.
- Caveat: the variance is measured under the simulator's rewards, so a simulator that is wrong about success shapes the curriculum too.
- Critique
Simia finds that RL in a simulated OfficeBench environment beat RL in the real one (2-apps 64.7 vs 60.8; 3-apps 34.5 vs 28.6), and its case study credits richer, adaptive error messages from the simulator. Argue both sides: is this evidence that simulators are better teachers, or a warning sign?
What a strong answer covers
- For: informative feedback is a form of shaping; real environments with terse errors give little to learn from, and the policy is evaluated on the real benchmark, so the gain is not just inside the simulator.
- Against: o4-mini is both simulator and 0/1 judge, so the policy can learn to please one model; helpful errors that real tools never emit may build habits that fail at deployment.
- The comparison is one benchmark and one backbone (Qwen2.5-7B); on τ²-Bench the real environment needs a simulated user, so no direct comparison was made.
- Test you would add: evaluate on real tools with realistic (terse, inconsistent) errors and on a held-out app; vary the simulator model and check whether rankings of policies agree with real-environment rankings.