Key Moments
Stanford CS329A Self-Improving AI Agents | Part 6 | Train Time Scaling/Scaling RL
Want to know something specific about what's covered?
We've already dissected every moment. Ask and we will deliver (with timestamps).
Key Moments
Train-time scaling allows smaller AI models to outperform larger ones on reasoning tasks by learning from their own outputs, but success hinges on robust verification and careful RL implementation.
Key Insights
DeepSeek Math, a 7B parameter model, achieved 51.7% accuracy on the Amy benchmark using train-time scaling, significantly outperforming a 175B parameter GPT-3.5 model's estimated 5% accuracy.
The STAR paper demonstrates that fine-tuning a model on self-generated reasoning chains, even for failed attempts (by explaining backwards from the correct answer), can bootstrap reasoning capabilities and improve sample efficiency.
DeepSeek Math's success involved starting with a code-pre-trained model (DeepSeek Coder) and curating extensive web math data, showing that code-to-math transfer and data quality are crucial priming steps before RL.
GRPO (Generalized Proximal Policy Optimization) reduces memory requirements for RL by using a generalized advantage estimation instead of a separate critic, allowing for more scalable reinforcement learning for language models.
The DAPO paper improves RL stability for harder reasoning problems by introducing asymmetric clipping for exploration, dynamic sampling to maintain effective batch size, and token-level loss to control response length and prevent gradient collapse.
While train-time scaling, especially RL, can significantly boost performance on verifiable domains like math and coding, it requires careful implementation, robust reward signals, and is more difficult to get right than supervised fine-tuning for general capabilities.
Train-time scaling enables smaller models to achieve high reasoning accuracy
The lecture introduces train-time scaling as a method to significantly improve the reasoning capabilities of AI models, particularly smaller ones, by having them learn from their own outputs. This contrasts with traditional scaling based on model parameters. For instance, the Amy benchmark, designed for complex mathematical reasoning, shows dramatic performance gains: a 7B parameter DeepSeek Math model achieves over 51.7% accuracy, far surpassing the estimated 5% accuracy of a 175B parameter GPT-3.5. This highlights that compute invested in iterative refinement and learning from self-generated data can be more impactful than simply increasing model size. The core idea is to close the loop, using filtered model outputs to further train the model, a process that can substitute for model parameters and is particularly effective in domains with verifiability, such as mathematics and coding.
STAR: Bootstrapping reasoning with self-generated rationales
The STAR paper offers a simple yet effective method for enhancing a model's reasoning abilities by generating and learning from its own reasoning chains. Unlike relying solely on internet-scale data (which often lacks explicit reasoning steps) or expensive manual annotation, STAR starts with a small set of reasoning examples. It generates solutions, filters for correctness, and then, crucially, for incorrect attempts, it uses the correct answer as a hint to generate rationales backwards. This "explain-backwards" approach bootstraps the model's reasoning capabilities, expanding its training data to include more difficult problems. The assumption is that if the final answer is correct, the reasoning path is likely of good quality, although this proxy has limitations. This iterative process allows models to progressively improve their reasoning, demonstrating high sample efficiency by leveraging self-generated, high-quality training data.
DeepSeek Math: Priming for RL with code transfer and curated data
DeepSeek Math illustrates how to effectively prepare a model for reinforcement learning on mathematical reasoning tasks. Instead of training on academic papers (like arXiv), they found significant benefits from curating math-related content from common crawl web pages, starting with a code-pre-trained model (DeepSeek Coder). This "code-to-math" transfer proved more effective than typical academic training data, enhancing the model's ability to reason and use tools. By curating high-quality data with better coverage across mathematical domains, they primed the model before applying RL. This emphasizes that the model's foundational capabilities in related areas and the quality of its specialized training data are critical prerequisites for successful RL-based improvements in complex domains.
GRPO: Efficient reinforcement learning for language models
Reinforcement learning on large language models can be memory-intensive due to the need to maintain multiple model copies (policy, critic, reward model). GRPO (Generalized Proximal Policy Optimization) addresses this by proposing a new technique that uses a generalized advantage estimation (GAE) instead of a separate critic. This reduces the number of required models from four to three. The core idea is to normalize rewards by subtracting the mean and dividing by the standard deviation, creating an advantage function that allows for more memory-efficient scaling of RL. DeepSeek Math successfully employed GRPO to achieve a 51.7% accuracy on the math benchmark with a 7B model, demonstrating that this approach can be effective even with limited computational resources, making RL more accessible for training powerful language models on reasoning tasks.
DAPO: Stabilizing RL for complex reasoning chains
The DAPO paper tackles the instability and challenges encountered when scaling RL algorithms like GRPO to harder reasoning problems, often involving longer reasoning chains. Key innovations include asymmetric clipping in the policy gradient update to prevent exploration collapse and allow for larger improvements, and dynamic sampling to maintain an effective batch size by filtering out completely correct or incorrect samples. DAPO also introduces a token-level loss, instead of a sample-level loss, to control response length and entropy, preventing uncontrolled growth and mitigating noise from truncated reasoning chains. These techniques were applied to a 32B parameter model (Quen), pushing its performance on the Amy benchmark from 30% to 50%, significantly improving stability and allowing the model to effectively hill-climb on complex problems.
Comparing train-time scaling techniques and their applications
The lecture contrasts three main approaches to train-time scaling: STAR, GRPO (as used in DeepSeek Math), and DAPO. STAR is recommended for simpler reasoning tasks and when RL infrastructure is unavailable, offering good sample efficiency with limited data. GRPO is suitable for standard math reasoning when a strong base model is available and good instruction data is used for priming, providing a scalable RL solution even with memory constraints. DAPO is essential for state-of-the-art performance on competition-level problems (like Amy) requiring long and complex reasoning chains, where precise control over RL variables like entropy and response length is critical. While all techniques can improve majority-k performance and output coherence, they may not fundamentally improve out-of-domain generalization or teach the model entirely new problem-solving paradigms. RL, in particular, requires significant effort to implement correctly but offers the potential to improve performance with fewer examples when a strong reward signal exists, whereas SFT is faster if high-quality data is abundant.
Mentioned in This Episode
●Software & Apps
●Companies
●Studies Cited
●Concepts
Train Time Scaling Techniques for AI Reasoning
Practical takeaways from this episode
Do This
Avoid This
Common Questions
Test time scaling involves techniques like majority voting or inference-time sampling to improve model output quality after training. Train time scaling, conversely, uses the filtered outputs from test time scaling (or other methods) to further fine-tune and improve the model during its training phase, creating a self-improvement loop.
Topics
Mentioned in this video
A paper and model that focuses on mathematical reasoning and uses a novel reinforcement learning approach to improve performance.
A model used as a baseline for comparison against thinking models, particularly in domains with verification.
A system mentioned in the context of making search infinite for solutions at test time.
The third paper discussed, focusing on reinforcement learning techniques to stabilize and improve reasoning with longer chains.
A model that achieved 50% accuracy on the Amy benchmark when using the DAPO technique.
A model claimed to use a significant percentage of RL in its training, though performance gains were debated.
A 6 billion parameter open-source model based on GPT-3, used for experiments with the STAR approach.
A reasoning model mentioned as an example of models utilizing reasoning capabilities.
A paper that improved the Palm model on STEM tasks by training on science and math data.
A proposed technique in DeepSeek Math that reduces memory requirements in RL by using a generalized advantage estimation instead of a critic.
Reinforcement Learning from Feedback, mentioned as a paper that uses execution feedback for rewards.
A paper focusing on boosting the reasoning capabilities of models by incorporating rationales into problems, used as the first paper discussed.
A typical reinforcement learning algorithm used in RLHF that involves keeping multiple policy models, critic, and reward models.
A reasoning model mentioned as an example of models utilizing reasoning capabilities.
A 175 billion parameter model that achieved approximately 5% accuracy on the Amy benchmark.
A model that was the basis for Minerva's improvements on STEM tasks, and upon which DeepSeek Math built.
A specific version of Grock claimed to use 50% RL, but the performance jump was not as expected due to bottlenecks.
More from Stanford Online
View all 116 summaries
75 minStanford CS329A Self-Improving AI Agents | Part 5 | Planning and Multi-Step Reasoning
72 minStanford CS329A Self-Improving AI Agents | Part 4 | Learning from Feedback with Tools/Code
76 minStanford CS329A Self-Improving AI Agents | Part 8 | Agentic Evaluations and Long Horizon Tasks
73 minStanford CS329A Self-Improving AI Agents | Part 3 | Robust Verification
Ask anything from this episode.
Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.
Get Started Free