Stanford Online

Better Data for AI Agents: Data Selection & Quality | Stanford CS329Z Lecture 11 with John Yang

Published 2026-11-25 · Duration 1:14:58

Summary

This lecture details advanced strategies for data selection and quality in training AI agents, arguing that 'better data' often surpasses 'more data' when compute resources are constrained. The process involves a multi-stage funnel: ensuring task validity (non-ambiguous, non-loopholes), confirming learnability (providing a useful learning signal), and finally, selecting high-quality trajectories. Techniques discussed include automated filtering, contrastive learning using negative examples, and self-evolving curriculum design.

Download summary

Key takeaways

  1. Success Bias is Detrimental 23:53

    Fine-tuning agents only on successful trajectories biases the data toward what the teacher model can already solve, potentially missing interesting failed trajectories or problem distributions. Failed trajectories, when labeled or corrected, can improve results.

  2. The Learnability Constraint 30:00

    A reinforcement learning task is considered 'learnable' if the model succeeds sometimes but not always (e.g., 1 to 7 times out of 8 rollouts), providing a useful learning signal. Tasks that are too easy or too difficult are filtered out.

  3. Quality Filtering Outperforms Quantity 39:10

    In certain scenarios, a small, curated dataset (e.g., 5K high-quality tasks) can outperform a much larger, unfiltered dataset (e.g., 8K tasks) due to the increased reliability and fidelity of the data.

  4. Negative Trajectories are Valuable 1:02:10

    Training on negative or failure trajectories, especially when combined with contrastive objectives, can help encompass a larger distribution of tasks and explicitly teach the model what behaviors to avoid.

More digests on AI Agents

Technical details

  • SWE-bench Verified Process 1433s

    SWE-bench Verified was created by professional developers who annotated 1,700 tasks to check for underspecified issues and unfair tests, resulting in a curated set of 500 tasks. This process ensures verification reliability and problem statement alignment.

  • Automated Filtering Mechanisms 2153s

    Automated quality checks include running reference solutions multiple times to remove flaky tests, confirming the starting state fails, flagging hard-coded expectations, and using an LLM monitor to catch leakage and reward hacking.

  • Trajectory Filtering (SweetPrime) 3900s

    SweetPrime focuses on filtering within a single trajectory, identifying and masking out actions that are low quality (e.g., spurious file editing, cascading errors) to improve SFT quality.

  • Curriculum Learning (Self-Evolving) 4100s

    In both web RL and coding agent contexts, self-evolving curricula involve re-filtering the task pool after RL steps. Tasks that were previously too difficult become solvable, and these new tasks are introduced into the training mix.

Mentioned resources

  • SWE-bench Verified (Benchmark/Dataset)
  • Code World Models (Paper/Study)
  • Code Midas (System/Pipeline)
  • SweetPrime (Paper/Methodology)

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.