Reinforcement learning at 2,000 ft¶
Reinforcement learning is learning what to do from the consequences of doing it. No one supplies the right answer, only a score, often late, for the answers you chose. The whole field rests on one recursive equation (the value of a situation is the reward now plus the discounted value of what comes next) and on a handful of ways to solve it: exactly with a model, approximately from samples, by searching ahead, or by nudging a policy uphill.
10,000 ft
Supervised learning imitates labelled answers; reinforcement learning (RL) improves behaviour against a reward signal, which lets it discover strategies no labeller knew. That is how TD-Gammon learned backgammon from self-play (1992–1995), how DQN learned dozens of Atari games from pixels (Mnih et al., 2015), how AlphaGo defeated Lee Sedol in March 2016 and AlphaZero mastered chess, shogi and Go from the rules alone (Silver et al., 2018). Since 2022 RL has also become the second stage of training language models: RLHF turned GPT-3 into an instruction follower (Ouyang et al., 2022), and RL against verifiable rewards produced the reasoning models of 2024–2026 (DeepSeek-R1, 2025). RL borrows its machinery from probability, optimisation and deep learning, and lends it to post-training, agents and robotics.
Reinforcement learning in one picture¶
An agent observes a state, chooses an action, and receives a reward and the next state from an environment. It wants to maximise the return, the (discounted) sum of future rewards. Everything else is vocabulary for the pieces an agent can learn:
| Piece | Symbol | What it answers | Learned by |
|---|---|---|---|
| Policy | \(\pi(a \mid s)\) | What do I do here? | Policy gradients, actor-critic, or greedy on \(Q\) |
| State value | \(v_\pi(s)\) | How good is it to be here, if I behave like this? | DP, Monte Carlo, TD |
| Action value | \(q_\pi(s,a)\) | How good is this action here? | SARSA, Q-learning, DQN |
| Advantage | \(A_\pi(s,a) = q_\pi - v_\pi\) | How much better than my average is this action? | GAE, critics in PPO |
| Model | \(p(s', r \mid s, a)\) | What happens if I do this? | Supervised learning on transitions; given for games |
Three things make RL harder than supervised learning, and each has a page of this track behind it:
- You only see the reward for what you did. You must try things to learn about them, and trying costs: the exploration–exploitation trade-off (bandits).
- Rewards arrive late. A move early in a game is responsible for a win sixty moves later: the credit-assignment problem, solved by values and the Bellman equation (MDPs, TD learning).
- Your data depend on your behaviour. Change the policy and the states you visit change too, so the training distribution moves under you. This is behind most instability in deep RL (DQN, PPO) and the central difficulty of learning from fixed logs (offline RL).
The one equation
Every page in this track solves, estimates or climbs the Bellman equation
or its optimality form with \(\max_{a'}\) in place of the next action. Dynamic programming solves it with the model. TD learning replaces the expectation by a sample. DQN replaces the table by a network. Policy gradients use it to judge which actions to make more likely. AlphaZero uses search to compute a better target than the network's own guess. If you can write this equation from memory and say what each method does to it, you have the 2,000-ft view of RL.
The map of the track¶
The track has two halves. Unit 1 (bandits to TD) is the classical, tabular theory: small problems you can solve exactly and check by hand, where every idea is visible. Unit 2 (Q-learning to RL for language models) is what happens when tables are replaced by neural networks and the problems become Atari, Go, robots and LLMs. The ideas do not change between the halves; the engineering does.
Three questions that classify any RL algorithm¶
| Question | Options | Examples |
|---|---|---|
| What does it learn? | values only (act greedily) · a policy only · both (actor-critic) · a model too | DQN · REINFORCE · PPO, SAC · MuZero |
| Where do its data come from? | the current policy (on-policy) · any policy (off-policy) · a fixed dataset (offline) | SARSA, PPO · Q-learning, DQN, SAC · CQL, IQL, DPO-style methods |
| How is the target formed? | full expectation (DP) · complete return (Monte Carlo) · bootstrapped estimate (TD) · look-ahead search | value iteration · REINFORCE, GRPO · Q-learning, GAE · AlphaZero's MCTS |
Most algorithms you will read about are a choice on each axis plus engineering to make that choice stable at scale.
How to work through this track¶
Times are for studying properly: deriving the equations, running the code, answering the questions.
- Bandits and exploration (70 min). Exploration versus exploitation with no states: ε-greedy, UCB, Thompson sampling and regret.
- MDPs and the Bellman equations (80 min). States, returns, discounting, value functions and the two Bellman equations. The page everything else refers back to.
- Dynamic programming (75 min). Policy evaluation, policy iteration and value iteration when the model is known; why they converge, and what replaces them at scale.
- Monte Carlo and temporal-difference learning (90 min). Learning values from experience: MC, TD(0), n-step, TD(λ), SARSA and importance sampling.
- Q-learning and DQN (80 min). Off-policy control, then deep Q-networks, replay buffers and target networks.
- Policy gradients and REINFORCE (85 min). The log-derivative trick, baselines and the variance problem.
- Actor-critic and PPO (about 90 min). Critics, advantages, GAE, trust regions and the clipped objective used in RLHF.
- Model-based RL and planning (about 90 min). Monte Carlo tree search, AlphaZero, MuZero and learned world models.
- Offline RL and RL for language models (about 90 min). Learning from fixed data, and the token-level MDP behind RLHF and RL with verifiable rewards.
Fast path for an LLM engineer (about 6 hours): 1 → 2 → 4 → 6 → 7 → 9, then RLHF with PPO and RL with verifiable rewards. Skim 3 for value iteration and 5 for the off-policy idea.
Path for games, planning and robotics: 1 → 2 → 3 → 4 → 5 → 8, then 6 → 7 for continuous control, and embodied AI and robotics.
Mastery path: all nine in order, every "Things to try" exercise, and chapters 2–13 of Sutton and Barto alongside.
-
Act to learn, learn to act: ε-greedy, UCB, Thompson sampling and the logarithmic regret bound.
-
MDPs and the Bellman equations
States, discounting and values; the recursive equation every RL method solves.
-
Policy and value iteration with a known model: contraction, Newton steps and the curse of dimensionality.
-
Monte Carlo and temporal-difference learning
Learn values from experience: returns versus bootstrapping, n-step, TD(λ), SARSA, importance sampling.
-
Off-policy control, then Atari from pixels with replay buffers and target networks.
-
Policy gradients and REINFORCE
Climb expected return directly with the log-derivative trick, and fight its variance.
-
A critic for the baseline, GAE for advantages, a clipped ratio for safe steps: the RLHF workhorse.
-
Model-based RL and planning: AlphaZero, MuZero
Search ahead with a model, learned or given, and train the network on what search finds.
-
Offline RL and RL for language models
Learning from fixed logs, and the MDP view of RLHF, GRPO and reasoning models.
Reinforcement learning in twelve dates¶
| Date | Event | Read |
|---|---|---|
| 1957 | Bellman's Dynamic Programming; the MDP formalised | MDPs, DP |
| 1959 | Samuel's checkers player learns its evaluation function from its own later evaluations | MC and TD |
| 1988 | Sutton names temporal-difference learning | MC and TD |
| 1989 | Watkins's thesis introduces Q-learning | Q-learning |
| 1992 | Williams's REINFORCE; Tesauro's TD-Gammon learns backgammon by self-play | policy gradients, MC and TD |
| Dec 2013 | DQN plays Atari from pixels (arXiv; Nature 2015) | DQN |
| Mar 2016 | AlphaGo beats Lee Sedol 4–1 (Nature, Jan 2016) | model-based RL |
| Jul 2017 | PPO published (arXiv) | actor-critic and PPO |
| Dec 2017 | AlphaZero: one algorithm masters chess, shogi and Go from self-play (arXiv) | model-based RL |
| Oct–Nov 2019 | MuZero plans with a learned model (arXiv); AlphaStar reaches Grandmaster in StarCraft II (Nature) | model-based RL |
| Mar 2022 | InstructGPT: RLHF with PPO becomes the standard LLM recipe | RLHF with PPO |
| Jan 2025 | DeepSeek-R1: RL with verifiable rewards produces an open reasoning model | RLVR |
Prerequisites from other tracks¶
- Probability from first principles: expectations, conditional probability and the law of total expectation carry every derivation in this track.
- Estimation: MLE, MAP and Bayes: sample means, Beta posteriors (Thompson sampling) and why estimators have bias and variance.
- Matrices as linear maps: policy evaluation is a linear system; the successor representation is a matrix inverse.
- Derivatives and gradients and optimisation: policy gradients are stochastic gradient ascent.
- Entropy, cross-entropy and KL divergence: the Lai–Robbins bound, entropy bonuses, and the KL penalties in TRPO, PPO and RLHF.
- For unit 2: neurons and MLPs, backpropagation, optimisers and convolutional networks (DQN reads pixels).
The five best resources for this track¶
- Reinforcement Learning: An Introduction — Sutton and Barto, 2nd ed. 2018 (free online). The textbook. Chapters 2–7 and 12 are unit 1 of this track; 8–13 and 16 are unit 2. Every running example on these pages comes from it.
- Introduction to Reinforcement Learning — David Silver, DeepMind x UCL 2015 (slides). Ten lectures that follow the same arc as this track, by the lead of AlphaGo.
- CS 285: Deep Reinforcement Learning — Sergey Levine, UC Berkeley (2023 lectures). The deep-RL half: policy gradients, actor-critic, Q-learning with networks, model-based and offline RL, with homework.
- Spinning Up in Deep RL — Joshua Achiam, OpenAI. Concise derivations, clean reference implementations of VPG, PPO, DDPG, TD3 and SAC, and a list of key papers.
- Reinforcement Learning: Theory and Algorithms — Agarwal, Jiang, Kakade and Sun. For the proofs: contraction, sample complexity, policy-gradient convergence, exploration.
Where this leads¶
- Start the track: Bandits and exploration.
- Here for LLMs? After the fast path, go to RLHF with PPO, RL with verifiable rewards and reasoning models and test-time compute.
- Here for agents? RL's credit-assignment and exploration problems reappear in computer-use and long-horizon agents.