Simple Algorithm
Reinforcement Learning · Bootstrapping · 22 min

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.

FamilyLearnsActs byClassic examplesIn this course
Value-basedQQ, or VV together with a modelchoosing greedily (with some exploration) from QQQ-learning, SARSA, DQN and its descendantsLearning from Experience; Function Approximation & Deep Q-Learning
Policy-baseda parameterized policy πθ\pi_{\boldsymbol\theta}sampling from πθ\pi_{\boldsymbol\theta}REINFORCE, evolution strategiesPolicy Gradients & Actor–Critic
Actor–critica policy (the actor) and a value function (the critic)sampling from the actor, which the critic scoresA2C, PPO, DDPG, TD3, SACPolicy Gradients & Actor–Critic
Model-baseda model, or is given one, often with values and a policyplanning: dynamic programming, tree search, model-predictive controlvalue iteration, Dyna, AlphaZero, MuZero, DreamerPlanning with a Model; Model-Based RL
Imitation and offlinea policy or values from fixed datathe learned policy, with little or no new interactionbehavior cloning, DAgger, CQL, IQLLearning from Demonstrations & Data
The families overlap: an actor–critic is both value- and policy-based, and AlphaZero learns a policy and a value network that its tree search then improves.

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.

Check your understanding

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?

  1. Value-based, on-policy, model-based
  2. Policy-based, on-policy, model-free
  3. Actor–critic, off-policy, model-free
  4. 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.
Predict before you look

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 0.1×14=0.0250.1 \times \tfrac14 = 0.025, so the episode survives all 11 with probability 0.97511≈0.7570.975^{11} \approx 0.757 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 max⁡a′Q(St+1,a′)\max_{a'}Q(S_{t+1}, a'): 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.

MethodEvaluation stepImprovement step
Policy iterationsolve for VπV^\pi exactlymake the policy greedy in every state
Value iterationone exact backup T⋆\mathcal T^\star of every stateimplicit: the maximum inside the backup
Q-learningone sampled backup of one pair (St,At)(S_t, A_t)implicit: act ε-greedily on the current QQ, and bootstrap from its maximum
Actor–critic (PPO, SAC)train the critic toward VπV^\pi or QπQ^\pigradient steps on the actor toward higher-valued actions
AlphaZerotrain a value network on game outcomestree search turns the network's policy into a stronger one, which the network then imitates
GPI at different grains: evaluation runs to completion or for a single sampled step, on all states or on one, and improvement is exact, greedy, gradual or done by search.

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.

ChoiceWhat it buysWhat it costs
Model-basedeach real transition improves a model that can generate many simulated updates; usually far fewer real samplesmodel errors compound over long imagined rollouts; more compute per sample; a good model can be harder to learn than a good policy
Off-policyreuse of old data through replay, learning from logs and demonstrationsbootstrapping, function approximation and off-policy data together can diverge (the deadly triad); more hyperparameters
On-policy policy gradientstable, simple, any differentiable policy, continuous actions, easy to run with many parallel simulatorsdata are discarded after each update, so it is data-hungry; gradient estimates are noisy
Value-based controlsample-efficient with discrete actions; acting greedily is a lookupmax⁡aQ\max_a Q is hard to compute over continuous actions; maxima of noisy estimates are biased upward
Function approximationgeneralization across states, which large problems requiremost tabular guarantees no longer hold

Which family to try first

SituationTry firstWhyCourse topic
A small MDP whose rules you knowvalue or policy iterationexact and fast when the states can be listedPlanning with a Model
One decision per round, no state dynamics (ads, A/B tests)bandit algorithms, contextual banditsno credit assignment over time, and strong regret guaranteesBandits & the Explore–Exploit Dilemma
A fast simulator with discrete actionsa DQN-family method or PPO; for board games with exact rules, tree search with self-playsamples are cheap; search exploits a perfect modelFunction Approximation & Deep Q-Learning; Model-Based RL
A simulator with continuous actionsPPO with many parallel simulators; SAC or TD3 when samples cost moreoff-policy actor–critics reuse data; PPO is simple and parallelizes wellPolicy Gradients & Actor–Critic
Real hardware and few trialsmodel-based RL, or training in simulation with randomized dynamics and transferringevery real sample is slow, costly or riskyModel-Based RL; RL at the Frontier
Logs of past decisions and no new trialsoffline RL with pessimism, and off-policy evaluation before deploymentexploration is impossible, so the policy must stay near the dataLearning from Demonstrations & Data
Expert demonstrationsbehavior cloning first, then RL fine-tuningdemonstrations solve much of the exploration problemLearning from Demonstrations & Data
Sparse rewards and hard explorationexploration bonuses, posterior sampling, demonstrations or a curriculumrandom exploration rarely finds the rewardBandits & the Explore–Exploit Dilemma
Several learning agentsself-play and population methods; equilibrium solvers for gameseach agent's environment includes the other learnersMulti-Agent RL & Games
A pretrained language model with a preference or correctness signalRLHF with PPO, direct preference optimization, GRPO-style methodsthe model is the policy, and the reward is learned or checkedRL at the Frontier
Rules of thumb as of the mid-2020s, not laws: results depend on implementation quality and tuning as much as on the family (Benchmarks & Honest Evaluation).
Check your understanding

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?

  1. PPO from scratch on the live building, with plenty of exploration
  2. 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
  3. DQN with ε = 0.1 exploration on the real system
  4. 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.

Question 1

Why can't plain REINFORCE reuse episodes collected by earlier policies the way DQN reuses its replay buffer?

  1. Because REINFORCE needs a model of the environment
  2. Because REINFORCE works only with continuous actions
  3. 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
  4. 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 Eπθ[∑t∇log⁡πθ(At∣St) Gt]\E_{\pi_{\boldsymbol\theta}}\big[\sum_t\nabla\log\pi_{\boldsymbol\theta}(A_t \mid S_t)\,G_t\big] 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 (s,a,r,s′)(s, a, r, s') is a sample of the Bellman optimality equation, correct no matter who chose aa.

Question 2

Viewed as generalized policy iteration, where do evaluation and improvement happen in Q-learning?

  1. Each update moves Q(St,At)Q(S_t, A_t) toward a sampled one-step target (evaluation), and acting on and bootstrapping from the current QQ's maximum makes the policy greedier (improvement)
  2. Evaluation runs to convergence before every improvement, as in policy iteration
  3. There is no improvement: Q-learning only evaluates
  4. Improvement is a gradient step on a policy network
Show the answer

A. Each update moves Q(St,At)Q(S_t, A_t) toward a sampled one-step target (evaluation), and acting on and bootstrapping from the current QQ'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.

Question 3

Model-based methods are often more sample-efficient than model-free ones. Why, and what is the catch?

  1. They need no data at all
  2. They use larger networks, which learn faster
  3. They never need to explore
  4. 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.

Question 4

In the cliff walk, SARSA with ε = 0.1 learns the safe top route. What happens if ε is slowly reduced to zero during training?

  1. SARSA keeps the top route forever
  2. SARSA's targets come to evaluate an almost greedy policy, and it converges to the optimal edge route, as Q-learning does
  3. SARSA diverges
  4. 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).