Skip to main content
To train on examples you need examples. One example is one full attempt at the job: what the customer asked, what state the world was in, every tool the agent called and what came back, and what it finally said. Saved together, that is one row. A training set is a pile of rows.

The mechanism

The field calls one saved attempt a rollout. The word comes from rolling the dice once: same ask, and the model may answer differently each time. Rows come from two places.
  • Your traffic. Real conversations, read from your logs. Best when you have them, because they are the failures you actually see.
  • Simulation. When you have little traffic, or want the situations your traffic has not hit yet, the library writes them. It reads your agent’s tools and system prompt, writes asks a customer might send, plays the agent through them against a fake world where the tools sometimes fail on purpose, and saves every attempt as a row.
The stand-in agent below is seeded_agent. It does the job honestly most of the time and, on a known share of rows, does one thing wrong on purpose and writes what it did in the row’s seeded field. That field is the answer key you will check everything against in the next lessons. repeats=4 plays every ask four times. Lesson 4 needs that.

Run it

Read the row top to bottom. The customer asked about an order. The agent called the one tool it has, and the fake world refused it, on purpose. The agent told the truth about that, and also apologized twice, which is the mistake the stand-in planted. Sixty-four of these, sixteen asks times four tries, took a few seconds and no key.

Where it comes from

  1. Yao, S. et al. τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. arXiv:2406.12045, 2024. The shape of a row here: an agent, a simulated user, tools, and world state.
  2. Lambert, N. Reinforcement Learning from Human Feedback. arXiv:2504.12501, 2025. Chapter Reinforcement Learning: a rollout is one sample from the policy, the model being trained.

Next

A reward is a score you can defend: which of the 64 rows are good.
Last modified on September 19, 2026