WorldTrainer

Practice environments for AI agents, graded by real tools.

Each environment gives an agent a task, a starting state it can reset exactly, and a program that checks the result, such as a test suite, a compiler or a validator. The agent's attempts and the checker's results train the agent with reinforcement learning. We call each environment a world.

Available now: code. In progress: motion graphics, local inference.

SimulationFigure 1. Each line is one agent attempt. A red mark is where a checker said no and the attempt stopped. Gold lines passed every check. Point at a red mark to read the checker's line; each line is in that tool's own output format.

How training works

The agent tries the same task several times. The checker scores each try. Each training step makes the higher-scoring tries more likely next time. Figure 2 shows this for one bug with five possible fixes.

Task: fix: date parser rejects 29 FebChecker: pytest
Probability of each way of trying, over updates
SimulationFigure 2. A policy over five ways to fix one bug. Each update samples eight attempts, grades them with pytest, and shifts probability toward attempts that beat the group's average. Press Run, then reset and turn on "The checker can be fooled": the policy learns to delete the failing test, because that passes every time.

What a world contains

A world contains three things: a task, a starting state, and a checker that scores the result with no person involved. Tasks and starting states are easy to make. A good checker is the hard part.

task

A task

Work people already do with the tool, not a puzzle written for a benchmark.

fix: date parser rejects 29 Feb
start

A starting state

The same state every time, so any two runs can be replayed and compared.

repo @ 4f2a91c, seed 23
checker

A checker

A program that scores the result. It must be cheap to run, exact, and hard to fool.

pytest → 1 failed, exit 1
Real tool formatsTable 1. Checkers that already exist, and what their no looks like, each in the tool's own output format.
CheckerJudgesA no
cargo testRust codeerror[E0382]: borrow of moved value: `plan`
pytestPython codeFAILED tests/test_dates.py::test_leap_year
mvec validateMotion graphics documentsunknown variant `material.metallic`
psqlDatabase queriesERROR: column "user_id" does not exist
terraform planInfrastructureError: Unsupported argument

Why the checker must be hard to fool

If the agent can pass the checker without doing the task, it learns to do exactly that. In Figure 2, the agent learns to delete the failing test.

Video has no single pass/fail test, so the video world checks in this order:

  1. The file is valid.
  2. The video renders.
  3. Measured properties pass: length, legibility, contrast and stability.
  4. A judge model ranks only the attempts that passed.

Figure 3 compares that order with using the judge model alone.

Brief: 10 s title card, 1920×1080. "Launch day" fades in over 1 s and stays legible.
exactmeasuredjudged
Five sampled framesvalidrenderlengthlegiblecontraststeadyjudgereward
Reward is
IllustrativeFigure 3. Six attempts at one brief, drawn as five sampled frames each. Click an attempt to read the checker line that stopped it. The mvec validate line is real output from the MotionVector engine; the other attempts and scores are drawn for this figure.

Worlds and their status

WorldJudged byStatus
CodeTests pass, the build is green, and the work reaches a commit. Traces come from AgentWorth.Open
Motion graphics and videoThe document validates, the frame renders, and the result matches the brief. Each render also carries the exact truth of its scene, so the same world makes data for world models.In progress
Local inferenceA dated measurement on a named machine: did the model fit, and how fast did it run.In progress
VoiceThe transcript matches, and the wake word fires.Later
YoursBrowsers, spreadsheets, infrastructure, CAD, science: whatever your tool can judge.Open to world builders

Adding a world

If you maintain a tool that can tell a correct result from a wrong one, that tool can be a world's checker. You write the tasks and starting states, and we connect the world to agents.

  1. Pick a tool that can tell pass from fail.
  2. Write the tasks and the state each one starts from.
  3. Publish the checker, so anyone can see how work is judged.

Bounties are planned, but none are open yet.

# one task in a world
task.md     fix: date parser rejects 29 Feb
start/      repo @ 4f2a91c, seed 23
check       pytest -q tests/test_dates.py

# what the checker returns
FAILED tests/test_dates.py::test_leap_year
exit 1
IllustrativeFigure 4. The shape of one task: what to do, where it starts, and the command that judges it.

Where the results go

Runs from WorldTrainer, failed runs included, can go to CommonGain, an open dataset of agent traces.