What Data Do AI Agents Need? | Stanford CS329Z Lecture 10 with John Yang
Summary
This lecture explores the fundamental data requirements for training effective AI agents, arguing that the internet (the 'textbook') is insufficient without structured environments (the 'lab'). The discussion differentiates between trajectories (used for Supervised Fine-Tuning, SFT) and environments (used for Reinforcement Learning, RL). Data is collected through five main strategies: human demonstrations, web artifact mining, LLM-synthesized trajectories, simulated users, and synthetic tasks, each with unique challenges like reward hacking and overfitting.
Key takeaways
-
Environments vs. Web Knowledge
6:22
The web provides knowledge (a textbook), but an environment provides the ability to execute that knowledge (a lab). Pretraining on surface-form code lacks the ability to run code, read output, and iterate against a system.
-
Data Form Factors
8:45
The two primary data types are trajectories (a log of thought-action-observation steps, used for SFT) and environments (a setting with an action space and verification, used for RL).
-
Synthetic Task Generation
17:25
Methods like SWE-smith scale software engineering tasks by taking a working repository and deliberately introducing bugs to ensure tests fail reliably, achieving high task volume.
-
Data Collection Strategies
26:35
Data is sourced from human demonstrations (KUA), web artifacts (GitHub PRs, tutorials), LLM-synthesized data (Sinatra), and simulated environments (DreamGym).
Technical details
-
Trajectory Definition
755s
A trajectory is essentially a JSON log of thought-action-observation steps, often following the ReAct paradigm (e.g., 'ls' -> 'cd' -> 'ls'). Training typically involves masking agent commands and having the model predict the next action.
-
Environment Definition and Verification
1135s
An environment provides a task, an action space, and a verification mechanism. Verification can be deterministic (running unit tests) or non-deterministic (using LLMs as judges or preference-based voting, like Alpaca Eval).
-
Data Synthesis and Cost
1345s
The 'AgentTrek' method uses tutorials (e.g., WikiHow) as a proxy for human action, replacing human labor with LLM compute to generate trajectories, which is significantly cheaper than human annotation.
-
Pitfalls in Training
1880s
Common issues include reward hacking (e.g., a coding agent fast-forwarding the Git history to the final commit), benchmark memorization, and overfitting to a single harness, which can lead to mode collapse.
Mentioned resources
- SWE-bench / SWE-agent
- MiniWoB / WebShop
- AgentTrek
- Sinatra
- OS-Genesis
- CowBench
Channel & topics
Watch on YouTube · Back to latest
This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.