Value-Based Methods
Before policy-gradient methods, the classical approach to RL was to learn a value function and derive the policy from it. The idea: if you know how good every state (or every state–action pair) is, you can act greedily with respect to those values.
Two Value Functions
Section titled “Two Value Functions”From the rewards and return page, recall:
measures state quality; measures state–action quality. The advantage is the difference:
If we have — the optimal Q-function — the optimal policy is simply:
This is the appeal of value-based methods: no separate policy network is required. The policy falls out of the Q-function.
The Bellman Equation
Section titled “The Bellman Equation”The Q-function obeys a recursive identity. Splitting the return :
For the optimal Q-function (acting greedily forever), the next action is the argmax:
This is the Bellman optimality equation. It is the cornerstone of value-based RL — every method in this section is, at heart, a way of solving (or approximating) it.
| Equation | Name | Used by |
|---|---|---|
| Bellman expectation (V) | Policy evaluation | |
| Bellman expectation (Q) | SARSA | |
| Bellman optimality | Q-learning, DQN |
Interactive: Watch Value Iteration Propagate
Section titled “Interactive: Watch Value Iteration Propagate”Five-state chain MDP. Only the rightmost state gives reward +1. Each backup of the Bellman equation updates one step. Drag the iteration slider and watch the reward signal flow leftward — exactly one cell per pass — and notice how lowering shortens its reach.
Two Ways to Estimate Q
Section titled “Two Ways to Estimate Q”If we knew the transition probabilities , we could solve the Bellman equation directly (dynamic programming). But we usually don’t. Two sample-based methods bridge that gap:
Monte Carlo (MC). Run a full episode, then for each visited set the target to the actual observed return . Unbiased, but high variance and requires episode termination.
Temporal Difference (TD). Use the Bellman equation to bootstrap — update toward using the current estimate of . Biased (the bootstrap target is also an estimate), but lower variance and works online, before the episode ends.
The TD update for Q is:
The quantity in brackets is the TD error — the difference between what we believed was and what one step of bootstrap evidence suggests.
SARSA vs Q-Learning
Section titled “SARSA vs Q-Learning”Both are TD methods, differing only in what they put in the target:
| Method | Target | Type |
|---|---|---|
| SARSA | , | On-policy — learns the value of the policy actually being followed |
| Q-learning | Off-policy — learns the value of the greedy policy regardless of what action was taken |
The off-policy nature of Q-learning is what makes it work with replay buffers in DQN — old experience from a different policy is still useful.
What’s Next
Section titled “What’s Next”The next pages cover tabular Q-learning with a worked gridworld example, and DQN — extending Q-learning to high-dimensional state spaces with neural networks.
References
Section titled “References”- Sutton & Barto. Reinforcement Learning: An Introduction (2nd ed., 2018), ch. 6 — TD learning, Sarsa, Q-learning. Free official PDF
- Watkins & Dayan. Q-learning. Machine Learning 8, 1992 — the convergence proof. Springer