01

One rollout

An answer is the visible end of a path. Start by seeing the path.

What was the rollout?

You give a language model a small task:

A box has 3 red labels and 2 blue labels. How many labels? Reply with one digit.

It replies 5. What, exactly, was the rollout?

Not the digit alone. In this article, one rollout is one sampled trajectory: the path from the starting prompt through generated actions to a stopping condition. The completed text is the part you can read. The path explains how that text was produced.

RL introductions commonly use trajectory, episode, and rollout for this idea, although individual systems may use “rollout” for a shorter segment. Spinning Up: trajectories

A longer context, one action at a time

For a simple text-only, single-turn interaction, picture the prompt as the beginning of a line. The model selects a token, appends it, and uses that longer context for the next selection. Eventually generation stops.

Figure 001Each token becomes context
One rollout: a growing token contextFour successive states retain the same prompt. Each sampled token is appended to the next context. Sampling continues until a declared stop. The complete path is one rollout.CONTEXT USED FOR THE NEXT DRAW1prompt xsample next token2prompt xa1sample next token3prompt xa1a2… then continue to stop4prompt xa1a2a3One prompt-to-stop path = one rolloutstopOne rollout: a growing token contextFour successive states retain the same prompt. Each sampled token is appended to the next context. Sampling continues until a declared stop. The complete path is one rollout.CONTEXT USED FOR THE NEXT DRAW1prompt xsample a12prompt xa1sample a23prompt xa1a2sample a34prompt xa1a2a3One prompt-to-stop path = one rolloutstopSymbolic tokens, not tokenizer pieces.
The prompt stays; the generated prefix grows. A completion is the generated sequence rendered as text. Token marks are symbolic, not actual tokenizer boundaries; this is a simple text-only mapping.

We can name the parts without guessing how a particular tokenizer would split the words:

st=(x,a1,…,at−1),at∼πbeh(⋅∣st)s_t=(x,a_1,\ldots,a_{t-1}), \qquad a_t\sim\pi_{\mathrm{beh}}(\cdot\mid s_t)

Here xx is the prompt, sts_t is the prompt plus the generated prefix, and ata_t is the next token. The policy πbeh\pi_{\mathrm{beh}} supplies the action probabilities. Repeating these steps gives one trajectory, τ=(x,a1,…,aN)\tau=(x,a_1,\ldots,a_N), where NN is the number of generated tokens.

The subscript “beh” means this policy generated the behavior; chapter 5 will make that distinction useful. This token/state mapping is a synthesis for the stated text-only case, not a model of every tool-using agent. DeepSeekMath §4.1.1

First collect, then evaluate

The rollout exists before a reward function scores it. A score can be attached afterward; an update may happen later still. Neither a correct answer nor a completed update is required to identify the trajectory.

If you independently generate six responses to the same prompt, you have six rollouts—even if every response reads 5. You do not have one rollout with six steps.

Check your understanding

You generate 5 twice and The answer is 5. once. How many rollouts? Does the duplicate count?

Reveal answer

Three. Each separate generation is a trajectory; duplicate text does not merge them.

One answer tells you what happened once. What tells you what could happen?