Stanford AA203 Optimal and Learning-Based Control | Spring 2026 | Lecture 16: Fundamentals of RL
Overview
Stanford Online's Lecture 16 on Reinforcement Learning (RL) introduces model-free RL, contrasting it with imitation learning. The lecture recaps Markov Decision Processes (MDPs) and dynamic programming methods like value and policy iteration, highlighting their reliance on known system dynamics. It then delves into Monte Carlo (MC) and Temporal Difference (TD) learning as core model-free techniques for estimating value functions through interaction, exemplified by a Blackjack game scenario, and concludes by framing these as building blocks for generalized policy iteration.
Key takeaways
- Model-free Reinforcement Learning methods like Monte Carlo and Temporal Difference learning estimate value functions by learning from environmental interactions, bypassing the need for known system dynamics.
- Monte Carlo learning estimates value by averaging returns from complete episodes, while Temporal Difference learning uses bootstrapping (updating estimates based on other estimates) for more frequent, lower-variance updates.
- The epsilon-greedy exploration strategy is crucial for model-free RL algorithms that learn from samples, ensuring that all state-action pairs are visited and preventing premature convergence to suboptimal policies.
- Generalized Policy Iteration (GPI) provides a unifying framework for RL algorithms, involving iterative cycles of policy evaluation (estimating value) and policy improvement (updating the policy).
- Blackjack serves as a practical example demonstrating how MC Q-function evaluation combined with epsilon-greedy policy improvement can derive an optimal policy and its value function without prior game knowledge.
Chapters
- Distinguishes imitation learning (learning from demonstrations) from reinforcement learning (learning from interactions).
- Imitation learning performance is capped by expert demonstrations.
- Reinforcement learning uses trial and error to discover optimal control solutions.
- MDPs defined by state space, action space, transition function, reward function, and discount factor.
- Goal is to maximize expected cumulative discounted reward by finding an optimal policy.
- Value functions (V and Q) and Bellman equations are introduced as tools for solving MDPs.
- Bellman optimality equation relates optimal value function V* to immediate reward and expected future value.
- Bellman expectation equation defines value function for any policy pi.
- Q-function represents expected future reward from a state-action pair, enabling implicit policy definition via argmax.
- Value iteration and policy iteration are exact methods for solving MDPs.
- These methods iteratively enforce Bellman equations until convergence.
- They require knowledge of the system's dynamics (transition function).
- Policy iteration alternates between policy evaluation (using Bellman expectation equation) and policy improvement (greedy improvement).
- Policy evaluation estimates the value of a given policy.
- Policy improvement derives a better policy from the current value function estimate.
- Illustrates policy iteration on a 16-cell gridworld with terminal goal states.
- Initial random policy and zero-initialized value function are used.
- Policy evaluation iteratively updates state values using the Bellman expectation equation.
- Policy improvement derives a greedy policy pointing towards states with higher estimated values.
- Exact methods (value/policy iteration) require knowledge of MDP dynamics.
- They also face challenges with large state-action spaces (memory, convergence).
- Model-free RL addresses unknown dynamics by learning from interactions (samples).
- MC learning estimates value functions directly from sampled episodes (rollouts).
- Approximates expected future rewards using the 'return' (sum of rewards in a trajectory).
- It's model-free and applies only to episodic MDPs.
- First-visit MC: considers return only the first time a state is visited in an episode.
- Every-visit MC: considers returns from all visits to a state within an episode.
- Both methods approximate expectations through empirical means of returns.
- Applies MC policy evaluation to estimate value functions in the game of Blackjack.
- State includes player's sum, dealer's showing card, and presence of a usable ace.
- Visualizes value function estimates based on 10,000 and 500,000 episodes, showing noise reduction with more data.
- TD learning combines MC sampling with dynamic programming bootstrapping.
- It's model-free and learns from experience.
- Updates value estimates based on other learned estimates, allowing learning before episode termination.
- TD updates value estimates towards a 'TD target': immediate reward + discounted estimated future value (R + gamma * V(s')).
- The difference between the current estimate and the TD target is the 'TD error'.
- TD learning bootstraps by updating a guess towards a guess.
Transcript excerpt
0:06 OK, so starting from your roadmap, last Monday we started talking about more modern approaches to learning based control. Specifically, we looked at imitation learning as our specific paradigm of interest where loosely speaking, we pitched imitation learning as this idea of wanting to learn from demonstrations. And so we saw different types of ways of doing this, specifically behavioral cloning and inverse reinforcement learning, where the idea there is that we want to directly learn a policy that represents or mimics and approximates the behavior of our expert. Or do we want to learn the objective that is, the underlying reward function that the expert is optimizing? However, we also recognized how imitation learning techniques at their core are essentially capped in terms of performance by the performance of the expert demonstrations.
0:57 And so for today and for the rest of this class, we move towards reinforcement learning, which, on the other hand, is this idea of wanting to learn from interactions. As a basic paradigm to learn through trial and error and discover solutions for optimal control problems. So today and for the next two classes, we'll be looking at model free reinforcement learning, and then we'll be looking at model-based reinforcement learning. And specifically, for today, we'll start with a brief recap of reinforcement learning problem setting. And we'll dive a little bit deeper into what I'm referring to here as exact methods. So if you recall in our lectures on dynamic programming, we discussed value iteration and policy iteration as ways of solving Markov decision processes.
1:47 And so we'll look a little bit more closely on those that is methods that leverage dynamic programming for computing solutions. The reason why I refer to them as exact methods is because implicitly, these methods, that is value iteration and policy iteration,
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.