Trajectories as Data.
One sequence, three authors: the user, the model and the world.
To a language model an agent’s episode is just text: the task, then a call, a result, another call, another result, an answer. But the text has three authors. The prompt comes from the user, the actions from the model, and the observations from tools and the environment — and only the model’s own text is something it should learn to produce. Chat templates and tool-call tokens mark the boundaries so the training code knows which is which.
The tool world of this part: the character model of Vol. XVII, pre-trained only on single-digit worksheets, is fine-tuned in the page to call a calculator — it writes “B23+45|”, the environment appends the result “68|”, and the model answers “68|”. The workshop lays out one demonstrated trajectory for a three-number sum by author, and counts how many characters each contributes and how many would carry a training loss under each masking choice.
Below: the trajectory for the chosen sum, split by author; the bars give characters per author and the characters that carry loss under each mask.
- Read an episode as one sequence.
- Identify prompt, actions and observations.
- Count what each mask trains on.
- Connect trajectories to training choices.
Whose text is it?
This episode is 31 characters: 11 from the user, 14 written by the model and 6 by the calculator — the tool wrote 30% of the reply. Training on everything after the first character would teach the model to predict all 30, including the user’s question and the calculator’s arithmetic; training on the reply, 20; training on actions only, 14.
Real agent trajectories are dominated by observations — file contents, search results, test output — often by a factor of ten or more over the model’s own text. That makes the choice of what to learn from decisive (plate XXVI.5), makes credit assignment across many turns hard (plate XXVI.4), and makes trajectories expensive to store and replay. Everything in this volume is a decision about which parts of such sequences to imitate, reward or ignore.
Terms
- Trajectory
- One episode recorded as a sequence of prompt, actions and observations.
- Action
- Text the model writes that the environment executes.
- Observation
- Text the environment writes back.
- Role tag
- Markup recording which author wrote each part.
Sources
- Yao et al., ReAct, ICLR 2023.
- OpenAI, “Harmony response format” and Anthropic, “Tool use” documentation (role-tagged message formats, accessed October 2026).