Better Data for AI Agents: Data Selection & Quality | Stanford CS329Z Lecture 11 with John Yang
Browse Stanford's online courses in Agentic AI: https://stanford.io/4AIRb2zYou have millions of agent trajectories. Which ones should you train on? In this Stanford CS329Z: Engineering AI Agents lecture, John Yang, co-creator of SWE-bench and SWE-smith, explains how to find maximally informative data: filtering and selection strategies for validity and learnability, tiny-but-targeted benchmarks, annotation practices (including how SWE-bench Verified was built), quality assessment and automated checks for coding tasks, curricula for reinforcement learning, building datasets from agent traces (including failed trajectories), and when less but better data beats more data.
Key questions answered in this lecture:
Q: Should you fine-tune agents only on successful trajectories?
A: No. Keeping only successes biases data toward what the teacher model can already solve. Failed trajectories, labeled or corrected, improve results.
Q: What makes a reinforcement learning task learnable?
A: The model should succeed sometimes but not always (for example, 1 to 7 times out of 8 rollouts), so there is a useful learning signal. Re-filter as the model improves.
Q: How was SWE-bench Verified created?
A: Professional developers annotated about 1,700 SWE-bench tasks for problems like underspecified issues and unfair tests, and the curated result is 500 tasks.
Q: How do you automatically filter coding tasks?
A: Run the reference solution several times to remove flaky tests, confirm the starting state fails, flag hard-coded expectations, and use an LLM monitor to catch leakage and reward hacking.
Q: Is more data or better data better for agents?
A: “More better data” is best, but under a fixed compute budget or for a specialist agent, a small curated dataset can match a much larger one.
Chapters:
0:00 Introduction & recap
5:30 Millions of trajectories: which to keep?
8:13 The funnel: valid, learnable, selected
14:33 How SWE-bench Verified was built
21:53 Automating quality checks: APIGen
25:07 Filtering coding tasks: flaky tests & leakage
30:40 Learnable tasks: RL signal & curricula
39:17 Self-evolving curricula: WebRL
42:02 Q&A: filtering & contamination
49:19 Selecting SFT trajectories
57:29 Masking low-quality actions
1:01:28 Learning from failed trajectories
1:06:19 More data vs. better data
1:12:54 Summary & what's next: evaluation
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:
- Yang et al., “SWE-smith: Scaling Data for Software Engineering Agents,” NeurIPS Datasets & Benchmarks (2025)
- Shankar et al., “Who Validates the Validators? Aligning LLM-Assisted Evaluation with Human Preferences,” UIST (2024)
Course website: https://cs329z.stanford.edu/
Watch the full CS329Z playlist: https://youtube.com/playlist?list=PLPRcF5HR02_U&si=3Z4OYphngcmQ0GIy
Recorded 11/2/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 Better Data for AI Agents: Data Selection & Quality | Stanford CS329Z Lecture 11 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.