Save this video free

Stanford CS229 Machine Learning | Spring 2026 | Lecture 20: GMM (EM), PCA

Stanford Online · 1:18:56 · Watch on YouTube

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

This lecture delves into advanced reinforcement learning techniques, starting with a detailed explanation of the policy gradient algorithm and its intuitive interpretation. It then explores the Proximal Policy Optimization (PPO) algorithm, highlighting its importance sampling mechanism for reusing trajectories and its clipped surrogate objective function designed to prevent large policy updates. Finally, the lecture discusses the application of these RL concepts to large language models (LLMs) for training "chain-of-thought" reasoning capabilities, framing LLM generation as an MDP with rewards based on final answer correctness.

Key takeaways

Chapters

0:00 Introduction to Policy Gradient and PPO
1:35 Intuitive Understanding of Policy Gradient
4:00 The Zero Expectation of Gradient Log Probability
7:20 Simplifying Policy Gradient with Reward-to-Go
10:09 Introducing Baselines to Reduce Variance
17:20 The Core Idea of Proximal Policy Optimization (PPO)
18:20 Importance Sampling in PPO
24:20 PPO's Clipped Surrogate Objective
26:40 Analyzing PPO's Clipping Regions
31:40 Comparison with CISPO Algorithm
35:00 Chain-of-Thought (CoT) Prompting
37:30 Few-Shot and Zero-Shot CoT
40:00 Training LLMs for CoT with RL
43:20 Reward Design and Baseline Strategy
46:40 Challenges and Initialization for RL in LLMs

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:05 OK. So the last lecture of this quarter we're going to continue to talk a little bit about reinforcement learning, finishing up some of the discussions about the policy gradient. And then we're going to introduce a new algorithm called PPO which is an extension of the policy gradient, which is one of the most popular algorithm people are using for training large language models. And then we'll move on to how to train-- use reinforcement learning for large language models for this kind of verifiable-- how do you train long COT-- how do you train models to have the long reasoning capabilities with all the thinking tokens. So that's pretty much the agenda for today. So I guess let's finish up some of the discussions about reinforcement last week.

0:55 So recall that we are talking about the so-called policy gradient algorithm. And we did a lot of derivations in the last lecture last week, last Wednesday. And this was the starting point we had. So we have a loss function or reward function, which is the total return. You have some discount factor, which is not that important. You sum up the return at all times step t and then you take expectation over the trajectories and where the actions are sampled from the policy theta. And recall that the challenge here is that this thing-- inside expectation there is no dependency on theta whatsoever. So the dependency on theta on the parameter theta is in the sampling probabilities, you are sampling the actions from.

1:44 So the dependencies is kind of like in a weird space, so you cannot just swap the gradient with the expectation, because then you ignore all of these dependencies. If you just take a gradient operator and you swap the expectation with the gradient,

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Stanford Online.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.