Building the Worlds: Generating Training Environments
A story: the translator and the airline pilot
To train a translator, you only need to collect. Gather millions of already-translated pages, put them in front of the learner, let the learning happen. The material already exists out in the world; the job is to find it, clean it, sort it.
To train an airline pilot, that method collapses. Nobody learns to fly by reading flight transcripts. You need a simulator: a cockpit that responds to the controls, weather that changes, failures you can trigger on demand, and an instructor who can say at the end "landed" or "crashed". Nobody found that simulator lying around. Somebody had to build it.
That is precisely the shift that has happened in language-model training. For a text model, you collect data. For an agent (a model that acts, calls tools, edits files, queries databases) you have to manufacture the world it acts in: tools that genuinely respond, databases with real content in them, and tasks whose success can be checked automatically.
And manufacturing that world has become the real bottleneck, more so than the learning algorithm.
This whole page is about training by reinforcement learning (RL): learning from trials, scores and corrections. The machinery that runs that loop is described in Training LLM agents with RL, and what changes inside the algorithm itself in Training an agent.
A training environment for an agent is three inseparable things:
- A state: files, a database, a machine, a website, something that exists and that the agent's actions actually change.
- A task: a natural-language instruction ("archive every log older than 30 days into a compressed file").
- A verifier: a piece of code that, at the end, says yes or no. Not "that was pretty good", yes or no.
Remove the third element and you have a demo, not a training environment.
The "before": exam halls, not training grounds
Until recently, the publicly available environments were benchmarks: task collections built to measure models, not to train them. The difference is not cosmetic, and the limits of benchmarks themselves are set out in Why benchmarks lie about real capabilities.
- A benchmark holds a few hundred tasks, enough to grade, nowhere near enough to learn from. RL needs thousands of tasks, each replayed dozens of times.
- A benchmark is frozen. It does not adapt to the model's level: tasks the model already solves teach it nothing, and neither do tasks it always fails (more on this below).
- A benchmark wears out: the moment you train on it, it stops measuring anything.
In one sentence: the flaw in benchmarks that environment generation fixes is that they are finite and frozen, what is needed is not a dataset but a pipeline that can keep producing them indefinitely, and that tracks the model's level as it improves.
The result that flips your intuition
In January 2026, work by Kanishk Gandhi, Shivam Garg, Noah D. Goodman and Dimitris Papailiopoulos made the idea very concrete.
Endless Terminals: Scaling RL Environments for Terminal AgentsThe object of study is the terminal agent: a model that receives an instruction and carries it out by typing commands into the terminal of a Linux machine, the text interface through which a computer is driven from the command line. The authors build a fully autonomous pipeline, with no human annotation, in four stages:
- Generate diverse task descriptions (file operations, log management, data processing, scripting, database operations).
- Build and validate containerised environments, one Docker container per task (a container is a pre-packaged miniature machine, with its own filesystem and programs, that you can launch and throw away at will), with its files and data, plus a check that the container actually comes up and holds together.
- Produce the completion tests: the code that will decide, at the end, whether the task was accomplished.
- Filter for solvability, discard tasks no model ever manages to solve, or whose test is broken.
The pipeline yields 3,255 tasks. Then comes the surprising part: training uses vanilla PPO (Proximal Policy Optimization, the standard RL algorithm since 2017, covered in PPO, value functions and actor-critic) a binary reward granted at the end of the episode (solved = 1, failed = 0), and a minimal interaction loop: no retrieval, no coordination between several agents, no specialised tooling.
Despite that deliberate simplicity, on the authors' held-out dev set:
| Model | Before | After |
|---|---|---|
| Llama-3.2-3B | 4.0% | 18.2% |
| Qwen2.5-7B | 10.7% | 53.3% |
| Qwen3-8B (already fine-tuned) | 42.6% | 59.0% |
A 7-billion-parameter model therefore moves from roughly 10% to over 50% success. The authors' conclusion is the lesson of this page: the missing ingredient was not the algorithm, it was the environments. Simple RL works as soon as environments scale.
Those figures are measured on the authors' own held-out set, built by the same pipeline, that is, tasks of the same nature as the ones seen in training. On an external, human-curated benchmark (TerminalBench 2.0), the reported scores live on a completely different scale: Llama-3.2-3B goes from 0.0% to 2.2%, Qwen2.5-7B from 2.2% to 3.4%, and the already fine-tuned model from 1.1% to 6.7%.
Two readings to hold at once. Transfer is real, all three models improve, and the authors report beating competing approaches equipped with more elaborate agentic scaffolds. But these are absolute scores of a few per cent: going from 2.2 to 3.4 on a realistic benchmark is nothing like going from 10.7 to 53.3 on your own tasks. This is the nuance that always disappears when a result is compressed into a headline.
The principle: don't let an LLM play the world
Here is the natural temptation, and the trap. Building a real environment is expensive. So why not ask a language model to play the world? The agent says "I'm calling the booking service" (its API, application programming interface, the socket through which one program calls another) and a second model makes up that service's response. It is instant, it needs no infrastructure, and it looks like it works.
The problem is that nothing enforces state consistency. A language model simulating a database does not have a database: it has a conversation. On turn 3 it announces the booking is confirmed; on turn 12, asked again, it has forgotten, or invents it differently. The agent is then learning on sand, and worse, it learns to exploit the simulator's inconsistencies rather than to solve the task.
The answer emerging from recent work is that state must be grounded in real code and real databases. Tools are functions that genuinely execute; state is a database you can query; transitions are deterministic.
Agent World Model: Infinity Synthetic Environments for Agentic Reinforcement LearningThat work builds a thousand synthetic environments covering everyday scenarios, and states the argument explicitly: these environments are code-driven and backed by databases, which yields more reliable and more consistent state transitions than environments simulated by an LLM. A second benefit, and not a small one: because the database state is accessible, you can write reliable reward functions, simply query the database afterwards.
It would be dishonest to present this as decided. Recent work argues the opposite: with a careful enough protocol (task generation, user simulation, tool simulation, trajectory evaluation, plus a curriculum that controls difficulty), an environment fully simulated by an open 8-billion-parameter model makes a surprisingly strong (and very cheap) baseline.
The cautious 2026 reading: grounding in real code remains preferable whenever you can afford it, especially for anything involving persistent state; LLM simulation remains a reasonable option when budget or domain force your hand. The question is open.
The TRUSTEE method (Chenming Tang, Hsiu-Yuan Huang, Weijie Liu et al., April 2026) simulates the entire environment (task generation, user, tools, trajectory evaluation) with an open 8-billion-parameter model, and adds an adaptive curriculum that controls difficulty during training. The authors report beating, in most cases, methods that require extra external resources.
Democratizing Tool Learning with Environments Fully Simulated by a Free 8B Language ModelInverting the problem: manufacture the bugs instead of hunting them
The third pillar is a trick of reasoning, and perhaps the most elegant idea in the field.
In one sentence: the flaw in harvesting real bugs that SWE-smith fixes is that it demands rebuilding an execution environment per bug; by deliberately breaking a repository that works, you pay for that environment once and get thousands of tasks out of it.
To train an agent to fix bugs, the obvious route is to hunt for real bugs in the history of public repositories, find the commit that fixed each one, rebuild the period-correct environment and check that the tests pass. It is doable, and punishingly laborious: you must track down the right version of every dependency, build one execution image per bug, and the result runs to hundreds or a few thousand tasks after hundreds of hours of human work.
The inversion: start from a repository that works, and deliberately break the code.
SWE-smith: Scaling Data for Software Engineering AgentsSWE-smith's principle has two beats. From any Python codebase, you build one execution environment, that is the fixed cost, paid once. Then you automatically synthesise hundreds to thousands of modifications that break existing tests in that repository.
Each breaking modification becomes a task: "here is the repo, this test fails, fix it". And verification is free by construction, the very test used to manufacture the bug is the one that certifies the repair. You also know beyond doubt that a solution exists: it is the original code.
The order of magnitude changes entirely. The authors produce 50,000 tasks from 128 GitHub repositories, an order of magnitude more than all prior work, and the model trained on them (SWE-agent-LM-32B) reaches 40.2% Pass@1 resolve rate on SWE-bench Verified, the best result among open-source models at the time of publication.
The general recipe: find the direction in which the problem is easy. Finding a bug is hard; making one is trivial. Solving a task is hard; taking a solution apart is easy. Whenever you can generate a problem from its solution, you get the task and its verifier in the same stroke. It is the same reversal that makes diffusion models work: the network never learns to create, it learns to undo a destruction you organised yourself.
Verifiers: three families
An environment is worth exactly what its verifier is worth. The Reward modeling and RLVR page (Reinforcement Learning with Verifiable Rewards) explains why a verifiable reward beats a learned reward model; here we simply catalogue the forms it takes for an agent, where the question is no longer "is the answer correct?" but "was the task accomplished?".
One point of vocabulary worth pinning down, because it is the commonest source of confusion: in this whole arrangement, exactly one thing is learned.
| Item | What it is | Status |
|---|---|---|
| The agent's weights | what we are training | learned |
| The environment (files, database, container) | the world state that actions modify | built once, then reset for every attempt |
| The verifier | the test that says yes or no | code written in advance, nothing to learn |
| The reward | the score of one attempt | recomputed every attempt, then discarded |
That is the whole difference from RLHF, where the score comes from a learned reward model fitted to human preferences, a model you can therefore fool. Here the judge is a program.
That program takes, in practice, three forms:
| Family | How success is established | Typical example | Main fragility |
|---|---|---|---|
| Test execution | Run the test suite | Bug fixing, code writing | Incomplete tests → agent passes without solving |
| State assertions | Query the database after the action | "Is the booking actually cancelled?" | You must anticipate every column that matters |
| Target-state comparison | Compare final state to a reference state | File manipulation, data transformation | Too strict: several correct states may exist |
Two deeper remarks.
First, these verifiers are built alongside the task, not after it. That is what makes automatic generation possible: the pipeline that invents the task also invents its judge, and throws the task away if it cannot write a trustworthy judge.
Second, an overly permissive verifier is far more dangerous than an overly strict one. A strict judge costs you signal; a permissive judge actively teaches cheating. That is the reward-hacking mechanism, covered in What breaks when you run RL on an LLM.
Standardisation: a Gym for agents?
Classical RL had this moment. Gym, now Gymnasium, is the library that fixed, for RL research, the standard way of talking to an environment. Before 2016, every lab wrote its own simulation code and nothing was comparable; then a minimal interface took hold, three functions, reset to start clean, step to play an action and receive back the observation and reward, plus access to state, and suddenly any algorithm could run against any environment.
The same movement is under way for agents, and it is unfinished. What can be described safely is its three recurring requirements:
- A common execution interface, the same three or four calls for every environment, whatever its nature.
- Standard packaging, the environment shipped as a container, exposed over an ordinary protocol, so it installs and runs without bespoke integration.
- A shared catalogue, somewhere to publish and pull environments the way models and datasets are published today.
Several initiatives push in that direction. The open OpenEnv project, developed jointly by Meta's PyTorch team and Hugging Face, explicitly adopts the Gymnasium interface (reset, step, state) on top of Docker containers reached over HTTP (the ordinary protocol of the web), with a hosted catalogue; its authors describe it as experimental. On the evaluation side, the CUBE proposal aims to unify agent benchmarks on top of MCP and Gym, starting from the observation that hand-integrating each new benchmark is an unsustainable "integration tax".
On the tool side, the MCP protocol (Model Context Protocol, see MCP: the integration standard) already plays an adjacent role: it standardises how an agent discovers and calls external tools.
It would be rash to announce which of these efforts will prevail, or even that a single one will. What is observable in 2026 is the convergence of requirements (common interface, containerisation, catalogue) far more than an established standard. Treating any one of these projects today as "the standard for agent environments" would be getting ahead of the facts.
The economics: what a world costs
The last piece, and probably the most decisive in practice: building a good environment is expensive.
There is no public price list: what exists are interviews with vendors and labs, collected in 2026 by the research group Epoch AI in its write-up An FAQ on Reinforcement Learning Environments. The figures below are therefore statements by market participants, to be read as orders of magnitude and not as prices.
- A quality training task: $200 to $2,000 apiece, according to two independent sources (a founder in the sector, a lab researcher).
- The extreme cases cited: around $20,000 for an especially complex software-engineering task, rare, but possible.
- Replicating a whole interface as a training ground: on the order of $20,000 for a website clone, with one source mentioning around $300,000 for a faithful reproduction of a complex product.
Those figures explain the intense interest in the automatic pipelines described above: going from 128 repositories to 50,000 tasks with no human annotator, or producing 3,255 containerised environments with no intervention, changes the nature of the economic problem.
A task the model never solves provides no learning signal. This is not about pedagogical kindness; it is mechanical. RL learns by comparing attempts; if every attempt fails, there is nothing to compare, the gradient is zero, and the task was paid for nothing. Symmetrically, a task solved every single time teaches nothing either.
Signal peaks when the model succeeds sometimes. Hence the solvability filter present in every serious pipeline (in Endless Terminals it is explicitly the fourth stage) and hence the idea that the environment pool must evolve with the model: what was instructive at a 10% success rate no longer is at 90%. The advantage arithmetic that makes this concrete is detailed in Training LLM agents with RL.
This coupling is what makes the whole business hard: an environment's value is not intrinsic, it depends on which model you are training and when. A catalogue of environments goes stale.
Why this matters
Three reasons.
The bottleneck has moved. For years, progress meant a better algorithm or more compute. The Endless Terminals result says something else: with PPO from 2017 and a binary reward, you get large gains as soon as you have thousands of sound environments. What was missing sat upstream.
The decisive skill changed nature. Building a reliable, containerised environment with a verifier that cannot be fooled is software engineering as much as machine-learning research. That shift in centre of gravity is visible in the publications and in the org charts alike.
It creates an asset class. A pipeline that can generate, validate and filter environments is an industrial asset, reproducible, expensive to build, and directly correlated with the final model's performance. It is exactly where the competition between labs is playing out: not "a better learning algorithm", but "a method for automatically manufacturing verifiable training tasks".
Key takeaways
- Collecting is no longer enough. A text model trains on data you find; an agent trains inside a world you build, responsive tools, populated databases, tasks whose success is checked automatically.
- Environments were the missing piece, not algorithms. A fully autonomous pipeline (generate tasks, build and validate containers, produce tests, filter out the unsolvable) yielding a few thousand tasks is enough to take a 7-billion-parameter model from roughly 10% to over 50% success, using vanilla PPO and a binary reward, on the authors' held-out set; on an external benchmark the scores stay in the low single digits.
- Don't let an LLM play the world. A model simulating a database has no database: it forgets and invents. State must be grounded in executed code and real databases, though recent work defends cheap full simulation, and the point remains contested.
- Invert the problem. Instead of hunting real bugs, start from a working repository and synthesise thousands of bugs that break existing tests: task and verifier come from the same gesture, and a solution is guaranteed to exist. 128 repositories → 50,000 tasks.
- The verifier is the environment. Test execution, assertions on database state, comparison to a target state: three shapes of the verifiable reward (see the RLVR page). It is code, not a learned model, which is where its robustness comes from. A permissive judge is not the lesser evil: it teaches cheating.
- Economics and solvability are linked. A task costs $200 to $2,000 according to the interviews collected by Epoch AI, and is only worth anything if the model has some chance of solving it: never solved, zero gradient, money burned. The environment pool must therefore evolve with the model, and the still-unfinished standardisation of interfaces aims to make these worlds interchangeable.
1. According to the page, what separates a training environment for agents from a mere demo?
2. With Endless Terminals, Qwen2.5-7B jumps from 10.7% to 53.3% success. What nuance does the warning box impose?
3. Why not simply ask a second language model to play the role of the world, inventing the tools' responses?
4. SWE-smith starts from a working repository and deliberately breaks the code. What does this inversion buy?
5. A training task so hard that the model never succeeds at it: what learning signal does it provide?