The Map of RL Algorithms
Model-free or model-based, value or policy, on- or off-policy, online or offline.
Q-learning, PPO, SAC, AlphaZero, MuZero, CQL, Dreamer: the zoo of RL algorithms looks bewildering until you see that each one is a few choices along a handful of axes. This lesson lays out those axes, shows the one pattern that runs through nearly all of them, weighs what each choice costs in data, compute and stability, and ends with rules of thumb for which family to try first and where this course covers it.
What you’ll learn
- Classify an RL method by what it learns (values, a policy, a model), where its data come from (on-policy, off-policy, offline) and how it represents functions (tabular or approximate).
- Explain generalized policy iteration as the pattern behind planning and learning methods alike.
- Compare planning with learning, and on-policy with off-policy learning, in working simulations.
- Weigh sample efficiency, compute and stability, and choose a family to try first for a given problem.
What an algorithm learns
Every RL method maintains some combination of three objects: a value function that predicts returns, a policy that chooses actions, and a model that predicts transitions and rewards. Which of them it learns, and which it derives from the others, names its family.
| Family | Learns | Acts by | Classic examples | In this course |
|---|---|---|---|---|
| Value-based | , or together with a model | choosing greedily (with some exploration) from | Q-learning, SARSA, DQN and its descendants | Learning from Experience; Function Approximation & Deep Q-Learning |
| Policy-based | a parameterized policy | sampling from | REINFORCE, evolution strategies | Policy Gradients & Actor–Critic |
| Actor–critic | a policy (the actor) and a value function (the critic) | sampling from the actor, which the critic scores | A2C, PPO, DDPG, TD3, SAC | Policy Gradients & Actor–Critic |
| Model-based | a model, or is given one, often with values and a policy | planning: dynamic programming, tree search, model-predictive control | value iteration, Dyna, AlphaZero, MuZero, Dreamer | Planning with a Model; Model-Based RL |
| Imitation and offline | a policy or values from fixed data | the learned policy, with little or no new interaction | behavior cloning, DAgger, CQL, IQL | Learning from Demonstrations & Data |
Two more distinctions cut across the families. Prediction estimates the value of a given policy; control searches for a good policy. And a method is tabular, with one entry per state or state–action pair, or uses function approximation, from linear features to deep networks. Most of the theory in this course is tabular; most of the practice is approximate.
Soft actor–critic (SAC) learns a Q-function and a stochastic policy from transitions stored in a replay buffer, which holds data from many past versions of its policy. It never learns a model of the environment. How is it classified?
- Value-based, on-policy, model-based
- Policy-based, on-policy, model-free
- Actor–critic, off-policy, model-free
- Offline RL
Show the answer
C. Actor–critic, off-policy, model-free
It learns a critic and an actor, so it is an actor–critic. Its updates reuse transitions generated by older policies, so it is off-policy. And it never predicts transitions, so it is model-free. Off-policy actor–critics like SAC and TD3 are a standard first choice for continuous control when samples are costly.
Planning or learning, on-policy or off-policy
Three questions place a method on the map.
- Model or experience? Planning computes a policy from a model of the environment; learning estimates from experience; model-based RL learns a model from experience and plans in it, while model-free RL skips the model.
- Whose behavior? On-policy methods learn about the policy that generates their data: SARSA, REINFORCE, PPO. Off-policy methods learn about a target policy from data generated by a different behavior policy: Q-learning learns about the greedy policy while acting ε-greedily, and DQN learns from a replay buffer of old transitions. Off-policy learning can reuse data and learn from other agents' behavior, at the price of more fragile convergence.
- Interaction or a fixed dataset? Online methods keep collecting data as they learn; offline methods learn from a fixed dataset and never interact.
On the edge route, 11 of the 13 moves start from a cell next to the cliff, where one of the 4 actions steps off it. An ε-greedy agent with ε = 0.1 takes a uniformly random action 10% of the time. Ignoring every other deviation, what is the probability that an episode on this route ends in the cliff?
Show the answer
0.24
Each risky move goes over the edge with probability , so the episode survives all 11 with probability and ends in the cliff with probability about 0.24, close to the one-in-five falls the widget shows once Q-learning has settled on this route.
Think first From the same kind of experience, why does Q-learning learn the edge route while SARSA learns the safe one?
Q-learning's target uses : it evaluates the greedy policy, which never steps off the cliff, so the edge looks best, and it is best for an agent that stops exploring. SARSA's target uses the action its ε-greedy policy actually takes next, so its values include the occasional random step into the cliff, and cells beside the edge look dangerous. Each learns the right answer to a different question. If ε were slowly reduced to zero, both would converge to the optimal edge route (Sutton & Barto, Example 6.6).
One pattern: generalized policy iteration
Almost every method above runs two processes against each other. Evaluation makes a value estimate consistent with the current policy; improvement makes the policy greedy, or greedier, with respect to the current values. Sutton and Barto call any interleaving of the two generalized policy iteration (GPI). The processes pull against each other, since a greedier policy invalidates the values and new values change what is greedy. Yet when both stop changing, the policy is greedy with respect to its own values, which is the Bellman optimality equation: the values and the policy are optimal.
| Method | Evaluation step | Improvement step |
|---|---|---|
| Policy iteration | solve for exactly | make the policy greedy in every state |
| Value iteration | one exact backup of every state | implicit: the maximum inside the backup |
| Q-learning | one sampled backup of one pair | implicit: act ε-greedily on the current , and bootstrap from its maximum |
| Actor–critic (PPO, SAC) | train the critic toward or | gradient steps on the actor toward higher-valued actions |
| AlphaZero | train a value network on game outcomes | tree search turns the network's policy into a stronger one, which the network then imitates |
What each choice costs
Every choice is paid for in one of three currencies: data (environment interactions), compute (time spent per interaction) and stability (how reliably training succeeds, and how much tuning it needs). Sample efficiency spans orders of magnitude. DQN trained on each Atari game for 50 million agent steps, 200 million emulator frames, about 38 days of real-time play; the Atari 100k benchmark asks what can be learned from 100,000 agent steps, about two hours of play (Kaiser et al., 2020), a 500-fold difference.
| Choice | What it buys | What it costs |
|---|---|---|
| Model-based | each real transition improves a model that can generate many simulated updates; usually far fewer real samples | model errors compound over long imagined rollouts; more compute per sample; a good model can be harder to learn than a good policy |
| Off-policy | reuse of old data through replay, learning from logs and demonstrations | bootstrapping, function approximation and off-policy data together can diverge (the deadly triad); more hyperparameters |
| On-policy policy gradient | stable, simple, any differentiable policy, continuous actions, easy to run with many parallel simulators | data are discarded after each update, so it is data-hungry; gradient estimates are noisy |
| Value-based control | sample-efficient with discrete actions; acting greedily is a lookup | is hard to compute over continuous actions; maxima of noisy estimates are biased upward |
| Function approximation | generalization across states, which large problems require | most tabular guarantees no longer hold |
Which family to try first
| Situation | Try first | Why | Course topic |
|---|---|---|---|
| A small MDP whose rules you know | value or policy iteration | exact and fast when the states can be listed | Planning with a Model |
| One decision per round, no state dynamics (ads, A/B tests) | bandit algorithms, contextual bandits | no credit assignment over time, and strong regret guarantees | Bandits & the Explore–Exploit Dilemma |
| A fast simulator with discrete actions | a DQN-family method or PPO; for board games with exact rules, tree search with self-play | samples are cheap; search exploits a perfect model | Function Approximation & Deep Q-Learning; Model-Based RL |
| A simulator with continuous actions | PPO with many parallel simulators; SAC or TD3 when samples cost more | off-policy actor–critics reuse data; PPO is simple and parallelizes well | Policy Gradients & Actor–Critic |
| Real hardware and few trials | model-based RL, or training in simulation with randomized dynamics and transferring | every real sample is slow, costly or risky | Model-Based RL; RL at the Frontier |
| Logs of past decisions and no new trials | offline RL with pessimism, and off-policy evaluation before deployment | exploration is impossible, so the policy must stay near the data | Learning from Demonstrations & Data |
| Expert demonstrations | behavior cloning first, then RL fine-tuning | demonstrations solve much of the exploration problem | Learning from Demonstrations & Data |
| Sparse rewards and hard exploration | exploration bonuses, posterior sampling, demonstrations or a curriculum | random exploration rarely finds the reward | Bandits & the Explore–Exploit Dilemma |
| Several learning agents | self-play and population methods; equilibrium solvers for games | each agent's environment includes the other learners | Multi-Agent RL & Games |
| A pretrained language model with a preference or correctness signal | RLHF with PPO, direct preference optimization, GRPO-style methods | the model is the policy, and the reward is learned or checked | RL at the Frontier |
A team wants to improve the heating and cooling controller of one office building. They have two years of logs from the current rule-based controller, and the operators will allow only cautious changes, with the old controller as a fallback. What should they try first?
- PPO from scratch on the live building, with plenty of exploration
- Offline RL from the logs, with constraints that keep actions near those in the data, checked by off-policy evaluation before a cautious live trial
- DQN with ε = 0.1 exploration on the real system
- Tabular value iteration on the building's true dynamics
Show the answer
B. Offline RL from the logs, with constraints that keep actions near those in the data, checked by off-policy evaluation before a cautious live trial
Exploration on the real building is exactly what the operators forbid, and the logs are the main asset. Offline methods with pessimism or constraints, plus off-policy evaluation and a safety fallback, match the situation; published cooling controllers likewise started from logged data, filtered actions through constraints and kept a fallback (RL in the Real World).
Key takeaways
- Methods differ in what they learn (values, a policy, a model), in where their data come from (on-policy, off-policy, offline) and in how they represent functions (tabular or approximate).
- Planning computes from a model; learning estimates from experience; model-based RL learns a model and plans with it.
- Generalized policy iteration, evaluation and improvement interleaved at any grain, runs through policy iteration, value iteration, Q-learning, actor–critic methods and AlphaZero.
- Off-policy and model-based methods buy sample efficiency at the cost of stability and model errors; on-policy policy gradients buy stability with data.
- Choose by the problem: whether the model is known, whether actions are discrete or continuous, whether samples are cheap, whether data are fixed, and whether rewards are dense or sparse.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Why can't plain REINFORCE reuse episodes collected by earlier policies the way DQN reuses its replay buffer?
- Because REINFORCE needs a model of the environment
- Because REINFORCE works only with continuous actions
- Because its gradient is an expectation over trajectories of the current policy, so old episodes need importance-sampling corrections, while Q-learning's target is valid whichever policy chose the action
- Because replay buffers work only with neural networks
Show the answer
C. Because its gradient is an expectation over trajectories of the current policy, so old episodes need importance-sampling corrections, while Q-learning's target is valid whichever policy chose the action
The policy gradient is taken under the current policy. Old data come from a different distribution and must be reweighted by probability ratios, whose variance grows with the horizon. Q-learning's update for a transition is a sample of the Bellman optimality equation, correct no matter who chose .
Viewed as generalized policy iteration, where do evaluation and improvement happen in Q-learning?
- Each update moves toward a sampled one-step target (evaluation), and acting on and bootstrapping from the current 's maximum makes the policy greedier (improvement)
- Evaluation runs to convergence before every improvement, as in policy iteration
- There is no improvement: Q-learning only evaluates
- Improvement is a gradient step on a policy network
Show the answer
A. Each update moves toward a sampled one-step target (evaluation), and acting on and bootstrapping from the current 's maximum makes the policy greedier (improvement)
Q-learning interleaves the two at the finest grain: one sampled backup of one pair, with the policy implied by the current estimates. The maximum in its target makes it evaluate the greedy policy, and its ε-greedy action choice keeps exploring.
Model-based methods are often more sample-efficient than model-free ones. Why, and what is the catch?
- They need no data at all
- They use larger networks, which learn faster
- They never need to explore
- Each real transition improves a model that can generate many simulated updates; the catch is that model errors compound in long imagined rollouts and can mislead the policy
Show the answer
D. Each real transition improves a model that can generate many simulated updates; the catch is that model errors compound in long imagined rollouts and can mislead the policy
Planning extracts more from each real sample, but the agent then optimizes against its own model, and a policy can exploit the model's errors. Bounding how errors grow with the planning horizon, and limiting rollouts to where the model is trustworthy, is the subject of Model Errors & Value-Equivalent Models.
In the cliff walk, SARSA with ε = 0.1 learns the safe top route. What happens if ε is slowly reduced to zero during training?
- SARSA keeps the top route forever
- SARSA's targets come to evaluate an almost greedy policy, and it converges to the optimal edge route, as Q-learning does
- SARSA diverges
- Both methods switch to the top route
Show the answer
B. SARSA's targets come to evaluate an almost greedy policy, and it converges to the optimal edge route, as Q-learning does
SARSA evaluates the policy it follows. As exploration fades, that policy becomes greedy, falls become rare, and the edge route's true value under it approaches the optimal one. With suitably decaying exploration (and step sizes), SARSA converges to an optimal policy.
Go deeper
- Benchmarks & Honest Evaluation · Atari, MuJoCo and Procgen, seeds and confidence intervals: measuring progress without fooling yourself.
- Generalization in RL · Agents that overfit their training levels, and how procedural generation exposed it.
- RL in the Real World · Case studies from plasma control to recommender systems, and why deployment is hard.
Further reading
- R. S. Sutton & A. G. Barto, Reinforcement Learning: An Introduction, ch. 1, 4 and 6 (MIT Press, 2nd ed., 2018).
- S. Levine, A. Kumar, G. Tucker & J. Fu, "Offline reinforcement learning: Tutorial, review, and perspectives on open problems," arXiv:2005.01643 (2020).
- Ł. Kaiser et al., "Model based reinforcement learning for Atari," ICLR (2020).
- K. P. Murphy, "Reinforcement learning: An overview," arXiv:2412.05265 (2024).