What Data Do AI Agents Need? | Stanford CS329Z Lecture 10 with John Yang
Browse Stanford's online courses in Agentic AI: https://stanford.io/4AIRb2zWhere does the training data for AI agents come from? In this Stanford CS329Z: Engineering AI Agents lecture, John Yang, co-creator of SWE-bench and SWE-agent, explains what data agents need (traces, demonstrations, and feedback), data for optimization vs. evaluation, data flywheels, and why agents need environments and not just web text. He covers the difference between trajectories and environments, how to verify agent work, and strategies for collecting agent data: human demonstrations, mining the web, synthetic data generation (LLM-synthesized trajectories and tasks like SWE-smith and R2E-Gym), simulated users, and collecting data from human-agent interaction. He also covers pitfalls like reward hacking and overfitting.
Key questions answered in this lecture:
Q: Why do AI agents need environments if the web already has the knowledge?
A: The internet is like a textbook and an environment is the lab. Pretraining on code teaches what code looks like, not how to run it, read the output, and iterate.
Q: What is the difference between an agent trajectory and an environment?
A: A trajectory is a log of thought-action-observation steps used for supervised fine-tuning. An environment has a task, an action space, and verification, and is used for reinforcement learning.
Q: How is training data for AI agents collected?
A: Five main ways: human demonstrations, mining web artifacts like GitHub PRs and tutorials, LLM-synthesized trajectories, synthesized tasks, and simulated users or environments.
Q: How does SWE-smith create software engineering training tasks?
A: Instead of mining scarce real PRs, it takes a working repository and deliberately introduces bugs so tests fail reliably, scaling to 50,000 tasks.
Q: What goes wrong when you train agents on this data?
A: Reward hacking (like checking out the future fixed commit), benchmark memorization, overfitting to a single harness, and degradation from too much SFT data.
Chapters:
0:00 Introduction & roadmap
4:28 Why data matters: labs & data vendors
7:04 Recap: pretraining, SFT & RL data
8:59 Why agents need environments
14:45 Trajectories vs. environments
18:37 Verification: tests, rubrics, preferences
25:27 Five data strategies & human demonstrations
37:20 Mining the web: SWE-bench, tutorials, video
54:33 Synthesizing trajectories with LLMs
1:04:58 Synthesizing tasks: SWE-smith & R2E-Gym
1:12:30 Simulated users & LLM-as-environment
1:15:48 Pitfalls: reward hacking & overfitting
1:23:54 Summary
About the speaker:
John Yang is a Computer Science PhD student at Stanford University focused on coding agents. He is a lead creator of SWE-bench, the widely used benchmark for whether language models can resolve real GitHub issues, and of SWE-agent, an open-source agent for autonomous software engineering. He is also first author of SWE-smith, a toolkit that generated 50,000 software engineering training tasks from 128 repositories. He previously studied at Princeton University (MS) and UC Berkeley (BS).
Readings:
- Shankar, “Data Flywheels for LLM Applications” (2024)
Course website: https://cs329z.stanford.edu/
Watch the full CS329Z playlist: https://youtube.com/playlist?list=PLPRcF5HR02_U&si=3Z4OYphngcmQ0GIy
Recorded 10/28/2026 in CS329Z: Engineering AI Agents, a graduate course at Stanford University taught by Diyi Yang, Michael Ryan, and John Yang.
#AIAgents #TrainingData #Stanford Receive SMS online on sms24.me
TubeReader video aggregator is a website that collects and organizes online videos from the YouTube source. Video aggregation is done for different purposes, and TubeReader take different approaches to achieve their purpose.
Our try to collect videos of high quality or interest for visitors to view; the collection may be made by editors or may be based on community votes.
Another method is to base the collection on those videos most viewed, either at the aggregator site or at various popular video hosting sites.
TubeReader site exists to allow users to collect their own sets of videos, for personal use as well as for browsing and viewing by others; TubeReader can develop online communities around video sharing.
Our site allow users to create a personalized video playlist, for personal use as well as for browsing and viewing by others.
@YouTubeReaderBot allows you to subscribe to Youtube channels.
By using @YouTubeReaderBot Bot you agree with YouTube Terms of Service.
Use the @YouTubeReaderBot telegram bot to be the first to be notified when new videos are released on your favorite channels.
Look for new videos or channels and share them with your friends.
You can start using our bot from this video, subscribe now to What Data Do AI Agents Need? | Stanford CS329Z Lecture 10 with John Yang
What is YouTube?
YouTube is a free video sharing website that makes it easy to watch online videos. You can even create and upload your own videos to share with others. Originally created in 2005, YouTube is now one of the most popular sites on the Web, with visitors watching around 6 billion hours of video every month.