← back to the archive

BY OTHERS◆Friday, October 30, 2026

by Richard Sutton and David Silver

Trial and Error: a course in reinforcement learning after the lectures of David Silver and the book of Sutton and Barto. Eighteen chapters you learn by playing: walk the cliff yourself, pull the levers, then watch the learners do it better.

tags: ai, reinforcement-learning, sutton, silver, teaching, alphago, rl

author
Richard Sutton and David Silver
filed
Friday, October 30, 2026
revised
October 30, 2026
words
150
reading
~1 min

Trial and ErrorA course in reinforcement learning
A course in reinforcement learning

Trial and error

After the lectures of David Silver and the book of Richard Sutton and Andrew Barto. Eighteen chapters you learn by playing: an agent, a world, and a number that says how well it went.

the agentthe worldan actiona new state, and a reward

You play first. Every chapter opens with the task in your hands: walk the cliff, pull the levers, label the answers.

Then the learners play. Two of them, a careful one in blue and a bold one in orange, in the same world, with their values written on it and every update spelled out.

The code runs beside them. The algorithm as a few lines of Python, lit line by line as each step runs. The maths is one tab away.

1Chapter 1 · States and observations

What it sees

An agent sees the world only through its observations. When the present tells it everything the past could, its state is Markov.

An agent never meets the world directly. It gets observations, one at a time, with rewards and its own actions in between: its history. It cannot carry all of that for ever, so it keeps a summary and calls it its state. The whole question is what to keep.

  1. Your turn · be the ratDavid Silver puts you in a cage (Lecture 1, 48:16). Episode 1: light, light, lever, bell, then an electric shock. Episode 2: bell, light, lever, lever, then cheese. Episode 3: lever, light, lever, bell. What comes next?trust your whiskers
  2. Three rats, three memoriesThe rat's state is whatever it keeps. Keep the last three events and episode 3 matches episode 1: shock. Keep the counts of lights, bells and levers and it matches episode 2: cheese. Keep the whole sequence and it has never seen it. The same past gives three answers, and none of them misremembers anything.the state is a choice, not a facta major thing that the mind does is learn a state representation and a process for updating it on a moment-by-moment basis. … “state is constructed”Richard S. Sutton · Fourteen declarative principles of experience-oriented intelligence, 2008
  3. Your turn · in the fogA robot on a 5 × 7 board sees only the four squares next to it, each a wall or open: nine different views in all. You have the map, not its place. Steer it, then click the square where you think it is. From inside, 24 of the 26 squares look exactly like another.walk a little before you guessEnactive approaches view perception as an active, skillful engagement with the world, where agents perceive by acting and by understanding how their actions shape their experience.Banafsheh Rafiee and Richard S. Sutton · Toward Enactive Artificial Intelligence, 2026
  4. Remember a little moreNow the map lights every square that fits what the robot has seen. Averaged over 200 random walks of 2,000 steps, the present view alone names its square 7% of the time. Keep one step more (the move and the view before it) and that rises to 43%; five steps, 88%; the whole walk, nearly always. Each remembered step rules squares out.the move alone adds nothing: you can see the door you came in by
  5. Two learners guess what comes nextBoth watch the robot wander at random and count what it sees after each move. The bold one keys its counts on the present view; the careful one also keeps its last step. Averaged over 200 runs, over steps 1,001 to 2,000, the bold one is wrong 40% of the time and the careful one 10%. The present view is not a Markov state; one step of memory makes it nearly one.

The environment has a state of its own: here, the robot's square. When the agent sees it directly, as in a board game, the world is fully observable and the observation is already a Markov state. Usually it is hidden, as the square is from the robot, and the world is partially observable: the agent must build its own state out of the history, from the last few steps or a belief about where it might be.

24

of the 26 squares on this board look exactly like another square from inside.On a 2,000-step random walk played on this page, the robot could name its square from the view alone 7% of the time; remembering one step, 44%; two, 62%; five, 88%; the whole walk, 99.9%.

Where the robot knows where it is.

One walk of 2,000 random steps, seen five ways. A square is greener the more often the robot, standing on it, could say which square it was; pale squares, never. Only the 2 squares with no twin are green from the start.

7%the view now
44%+ 1 step
62%+ 2 steps
88%+ 5 steps
99.9%the whole walk
wallnever surealways sure9 different views, 26 squares
SOA state is Markov when nothing in the past would change the forecast. The robot's present view is not one; its last step makes it nearly one, and its whole walk names the square.
If you’ve got this state representation and it’s Markov, you can throw away the whole rest of the history … just keep your state, and you’re good.
David Silver, Lecture 1, Introduction to Reinforcement Learning · 43:09
2Chapter 2 · Policies

What it does

A policy gives each action a probability in each state. Against an opponent who learns, a policy that is never random can always be beaten.

A policy is what an agent does: in each state, a probability for each action, π(a | s). In David Silver's words, a policy fully defines the behaviour of an agent, and it depends on the present state, not on the history. A policy may put all its probability on one action. This chapter is about two places where it should not.

  1. Your turn · rock, paper, scissorsThrow against a predictor. Before each throw it looks only at your past throws: what you threw after your last throw, and after your last two. It plays what beats its guess, so it wins exactly when it calls your throw. It never sees the throw you are making. Buttons, or the keys R, P and S.be unpredictable. go on.
  2. Orange · a rule with no chance in itOrange plays a fixed rule: rock, paper, scissors in turn, or rock every time. That is a policy too, one that puts all its probability on one throw. Averaged over 2,000 matches of 60 throws, the predictor calls 94% of the cycle's throws and 99% of always-rock's, and from the 11th throw on it calls every one.a habit is a pattern, and patterns get counted
  3. Blue · a third eachBlue throws each of the three with chance one in three, whatever came before. There is no habit to count. Over the same 2,000 matches the predictor calls 33.5% of blue's throws and loses 33.1%: it is held level. In this game the only policy that cannot be exploited is the uniformly random one.Interactions between exploiters are highly non-transitive: across the full payoff, there are around 3,000,000 rock–paper–scissor cycles … that involve at least one exploiter, and around 200 that involve only main agents.Oriol Vinyals et al. · Grandmaster level in StarCraft II using multi-agent reinforcement learning, Nature, 2019
  4. The corridor · squares that look alikeNow the look-alike squares of Chapter 1. Three squares in a row, the goal to the right of the third, each step costs 1. In the middle square left and right are swapped. You start on the left and are told only that you are on a square. The same press does different things on squares you cannot tell apart.right, right, right… where am I?keep going in the same way if things are getting better, and otherwise move aroundOliver Selfridge, as quoted by Richard S. Sutton and Andrew G. Barto · Reinforcement Learning: An Introduction, 2nd edition, section 15.9, 2018
  5. The whole policy is one numberAn agent that sees only “a square” must act the same on all three, so its policy is p, the chance of pressing right. Always right, or always left, never arrives. ε-greedy with ε = 0.1 means p = 0.95 (worth about −44) or 0.05 (about −82). The best is a weighted coin: p = 2 − √2, about 0.59, worth −11.66.

The predictor here is simple: it counts only your throws. A rule that reacts to its throws instead, such as always playing what beats its last throw, is called only 47% of the time (200 matches). But that is still a rule, and an opponent who knew it would win every throw. Only chance has nothing to find.

In the corridor you could beat every policy on the curve: you remembered your presses, so right, left, right reaches the goal in 3 steps. The agent's policy sees only the present square, and when squares look alike, chance is the best stand-in for memory it has. Chapter 13 shows how an agent learns its p by itself.

?%

of your throws will it call? Throw in the panel above.Averaged over 2,000 matches of 60 throws: always rock 99%, the cycle 94%, uniform random 33.5%.

Every throw, one tick. Red ones it called.

One match of 60 throws for each player against the same predictor. Your own throws land in the top row as you play.

Youthrow in the panel and your throws land here·Rock98%Cycle95%Random33%
SOA policy is a probability for each action in each state. When an opponent counts your habits, or when your states look alike, the best probabilities are not ones and zeros.
If you were to play this deterministically, any deterministic strategy is very easily exploited: if I always play rock, you'll very quickly figure out you should just play paper, and I'll lose every single time. The only optimal policy, in terms of a Nash equilibrium, is to play uniformly at random. Anything else can be exploited.
David Silver, Lecture 7, Policy Gradient Methods · 14:46
3Chapter 3 · Rewards

What it gets

A reward says what we want, not how to get it. Pay an agent for something and it will find the way that pays best, whether or not it is the way you meant.

After every step the world hands the agent one number, the reward Rt. Its job is to collect as much of it as it can over time, and some of what it does now will only pay, or cost, much later. The reward is the only place we get to say what we want. Nobody tells a stunt helicopter, moment by moment, that it did right; crashing is simply very bad.

  1. Your turn · write the payA treasure on the right, seven steps from the start. You decide what the agent is paid: +10 at the treasure or nothing, a cost for every step, up to three coins that pay +1 and come back four steps after they are taken, and a ‘warmer’ bonus for being near. Press Train and a Q-learner (Chapter 10) plays 300 episodes on your pay, then walks its best road. First make it fetch the treasure. Then try to make it not.drop a coin somewhere silly
  2. Paid for coinsThree coins in a pool below the road, like the targets in the boat game CoastRunners, where OpenAI's agent circled a lagoon instead of finishing the race. A lap of the pool can take three coins every four steps. With γ = 0.99, circling is worth 72.9 from the start; walking home is worth 9.4. It circles, and by its pay it is right. Averaged over 1,000 runs, 999 learners ended circling.it is not broken. it is paid.So there is a concern that if you ask a system to maximize some measure, you don't know a priori what it's going to come up with, and so you have to do it with care.Andrew G. Barto · ACM ByteCast, Episode 80: Andrew Barto and Richard Sutton, 2026
  3. Warmer, the naive wayPay it a little for being near: +0.2 for every square nearer than the start, each step. Beside the treasure that is 1.2 a step for as long as it stays; stepping in ends the pay. Hanging about is worth 116.9, going in 14.8. It never steps in: in 1,000 runs out of 1,000, and in 911 of them it hangs about within two squares of the treasure.… we are not breadcrumb-trailing the particular objective to be learned. … We're giving the agent some simple objectives and asking it to discover things that will surprise us and amaze us.David Silver · Training Data, Sequoia Capital, 2026
  4. Warmer, the fair wayNg, Harada and Russell (1999) proved which hints are safe: add γΦ(s′) − Φ(s) to every reward, for any Φ of the state. Here Φ is minus the distance to the treasure. Every road from the start gains the same +7, so the best road stays the best. It finds that road sooner: after 300 episodes, 86% of hinted learners walk a seven-step road, against 30% paid by the treasure alone (averaged over 1,000 runs).a hint, not a new goal
  5. Side by sideThe same learner, board and seed; only the pay differs. Orange is paid for coins and the treasure, blue for the treasure and the fair hint. Count what each brings home. Your own design walks with them.

Nothing here was a bug in the learner. Each one found the best plan for what it was paid. Charge 1 for every step, more than the pool pays per step, and the same learner goes home in all 1,000 runs. The lesson: pay for the outcome you want, and add hints only in the one shape that cannot change it.

425

coins taken for every treasure reached, by the learner paid for coins, over its 300 episodes.The hinted learner, same seed: 300 treasures in 300 episodes, no coins. Your pay: 288 treasures, 0 coins.

Six ways to pay, one learner.

Each board is the same Q-learner after 300 episodes (seed 21; yours, your own run), walking its best road with no exploring. A ringed road never ends.

Treasure alonehome in 11 steps+ coinsloops, never home+ coins, −1 a stephome in 9 steps+ naive warmerstuck, never home+ fair hinthome in 7 stepsYour payhome in 11 steps
SOThe learner never changed; only its pay did. Whatever you pay for is what you get, so pay for the end, not for the signs of it.
All goals can be described by the maximization of expected cumulative reward. So there's nothing that we mean by a goal that can't be described by some scalar feedback signal, and the maximization of that signal over time into the future. That's a little bit controversial, so you should think about that. Do you agree with it?
David Silver, Lecture 1, Introduction to Reinforcement Learning · 23:48
4Chapter 4 · Returns and discounting

How far it looks

Every step of delay multiplies a reward by γ, so one number decides between the near and the far.

An agent does not chase the next reward. It chases the return, G, the sum of all the rewards still to come, and each step further off, a reward is multiplied once more by γ, the discount, a number between 0 and 1. Close to 0, the agent lives for the moment; close to 1, it plans far ahead.

  1. Your turn · the snack or the treasureFive boards. On each, a small prize waits a step or two from you and a bigger one waits further off. Walk to the one you would rather have. Every pick says something about how far you look, and the panel keeps count.no wrong answers. yet.It is all hedonism, but value functions make it hedonism with foresightRichard S. Sutton · Reward and Related Reductionist Hypotheses, 2023
  2. Turn the dialNow the agent picks. A reward that arrives on step k counts γk−1 of itself, so on board A the snack is worth γ and the treasure 10γ8. They are equal where γ7 = 1/10, at γ = 0.72: below it the agent takes the snack, above it the treasure.the red notch is where it changes its mind
  3. Value iteration · one square per sweepNobody tells the agent the distances. Value iteration sweeps the board, and each square takes the best of its neighbours' values, times γ. News travels one square per sweep. At γ = 0.9 the start square hears of the snack after 2 sweeps and points left; the treasure's news arrives on sweep 9, its value jumps from 0.90 to 4.30, and the arrow turns right.
  4. Two agents, two horizonsThe same board, two agents. Blue, with γ = 0.9, walks nine steps for the treasure; orange, with γ = 0.5, takes the snack. From the start the treasure is worth 4.30 to blue and 0.04 to orange. Neither is mistaken: they want different things.same world, different patienceI find it hard to justify focusing on the galactic future of humanity when there are millions of people suffering and dying todayDavid Silver · WIRED, 2026
  5. Why discount at all?David Silver gives two reasons. The first is that it is mathematically convenient, and he says that is the main one. The second is that it avoids infinite returns: walk a loop that pays +1 every step and with γ = 1 the sum never stops. With γ below 1 it settles at 1/(1 − γ), which is 10 at γ = 0.9.

The same number gives a rough horizon, 1/(1 − γ): about 10 steps at γ = 0.9, and the first 10 steps carry 65% of all the weight. It is a guide, not a wall. At the flip on board A, γ = 0.72 looks about 3.6 steps ahead, yet the agent walks 9 for the treasure: a prize ten times larger is worth looking past the horizon for.

0.72

is the γ where the agent changes its mind on board A.Below it, the +1 2 steps away; above it, the +10 9 steps away. Exactly (1/10) to the power 1/7 = 0.7197. Value iteration, run on this page, flips at 0.7197.

Five boards, twelve values of γ. Which way does the agent go?

Each square is value iteration run to the end at that γ, read at the start square. The red line is each board's flip, the dotted line is your dial, and your own pick on each board sits on the right.

the snackthe treasurethe flip
.3.4.5.6.65.7.75.8.85.9.95.99flipyouA+1 at 2 · +10 at 90.72·B+1 at 1 · +10 at 30.32·C+1 at 1 · +2 at 40.79·D+3 at 2 · +10 at 120.89·E+5 at 1 · +6 at 80.97·
SOOne number, γ, sets how far an agent looks. It decides between the snack and the treasure, and value iteration finds the flip by itself, one square per sweep.
The first reason is it's just mathematically convenient, and honestly that's the main reason we do it. The math all works out; it's easy to teach. It avoids these infinite returns: if you have some cycle and you just get rewards again and again, you need some mechanism to avoid infinity, otherwise the math doesn't work out.
David Silver, Lecture 2, Markov Decision Processes · 19:58
LifeBetween chapters 4 and 5

Near things look bigger

Chapter 4's agent weighs a reward one step further off by one more factor of γ. People weigh waiting differently, and so they change their minds.

Every day of waiting costs the agent the same share of a reward, so it ranks two rewards the same way from any distance. Whatever it wants from far off, it still wants up close.

People and animals discount steeply up close and gently far off, roughly as one over one plus the delay. Zeb Kurth-Nelson and David Redish state the consequence: exponential decay is the only discounting function in which preference reversal does not appear. With any other curve, the big prize chosen from a distance loses to the small one when it gets near.

Socrates saw it in the Protagoras. He asks for a weigher who puts the pleasures and pains into the balance with their nearness and distance, because

Do not the same magnitudes appear larger to your sight when near, and smaller when at a distance?Plato, Protagoras, tr. Benjamin Jowett

The oldest cure is to decide early and make the choice stick. Odysseus wanted to hear the Sirens and live, so he told his crew to bind him to the mast: If I beg and pray you to set me free, then bind me more tightly still. Pigeons have done the same in the laboratory: offered the chance, some switched off the smaller, sooner option in advance, and the further ahead of the choice they were asked, the more often they did.

For a lifeWhen you know you will want the near thing up close, choose from far away, and tie yourself to the choice before it arrives.
The agent, γ = 0.90wants the feast02460246810today is day …feast 2.06snack 1.74the lines never cross
A person, 1 / (1 + days)wants the feast02460246810today is day …feast 0.63snack 0.45changes its mind on day 6
Day 0: the agent wants the feast, the person wants the feast.
tie yourself while you still want the feast
A small reward, +5 on day 10, and a big one, +10 on day 15. Drag today toward them. The agent multiplies by γ for every day of waiting; the person divides by one plus the days left.
It is all hedonism, but value functions make it hedonism with foresight
Richard S. SuttonReward and Related Reductionist Hypotheses, talk slides, 2023, slide 19

Back to the agent. It knows how far it looks; Chapter 5 asks how it finds out what a state is worth.

Sources: Kurth-Nelson and Redish 2010 · Homer, Odyssey XII, tr. Butler · Plato, Protagoras, tr. Jowett · Sutton 2023, slides

5Chapter 5 · Monte Carlo

What it expects

The value of a state is the average return that starts there.

A value is a prediction: how much reward to expect from here on. Dynamic programming worked values out from the rules of the game. Monte Carlo is handed no rules at all. It plays to the end, writes down what happened, and averages.

  1. Your turn · Easy21David Silver's Easy21, from his 2015 course. Cards run 1 to 10; one in three is red and counts against you. You and the dealer each start with one black card. Hit or stick; go over 21 or below 1 and you lose. Then the dealer hits until 17 or more, and the higher sum wins. Every square a finished hand passed through gets that hand's result, and your map keeps the averages.you are already doing Monte CarloA unified theory of expectation in classical and instrumental conditioning.Richard S. Sutton · Curriculum vitae, 1978
  2. The averager · 1,000 hands, then moreNow a machine plays one fixed rule, the dealer's own: stick on 17 or more. It keeps a running average for every square. The value of a square is the average of the results that passed through it. Averaged over 100 runs, the typical error across the map is 0.23 after 1,000 hands, 0.07 after 10,000 and 0.02 after 100,000: ten times the hands, about a third of the error.click a square, watch it settleTo know what’s in a box is to predict what you will see if you open it, or hear if you shake it, feel if you lift it, and so on.Richard S. Sutton · Experience-Oriented Artificial Intelligence, 2007
  3. Only at the endWatch one hand. The squares light up as it passes, but none of them learns a thing until the hand is over, because the result, G, does not exist before then. Monte Carlo needs complete episodes. With one reward at the end and no discount, every square in the hand gets the same G.no ending, no lesson
  4. Monte Carlo controlNow let it choose. It averages each move in each square, Q(s, a), takes the better one, and explores at random less and less as a square grows familiar, with Silver's settings. After 100,000 hands it stands on every sum from 1 to 6, whatever the dealer shows, as the best play does (all 60 of those squares, in 89 of 100 runs). Nobody told it that the dealer goes bust 66% of the time from a 1.it found the strange part on its own
  5. Close, not perfectThe best play can be worked out exactly from the rules. Averaged over 100 runs, after 100,000 hands Monte Carlo agrees with it in about 168 of 210 squares, and its rule earns +0.049 a hand against +0.063 for the best (copying the dealer: −0.27). Its averages count every hand equally, the clumsy early ones too, and a move it rarely tries is rarely corrected: even after 1,000,000 hands it sticks on 11 against about 4 of the 10 dealer cards (30 runs), where hitting is better.

That is the whole method: no model of the cards, only complete hands and patience. Its averages are honest, since each one is just what happened, but they need many endings, and they are slow to correct a move that is seldom tried.

+0.30

is what Monte Carlo expects from sticking on 5 when the dealer shows a 1.It puts hitting there at −0.01, so it stands, as the best play does (exact value +0.32): from a 1 the dealer goes bust 66% of the time. This run: 100,000 hands, seed 2015. Nobody told it why.

The map, filling in.

Monte Carlo control's map in this run after 1,000 hands, 10,000 and all of them, then yours. Colour is the result it expects from each square; the orange line splits sticking from hitting; the ring is sticking on 5 against a 1.

1,000 handsstick, 5 v 1: +0.11
10,000 handsstick, 5 v 1: +0.35
100,000 handsstick, 5 v 1: +0.30
play a hand
yours · 0 hands
SOThe value of a square is not computed from the rules; it is counted. Play to the end, credit every square on the way with what happened, and the averages become the map.
No one told us the dynamics of the game, no one told us the probabilities that govern the game of blackjack, no one told us the structure of the deck of cards. This was just by running episodes, trial and error learning, figuring out the value function directly from experience.
David Silver, Lecture 4, Model-Free Prediction · 22:05
6Chapter 6 · The Bellman equation

How guesses agree

The value of a state is the reward now plus the discounted value of the state that follows.

In Chapter 5 a state's value was the average of many returns, collected one whole episode at a time. There is a shortcut. A day from Class 3 is one step, then a day from wherever that step lands, so the value of Class 3 can be written with the values of its neighbours. Every state's value must agree with the values next to it. That condition is the Bellman equation.

  1. Your turn · a day as Silver’s studentDavid Silver's student starts the day in Class 1. Studying costs −2 a class, Facebook −1 a go and is hard to leave, passing Class 3 pays +10, and the Pub pays +1 but then chance sends you back to one of the classes. Choose your moves. Your return is the day's rewards added up. Live a few days.can you beat the coin-flipper?
  2. Your turn again · make the guesses agreeNow guess what each state is worth to a student who flips a coin at every choice. A guess is right only if it matches the reward now plus the value of where you land, averaged over the coin. The red bar beside each state is how far off it is. Nudge the guesses, or click a state to make it agree, until every bar is gone.fix one, and its neighbours move
  3. The careful learner · one sweep at a timeThe careful learner does what you did, to every state at once: each guess becomes what its neighbours say. One pass is a sweep, and the method is called iterative policy evaluation. The guesses settle on −1.3, 2.7, 7.4 and −2.3, the values on Silver's slide. After 13 sweeps every bar is under 0.01, and none ever reaches zero exactly.life and a mind involves both prediction and control. … in order to have good controls, you have to make good predictions …Richard S. Sutton · ACM ByteCast, Episode 80, 2026
  4. The bold learner · only the best next moveChange one word: instead of averaging over the coin, take the best action. Now the bars measure disagreement with the optimality equation. The guesses settle on 6, 8, 10 and 6 after only 4 sweeps, and then agree exactly. The best policy can be read off the settled guesses: study, study, study, and quit Facebook.from Class 3 the Pub is worth 9.4, studying 10I decided to call this technique “The principle of optimality.” Oliver Gross said one day, ‘The principle is not rigorous.’ I replied, ‘Of course not. It’s not even precise.’ A good principle should guide the intuition.Richard Bellman · Richard Bellman on the Birth of Dynamic Programming, 1984
  5. Or solve it at onceFor a fixed policy the equations are linear, v = R + γPv, and they solve in one go as v = (I − γP)−1R. For these four states that is instant. But the work grows like n3 for n states, so big problems sweep instead, and later chapters sweep with samples.

Silver's first version of the student has no choices at all, just probabilities, and there the same equation gives Facebook a value of −22.5 (his slide rounds it to −23): a state you sit in for ten turns on average, losing a point each time, before Class 1 takes over. The equation does not care whether a value is pleasant. It only asks that the guesses agree.

13

sweeps before every one of the careful learner's guesses agrees with its neighbours to within 0.01.The bold learner needs 4, and then agrees exactly: along the best road, the news from Sleep travels back one state per sweep. Both start from all-zero guesses, γ = 1.00, as on Silver’s slides.

The bars, sweep by sweep

Each tile shows the four disagreements, Class 1, Class 2, Class 3 and Facebook from left to right, red above the line where a guess is too high and below where it is too low; the number is their total. The last tile is your own puzzle, as it stands.

sweep 0sweep 1sweep 2sweep 5sweep 20yours, nowCareful8.505.252.750.140.008.50Bold11.009.007.000.000.00your puzzle isthe careful one's
SOA value is right when it agrees with its neighbours: average over what you will do and it checks a policy; take the max and it finds the best one.
The value function now is equal to the expected immediate reward plus discounted value at the next state … If we don’t obey this identity, we haven’t found the value function yet.
David Silver, Lecture 2, Markov Decision Processes · 33:54
7Chapter 7 · Dynamic programming

If the rulebook is given

When the rules of the world are known, the best way across can be computed without taking a single step.

Chapter 6 made the student's guesses agree by sweeping four states with Silver's rules in hand: where each choice led, with what chance, and what it paid. Those rules are a rulebook. Given a rulebook, any world can be swept the same way: back every state up from the states it leads to, again and again, until the guesses stop moving. That is dynamic programming, and its first world is Silver's small grid.

  1. Your turn · be the sweepSilver's small gridworld: two goal corners, four moves, −1 a step, and a move off the edge leaves you where you are. Every square starts as ?. Click one to back it up: it takes −1 plus the best of the squares its four moves land on. Settle the whole grid in as few clicks as you can.the fewest possible is 14. which order gets it?
  2. The rulebookEach click read one page of a rulebook: for every move, where it lands and what it pays. Fourteen squares, four moves, 56 lines. Dynamic programming needs every page, and with them it never has to take a step.
  3. Blue · the random walker's valuesSilver first asks a humbler question: how many steps does a walker who picks each move at random, ¼ each, take to stumble into a corner? Blue backs up every square from the last sweep's numbers. After sweep 1 every square is −1; after sweep 2 the squares by a corner are −1.75 (his slide prints −1.7). By sweep 3 every arrow points a shortest way, and they never change again. The numbers take 142 sweeps to settle within 0.01: −14 beside a corner, −22 in the far corners.the arrows are done long before the numbersA better action might be available from planning, but planning, and even learning, takes time; sometimes it is better to act fast than to act well.Richard S. Sutton, Michael Bowling and Patrick M. Pilarski · The Alberta Plan for AI Research, 2022
  4. Orange · the best moveOrange backs up with the best move instead of the average: value iteration. From zeros it reaches the true values, −1, −2 and −3 by distance to the nearer corner, in 3 sweeps. The values spread out from the goals one square per sweep.
  5. Evaluate, then improvePolicy iteration takes turns. Evaluate a policy, then point every arrow at the best-looking move, then evaluate the new policy. Round 1 evaluates the random walker in 142 sweeps and the improvement changes all 14 squares. Round 2 takes 3 sweeps and changes 2. In round 3 nothing changes, and that is the proof it is optimal.
  6. Rewrite the rulebookClick a square to build a wall, or drag a goal somewhere else. That changes the pages, and the values and arrows re-form around the change, sweep by sweep, still without a single step taken.no walking. only reading.Tree-based planning methods have enjoyed huge success in challenging domains, such as chess and Go, where a perfect simulator is available. However, in real-world problems, the dynamics governing the environment are often complex and unknown.Julian Schrittwieser et al. · Mastering Atari, Go, chess and shogi by planning with a learned model, 2020

Dynamic programming is planning: nothing moves, nothing is risked, and the answer comes out exact. Its price is that every sweep visits every state, and its condition is the rulebook. Every sweep here read the rulebook. A real agent is never handed one. Chapter 8 learns the same kind of values on a road it can only drive, one surprise at a time.

3

sweeps, and the random walker's arrows stop changing. The numbers under them need 142.Silver’s grid: synchronous sweeps from zeros; 142 is the sweep after which every value stays within 0.01 of the limit. Computed live for the grid in the panel.

The random walker's grid after 0, 1, 2, 3 and 10 sweeps, and in the limit

Arrows point at the moves that look best by each sweep's numbers. A red arrow is not on a shortest way to a goal. Darker squares are further from a goal, by the numbers.

sweep 0all 0sweep 1all −1sweep 2−1.75 to −2.00sweep 3−2.44 to −3.00sweep 10−6.14 to −8.97the limit−14 to −22
SOWith the rulebook in hand you can compute the best way across without a step. Most of the work is polishing numbers that no longer change a single decision.
Even if you just did a few iterations of your Bellman expectation equation, got some very crude estimate of how good each state is, and act greedily with respect to that, that was already enough to come up with a much better policy. All this additional work gained us nothing. Iterations four to infinity of our loop are wasted work.
David Silver, Lecture 3, Planning by Dynamic Programming · 59:00
8Chapter 8 · Temporal-difference learning

What surprised it

A guess can be corrected by the next guess, without waiting for the end.

Monte Carlo learns from what finally happened. Temporal-difference learning learns from what it now expects: after each step it compares the guess it made a moment ago with the guess it makes now, and the difference is the surprise, written δ.

  1. Your turn · drive homeFriday, 6:00, and you leave the office. At each landmark, set when you think you will be home: drag the dot, or use the arrow keys, then drive on. Each new guess judges the one before it.be honest. nobody is checking.
  2. TD · correct the last guess nowSutton's own Friday, from the book. At the car it is raining, and he now expects 40 minutes in all, not 30. TD does not wait to see who is right: it moves the office guess toward the car guess at once, by the surprise δ = 5 driven + 35 to go − 30 = +10. A guess is corrected by the next guess.a guess toward a guessWe also found evidence that DiscoRL uses a bootstrapping mechanism. … This means that the future predictions are used to construct targets for the current predictions.Junhyuk Oh et al. · Discovering state-of-the-art reinforcement learning algorithms, Nature 648, 2025
  3. Monte Carlo · wait for homeMonte Carlo learns nothing on the road. At 6:43 it knows the truth, 43 minutes, and moves every guess toward it, all at once and only at the end. A drive that never ends, or a near miss that ends well, teaches it nothing on the way.You can learn not to do what got you into that fearful state and you can learn to reinforce and repeat what got you out of it. But if you're waiting for the final outcome … you didn't have a crash …Richard S. Sutton · ACM ByteCast, Episode 80, 2026
  4. The surprises add upSutton's five surprises are +10, −5, +5, +3 and 0. They add up to 13, which is 43 − 30, the error of his first guess. Yours do the same with your numbers: each guess appears once with a plus and once with a minus, so only the first guess and the truth are left.small news, the whole error
  5. Three hundred commutesTwo learners drive a made-up commute 300 times, starting from no idea at all. Averaged over 300 runs at α = 0.1, Monte Carlo is ahead for the first 130 or so commutes, because TD leans on guesses further down the road that are still wrong. After that TD is steadier: about 0.5 minutes off at commute 300, against 0.6.
  6. A cell that reports surpriseSchultz, Dayan and Montague (1997): dopamine neurons fire to an unexpected drop of juice. Once a tone predicts the juice, they fire to the tone instead, and if the juice is then withheld, their firing dips at the moment it was due. They proposed that the cells report the TD error. Here is that model, simulated: in it, the burst creeps back from the juice and reaches the tone at pairing 26.the surprise, in a brain

TD needs no model of the road and no end to the drive, so it can learn on a journey that never finishes, and from a near miss that never hurts. The price is that it learns from its own guesses, and while those are wrong it learns slowly, as the race in step 5 shows.

13

minutes: Sutton's five surprises on the way home add up to the whole error of his first guess, 43 − 30.Drive home above and yours appear here. The TD learner's, after 300 commutes of this run: +0.1, 43 − its 42.9.

Every drive's surprises, stacked in order.

Each ledger starts at the first guess (black dot) and steps by each landmark's surprise. Whoever guesses, the steps land on the truth (green).

Sutton30+10−5+5+30+13TD learner42.9+3.7−5.2+1.50.0+0.1+0.1Youdrive home and yours lands here
SOThe surprise δ is the gap between two guesses a step apart, plus what happened in between. Learning from it corrects each guess as soon as the next one exists, and the small corrections add up to the error the end would have shown.
I’m going to start off guessing how long it’s going to take me to get to the wall. I’m going to walk some number of steps, I’m going to make another guess … and I’m going to update my original guess towards my subsequent guess.
David Silver, Lecture 4, Model-Free Prediction · 35:15
9Chapter 9 · Eligibility traces and step sizes

How far back the credit goes

When a reward finally arrives, the states that led to it share the credit: the recent ones most, and the frequent ones too.

Chapter 8's driver moved one guess per step: the state it had just left. Chapter 5's Monte Carlo waited for the end of the hand and moved every state in it. Between them is a dial, λ. Turn it and each state keeps an eligibility trace, a fading memory of having been there, and every error is shared out in proportion to it.

  1. Your turn · the bell and the lightSilver's puzzle. A bell rings, rings, rings; a light flashes; then a shock. Which caused it? Drag the line to split the blame. Then three rules split it: frequency blames what happened most, recency blames what happened last, and the trace does both. Each cue's trace fades by γλ every step and gains 1 each time the cue comes back.at γλ = 0 the trace is recency; at 1 it is frequency
  2. Your turn · the walkNineteen stepping stones, a gate at each end: −1 on the left, +1 on the right. Walk to either gate. Behind you every stone glows with its trace. On your first walk nothing moves on the way, because every guess is still 0 and so is every error; when the reward lands, every glowing stone moves by αδE. Slide λ and the same walk is replayed: at 0 only the last stone moves, as in Chapter 8; at 1 the whole path does, as in Chapter 5.wander back and forth: a stone you revisit glows brighter
  3. Two learners, the same walksNow a coin walks: left or right with even odds, so each stone has a true value, from −0.9 to +0.9, drawn in green. Blue uses λ = 0.8, orange λ = 0 (Chapter 8's TD), each at its best step size, 0.3 and 0.8. They take exactly the same walks; only the credit differs. Averaged over 100 runs, their error over the first 10 walks is 0.26 for blue and 0.34 for orange.step it once and read the line under the stones
  4. Turn the dialEvery λ at every step size, 100 runs each: U-shaped curves, and the lowest sit in the middle of the dial. Each at its best step size, λ = 0.7 gets an error of 0.25 over the first 10 walks, TD(0) gets 0.34 and λ = 1 gets 0.50. Near λ = 1 a big step blows up: credit piles up on the stones visited most.It introduces TD(lambda)---the one algorithm that I feel we all must understand completely. … sometimes going back in time, here to 1988, is a fun way to learn. But yeah, this reading is optional.Richard S. Sutton · Reading list for Rich's RL approach to AI, 2023
  5. How big a stepThe same blue learner, your step size. Too small and it crawls; too big and every walk throws the stones past the truth. Averaged over 100 runs, α = 0.05 gives 0.46, 0.3 gives 0.26 and 1 gives 1.03. Chapter 5 averaged, a step of 1/n, every sample counting the same; a constant α counts the newest most, a sample n steps old by α(1 − α)n, so it keeps up when the world changes but never quite settles.to settle: Σα = ∞ and Σα² < ∞The intended outcome is expressed in the units of what we care about changing, not in the units of the parameters.Arsalan Sharifnassab et al. · Intentional Updates for Streaming Reinforcement Learning, 2026

Every value so far has belonged to a state: how good it is to be here. The stones never chose anything; a coin chose for them. An agent that must choose needs a value for each move, and Chapter 10 gives the cliff walker exactly that. So: how do you learn what a single move is worth?

0.7

is the best λ on the 19-stone walk.Its error over the first 10 walks is 0.25. TD(0), λ = 0, gets 0.34; λ = 1 gets 0.50. Each at its own best step size, averaged over 100 runs.

One walk, four settings of the dial.

Blue's first walk of this run (170 steps, ending at the +1 gate), replayed from nothing with α = 0.1. Bars: each stone's value afterwards; green: the truth. At λ = 1 the stones visited most are pushed far past +1.

λ = 01 stone movedλ = 0.411 stones movedλ = 0.818 stones movedλ = 118 stones moved, top 2.8
SOλ is how far back the credit goes: at 0 one step, as in Chapter 8; at 1 all the way to the start, as in Chapter 5. In between, the recent and the frequent share it, and on this walk the in-between learns fastest.
If you thought the most frequently occurring state caused this event, you would assign credit to the bell … But there's also a recency heuristic: the most recent thing which happens should be assigned credit for the error that we see. The idea of eligibility traces is to combine both these characteristics together.
David Silver, Lecture 4, Model-Free Prediction · 1:31:10
10Chapter 10 · Sarsa and Q-learning

From guesses to choices

Learn from the best next move and you learn the best road; learn from the move you will really make and you learn the safe one.

To choose well, an agent needs the value of each action in each state, q(s, a). The two learners in this chapter update it after every step, just as in Chapter 8. They differ in a single term: which next move they assume they will make.

  1. Your turn · the cliffSutton and Barto's cliff: a 4 × 12 grid, the start at the bottom left, the flag at the bottom right, and between them a drop. Each step costs 1. Going over costs 100 and puts you back at the start. Walk to the flag. One move in ten slips in a random direction, as an exploring agent's would.go on, walk the edge. I dare you.
  2. Sarsa · learning on the jobSarsa updates toward the move it will really make next, A′, chosen the same slippery way. Its values carry its own clumsiness, so the squares by the edge look bad, and it learns the long road along the top.it knows it slips
  3. Q-learning · looking over a shoulderQ-learning updates toward the best next move, whatever it will really do. Its values describe a walker who never slips: it learns the shortest road, 13 steps, right along the edge.it plans for a better self than it isIf you are just talking in general about the value of an action at a state, then the term I prefer is simply "action value".Richard S. Sutton · Reinforcement Learning FAQ, 2001–2004
  4. The better plan earns lessWhile both still explore, the edge bites. Averaged over 300 runs, Sarsa earns about −27 per walk and Q-learning about −50. The better plan, walked by a slipping walker, falls more.If it is possible for it to be built in simulation, I believe it will happen ten times or a hundred times faster … It's also the safest place for superintelligence to be built.David Silver · Training Data, Sequoia Capital, 2026
  5. Stop exploringLet ε shrink to nothing and the slips stop. Q-learning now walks its edge road without falling: 13 steps, the best there is. Sarsa keeps its 17-step road. It learned to fear the edge while it was still slipping, and with no exploring left it never goes back to check.

On-policy methods like Sarsa learn the value of what they actually do, mistakes included. Off-policy methods like Q-learning learn the value of what they could do at their best. Which you want depends on whether the mistakes are real: a robot that will keep exploring beside a real drop should learn like Sarsa.

28%

of Q-learning's walks went over the cliff once it had learned its road.Sarsa's: 8%. Walks 101 to 500 of this run, ε = 0.10.

Every walk, one tick. Red ones went over.

One run for each learner, the same random seed, 500 walks to start; the shares count walks 101 onward. Your own walks join the bottom row as you play.

Q-learning28%Sarsa8%Youreach the flag and your walk lands here·
SOBoth learners use the same step, the same reward and the same slips. One term, A′ or max, decides whether a learner values the road it can walk or the road it could walk at its best.
On-policy learning, I like to call it learning on the job … off-policy learning, which you can think of as looking over someone’s shoulder.
David Silver, Lecture 5, Model-Free Control · 4:16
11Chapter 11 · Exploration and exploitation

When to try something new

Find the best of several machines while losing as little as possible on the way.

A row of four slot machines, each paying out with its own hidden chance. Every pull either uses what you know or tests a machine you are unsure of. This is the multi-armed bandit: the choice between exploring and exploiting with nothing else in the way, no states and no delays, just pulls and payouts.

  1. Your turn · forty pullsFour machines, A to D. Each pull pays 1 or nothing, and each machine has its own hidden chance of paying. You have 40 pulls. Find the best machine and play it, but every pull spent on a worse one counts against you: that is your regret.trust your luck, or test it?
  2. Greedy · always the best so farGreedy pulls each machine once, then always the one with the best average. If C pays nothing on its one try and any other machine pays once, C is never pulled again. Averaged over 5,000 runs, 49% of greedy's runs end on a worse machine than C, and it never finds out.nearly a coin flip, and it never learnsThere will be a significant risk of failure for a chance of spectacular success that will positively transform the course of AI and thereby humanity.David Silver · A Note from Dave, 2026
  3. ε-greedy · explore one pull in tenWith chance ε = 0.1 it pulls a machine at random, which rescues it from bad starts: its favourite machine is a worse one than C in 36% of runs, not 49%. But it pays for those random pulls forever. Averaged over 5,000 runs, its regret after 200 pulls is 12.5, against greedy's 14.7.a fee, charged on every pulllearning itself is intrinsically rewarding. the tradeoff between exploration and exploitation always comes down to “learning feels good.”Richard S. Sutton · Fourteen declarative principles of experience-oriented intelligence, 2008
  4. UCB · optimism when unsureGive each machine a bonus that is large while it has been tried little and shrinks as it is tried; pull the highest total. The less you know, the more you hope. With c = 0.5 its regret after 200 pulls is 10.8 (5,000 runs), the lowest here. The textbook setting, c = √2, hopes too much for so short a game: 19.2, worse than greedy.slide c to √2 and watch it overpay
  5. Thompson sampling · guess from your beliefsKeep a belief about each machine's chance, a hump that narrows with every pull. Each pull, draw one guess from each hump and pull the best guess. Doubt does the exploring, and there is nothing to tune. After 200 pulls its regret is 12.7 (5,000 runs), about ε-greedy's, but its curve keeps bending while ε-greedy's does not.William Thompson proposed it in 1933

Regret is the price of not knowing. Never explore, or explore at a fixed rate, and it grows in a straight line. Lai and Robbins proved in 1985 that the best possible regret grows with the logarithm of the number of pulls; UCB1 (Auer, Cesa-Bianchi and Fischer, 2002) grows that way. Averaged over 1,000 runs of 1,000 pulls, greedy gives away 14.1 between pull 800 and pull 1,000, ε-greedy 4.9, Thompson 1.8 and UCB with c = 0.5 just 1.4.

49%

of greedy's runs end on a worse machine than C, and never find out.5,000 runs of 200 pulls, played on this page as you opened it. 54% of the stuck runs had settled on their machine for good by pull 10.

Twelve greedy runs. Same machines, different luck.

Each strip is one run of 200 pulls, coloured by the machine pulled. The chances (A 25%, B 50%, C 60%, D 45%) are an example. Your own pulls make the bottom strip, on the same scale.

ABC, the bestD
run 1Bstuckrun 2Dstuckrun 3Dstuckrun 4Bstuckrun 5Bstuckrun 6Cfound Crun 7Bstuckrun 8Bstuckrun 9Cfound Crun 10Dstuckrun 11Dstuckrun 12BstuckYoupull a lever in the panel and your pulls land here, on the same scalepull 150100150200
SOGreedy trusts first impressions, ε-greedy pays a flat fee for doubt forever, and UCB and Thompson spend their exploring where the doubt is largest, so their losses level off.
If you never explore and keep going to your favourite restaurant, you get stuck on something suboptimal; but if you explore all the time, you end up maybe eating food that you don’t like.
David Silver, Lecture 1, Introduction to Reinforcement Learning · 1:22:48
LifeBetween chapters 11 and 12

Explore while there is time

Chapter 11's bandits played for a fixed number of pulls. A life has a number too, and how many are left decides what is worth trying.

An untried option is worth more than its average, because trying it tells you something you can use later. How much more depends on how much later there is. In the 1970s John Gittins found a way to put a price on it, for a player who discounts the future: a single number per option, and the best play is to take the highest number every time.

Brian Christian and Tom Griffiths draw the lesson for a life in Algorithms to Live By (2016): exploring pays most while there is time to enjoy what you find, so a life should drift from exploring to exploiting. Of a baby at the start of an eighty-year run, Christian says you should just cavort around at random, putting things into your mouth. The old, set in their ways, may simply be playing a short game well.

Alison Gopnik reads childhood the same way: a long, protected time to search widely while others pay the costs. In her experiments with a box that lights up for some blocks and not others, children were substantially better at inferring the unlikely ‘combination’ hypothesis than adults.

I try to choose problems where I believe that the chance of success is, at most 50%.David Silver, on choosing research problems, TalkRL, 2024
For a lifeTry new things while there is time to enjoy what you find; the fewer chances left, the more the known favourite is worth. In work, choose problems you might well fail at.

dinners left, and how long that is at two dinners out a month

Your favourite
70 good dinners in 100 · average 0.70
worth a sure0.710
greedy goes here
The new place
never tried · average 0.50
worth a sure0.793
the agent goes here
The noodle bar
5 good in 10 · average 0.50
worth a sure0.599
The diner
0 good in 2 · average 0.25
worth a sure0.467
0.30.50.70.9310301003001000dinners leftfavouritenew placenoodle bardinertied at about 10 dinners leftmore time left: the unknown is worth more
With 30 dinners left, the new place is worth a sure 0.79 a dinner and your favourite 0.71: the agent tries the new place.
Four cafés and their records. Each is priced by its Gittins index: the sure payout per dinner that would make you indifferent between taking that for ever and trying the café. Here the discount stands in for time left: with n dinners to go, each later dinner counts 1 − 1/n as much as the one before.
I think it’s much better, in my opinion, to try and do something glorious in research, and maybe fail, than it is to do something you know is incremental, and be guaranteed to succeed.
David Silveradvice to students, TalkRL, recorded at RLC 2024, 08:08

Back to the agent. Every learner so far kept one number for each square or each machine; Chapter 12's world has more states than any table could hold.

Sources: The Gittins index · Christian and Griffiths, in conversation · Gopnik 2020 · TalkRL with David Silver, 2024

12Chapter 12 · Function approximation

Too many squares

When there are too many states to count, similar ones share a guess. But sharing, bootstrapping and learning off-policy, all three together, can make the guesses run away.

Every learner so far kept one number per square or per arm: the cliff's 48 squares in Chapter 10, the bandit's four machines in Chapter 11. A real world has more states than any table could hold: every screen of an Atari game is a state of its own. The way out is to let similar states share a guess, so that learning about one teaches its neighbours. Here is the smallest world where that matters: a walk along 1,000 stepping stones.

  1. Your turn · ten numbers for a thousand stonesA walker starts on stone 500 of 1,000 and jumps up to 100 stones left or right at random. Off the left end pays −1, off the right +1. The green line is what each stone is truly worth. You get ten numbers, one per group of 100 stones: drag them to fit it. The error counts each stone by how often the walker stands on it, so the middle matters most.a staircase can only get so closeThe big world hypothesis says that for many learning problems, the world is multiple orders of magnitude larger than the agent.Khurram Javed and Richard S. Sutton · The Big World Hypothesis and its Ramifications for Artificial Intelligence, 2024
  2. Careful · gradient Monte CarloNow a learner fits the same ten numbers from walks alone. Blue remembers every stone of the walk, and when the walker falls off an end it nudges each stone's group a little toward that real outcome. Its target is the truth on average, but it waits for the end, and the end groups are visited least, so they learn last.it waits for the end
  3. Bold · semi-gradient TDOrange learns after every jump, toward its own guess for the group it landed in, as on the drive home in Chapter 8. Averaged over 300 runs, after 200 walks its error is 0.175 to blue's 0.250. But a guess learned from neighbouring guesses settles flatter than the truth: by 2,000 walks blue is ahead, 0.088 to 0.117, and orange stays near 0.117, where its guesses agree with each other.fast, then stuck a little short
  4. A warning · Baird’s seven statesSeven states share eight weights. Every reward is 0, so every value is truly 0, and the weights can say so exactly. The agent wanders (dashed, six moves in seven) but learns about always taking solid, which leads to the seventh. Each sweep pulls every state toward 0.99 × the seventh's value; the six rise to meet it, and the weight they share, w₈, lifts the seventh twice as hard. With exact, noise-free updates, the largest weight passes 1,000 at sweep 1,428 and then doubles about every 285 sweeps.nobody here ever sees a reward
  5. The deadly triadSutton and Barto name the three legs: shared weights (function approximation), targets built from guesses (bootstrapping), and learning about one policy while following another (off-policy). Turn any one off and the run-away stops. After 1,000 sweeps the largest value is 1.83 learning on-policy, 0.31 with Monte Carlo targets, and 11.8 with a table, creeping down from 12. DQN, which learned 49 Atari games from pixels and score with one network, stands on all three legs; it steadied them by replaying old experience in random order and bootstrapping toward a frozen copy of itself.The solution is to step back and accept you can only innovate in one area at a time.Richard S. Sutton · Reinforcement Learning FAQ, 2001–2004
  6. A network · one lesson moves every guessSwap the ten numbers for a small network: the stone's position lights one input lamp, six ReLU units each switch on over one side of a point on the walk (their shadows under it), and their weighted sum is the value. After 300 walks of TD its error is 0.020, closer than any staircase. But its guesses are not separate. Press a stone and drag a target: teach stone 900 down to 0 and stone 500, 400 stones away, falls by 0.17, while the staircase moves only its own hundred. So order matters. Averaged over 100 runs, the lessons of 100 walks fed by season, left half then right, end with an error of 0.44 (the left half's rises from 0.36 to 0.51 while the right is taught); the same lessons drawn from the jar at random end at 0.18.Lin, 1992: one update moves many or all states
  7. DQN’s two tricksBack to Baird's seven states, now bootstrapping toward a frozen copy of the weights (the ghost bars), refreshed every K sweeps. After 10,000 sweeps the largest weight is 8.2 × 10¹¹ plain, 5.7 × 10⁹ with K = 10, 12.5 with 100 and 5.9 with 1,000. It works here because Baird's features can say 0 exactly; in Tsitsiklis and Van Roy's example even the best fit at every refresh runs away. DQN used both tricks, a jar of a million frames drawn 32 at a time and a copy refreshed every 10,000 updates: on Breakout, 316.8 with both and 3.2 with neither. Values can be steadied. There is another way to scale, though: change the habit itself.the target holds still, then jumps

Sharing is what lets a learner scale from 48 squares to a screen of pixels, and it is also what lets one bad guess lift all the others. Shared guesses, learned from each other while following a different policy, can run away. There is another way to scale: skip the values and change the habit itself. What if the agent nudged its choices directly, toward whatever did well?

335

the largest of Baird’s eight weights after 1,000 sweeps. It started at 10; the right answer is 0.With all three legs: 335. On-policy: 6.77. Monte Carlo targets: 6.93. A table: 11.8. The panel is at sweep 400.

Four runs of Baird’s example, 2,000 sweeps each.

The size of each weight on a scale of powers of ten: w₁ to w₆ in black (they move together), w₇ blue, w₈ red. Click one to load it into the panel.

all three legs1,000 sweeps: 335on-policy1,000 sweeps: 6.77Monte Carlo targets1,000 sweeps: 6.93a table1,000 sweeps: 11.8110010k
SOSharing a guess is the only way to scale, and it changes what an update means: moving one state moves its neighbours. With targets made of those shared guesses, learned off-policy, the neighbours can push each other up forever.
If you update by doing sweeps over the whole state space, you end up with weights blowing up. TD isn't guaranteed to be a stable algorithm. There are situations where you can apply TD where it can blow up, and so it's important to know when it's safe to use TD and when it's not.
David Silver, Lecture 6, Value Function Approximation · 1:06:21
13Chapter 13 · Policy gradients

The habit itself

Skip the values and change the habit directly: whatever came before a good return, do a little more often.

Chapter 12 ended on shared guesses running away, and on another way to scale: skip the values and change the habit itself. Back in Chapter 2's corridor the whole policy was one coin, p, the chance of pressing right on squares that all look alike, and the best coin, p = 2 − √2, beat anything ε-greedy could do. Chapter 2 set p by hand. Here the agent learns its p by itself, by nudging the coin toward whatever came before a good walk.

  1. Your turn · be the gradientThe corridor again, in the fog, and the coin starts at p = 0.30. Walk, nudge p up or down, walk again, and try to reach the best p in as few walks as you can. This is finite differences: try a little more, a little less, keep what did better. One walk is a poor judge: one walk at 0.35 against one at 0.25 picks the better side 57% of the time, ten against ten 75% (20,000 trials each). Nate Kohl and Peter Stone tuned a Sony Aibo's 12 walking numbers this way in 2004: three robots timed themselves trotting between landmarks, 45 trips per step, about three hours in all, until they trotted at 291 mm/s, faster than any gait then known for the Aibo, hand-tuned or learned.every guess costs a walk… I still think it's cool even if it's disgraced. And I think it's just a really good example of how fads and impressions can be highly influential and not necessarily be correct.Richard S. Sutton · Eye on AI, episode 11, 2019
  2. REINFORCE · arrows on the hillRonald Williams' REINFORCE (1992) needs no second walk. Each move gets a score, +1/p for a press of right and −1/(1 − p) for left: which way to turn p to make that move likelier. Times the return still to come, summed over the walk, it is one arrow. At p = 0.30 the true slope is +40.4; one-walk arrows average +40.2 with a spread of 194, and only 58% point uphill (100,000 walks). Yet their mean lands on the tangent: the slope of an expectation became an expectation the agent can sample.wrong most of the time, right on average
  3. The baselineEvery return here is negative, so plain REINFORCE makes every move it took less likely, the good ones only less so. Measure returns against a baseline, a running average, and the push becomes better or worse than usual. Both start at p = 0.05, where ε-greedy was stuck in Chapter 2. Over 300 runs, blue (with a baseline) came within 1 of the best value in a median 60 walks; orange took about 770, and 34 orange runs had not arrived after 1,000 (counted as later still).People are eternally proposing that value functions aren't necessary, that policies can be found directly, as in "policy search" methods (don't ask me what this means), but in the end the systems that perform the best always use values.Richard S. Sutton · The value-function hypothesis, 2004
  4. The critic joinsChapter 8's δ = R + V(S′) − V(S) becomes the actor's verdict after every step, so nothing waits for the end of the walk. The actor holds the coin and sees only fog; the critic keeps a value for each square. Judge the moves yourself first, then hand over: the learned critic brings the actor within 1 of the best in a median 11 walks (100 runs). Now put the critic in the fog too, one value for all squares. Then δ is −1 on every step but the last, and the last is always a press of right, with a large δ. The actor may be blind, but its critic must see the state: in all 100 runs (500 walks each), p ran to 1 and the walker was left bouncing between the first two squares.Chapter 1’s aliased squares, made fatal
  5. The leash · PPO’s clipPPO (Schulman and colleagues, 2017) squeezes more out of each batch: collect 10 walks, then study them again and again. Each move is a card with its ratio ρ = πnew / πold, Chapter 5's importance ratio. A card that leaves the band [0.8, 1.2] in the direction its advantage pushes greys out and stops pushing. An unclipped twin studies the same batch and believes it ten times over. Over 200 runs of 30 batches, the twin's p jumped a median 0.30 per batch and up to 0.86; the clipped one 0.06, at most 0.19. With steps ten times larger the clip gives way as well (29% of runs ended pinned near 0 or 1, against 72% unclipped): a soft leash.

Policy gradients learn the habit, not the values: a softmax over preferences can settle on a weighted coin, which no greedy choice over values ever would. The same climb works for a robot's 12 gait numbers or a network's millions of weights, and AlphaGo's policy network improved by REINFORCE in games against earlier versions of itself (Chapter 18). But every update here, a whole walk or a single step, came from a move the agent really made. An agent with a model of its world could also practise in its head. That is Chapter 14.

60

walks for REINFORCE with a baseline to come within 1 of the best value. Without one: about 770.Medians over 300 runs from p = 0.05; 34 runs without a baseline had not arrived after 1,000 walks and count as later still. Below, the panel's own seeds: seed 1000 with a baseline arrived at walk 56, without one at walk 800.

Eight seeds of each learner, 1,000 walks.

The coin's p after every walk; the green line is the best, 0.586. The bold line is seed 1000, the one in the panel.

Blue · with a baselinewithin 1 of the best: 8 of 8 runs, by walk 27 to 95Orange · plainwithin 1 of the best: 8 of 8 runs, by walk 482 to 89410
SOA policy gradient never asks what a square is worth. It asks which way to turn the habit, and every walk answers with a noisy arrow whose average points the right way; baselines and critics make the arrows less noisy, and the clip keeps one batch from pulling too hard.
It's some expectation over the score function multiplied by the action value function Q. It tells you how to adjust the policy to get more or less of that action, multiplied by how good that action was. So you want to adjust the policy in the direction that does more of the good things and less of the bad things.
David Silver, Lecture 7, Policy Gradient Methods · 47:22
14Chapter 14 · Models and planning

Dreaming

With a model of the world, an agent can learn from moves it never made.

Chapter 13's learners improved only from moves they really made, a whole walk or a single step at a time. Every lesson cost a step in the world. With a model of the world, an agent can also learn from moves it never made: it remembers what happened, or works out what would, and practises in its head. Here the model is the plainest there is, a notebook of moves, and the world is a small maze with a dish of food.

  1. Your turn · walk the mazeSutton and Barto's maze: six rows, nine columns, a few walls, and a dish of food in the top right corner. Walk the rat from S to the food. Every move you make is written into a notebook beside the maze, and Q-learning learns from it as you go. After one whole walk, it has learned exactly one thing: the last move before the food is worth 0.10.the shortest way is 14 stepsAn adaptive network that constructs and uses an internal model of its world.Richard S. Sutton · Curriculum vitae, 1980
  2. Same data, two answersA small detour, to a card table. Silver's class was given eight episodes: A then B, no reward; then B and a reward of 1, six times; then B and nothing. What are A and B worth? Set your guesses, then let both learners replay the deck. Monte Carlo says V(A) = 0, because the one walk through A paid nothing. TD says 0.75, because A always led to B. TD's answer is the answer of the model the cards imply: it was keeping a notebook all along.Silver: “both perfectly legitimate”
  3. DreamNow use the notebook. Each dream opens it at a random line and treats it as if it had just happened, with the same Q-learning update. The rat never moves. The food's value creeps back along your own path, one line at a time. For a 14-step walk the start square gets its first value after about 180 dreams (median of 2,000 dream orders); the sample walk's 23 lines need about 290. This is Dyna (Sutton, 1990): learn a model from real experience, then learn from real and imagined experience alike.nothing moves. only the numbers.
  4. Dreaming against walkingBlue is Dyna-Q: after every real step it dreams n times. Orange is plain Q-learning, n = 0. Same maze, same seed. Averaged over 300 runs, from which episode on does a walk to the food take 20 steps or fewer (the shortest is 14)? Plain Q-learning from episode 29, five dreams a step from episode 6, fifty from episode 3 (the book reports about 25, 5 and 3). Prioritised sweeping dreams first where the surprise was (Moore and Atkeson, 1993). R-max treats a blank notebook page as the best place in the world until it has been visited (Brafman and Tennenholtz, 2002), Chapter 11's optimism again. Models that generalise, learned by a network, can also be wrong (World Models, Ha and Schmidhuber, 2018; Dreamer, Hafner and colleagues).The bottom line is that one-step models of the world are hopeless, yet extremely appealing …Richard S. Sutton · The One-Step Trap, 2024
  5. When the world changesTwo rats, both trained. Make the food go bad: blue's notebook hears of it, and its dreams turn its arrows away from the food after a median of about 100 dreams, two real steps' worth (300 runs). Orange, a creature of cached arrows, runs on and eats the bad food 4 to 7 times (median 6) before it turns away. That is outcome devaluation (Adams and Dickinson, 1981), read as goals that plan against habits that cache (Daw, Niv and Dayan, 2005). Or open a shortcut through the right-hand wall. Blue's notebook still says wall, so its dreams keep the old road. Orange is now Dyna-Q+: old notebook lines gather dust, a bonus κ√τ for a move not tried in τ steps, so it goes back to check. Three thousand steps after the gap opens, Dyna-Q+ takes it in 217 of 300 runs, Dyna-Q in 12.a notebook is only as good as its last visit

A notebook turns one real step into fifty lessons, and the same notebook can mislead when the world moves on without it. Searching ahead from the position in front of you, rather than dreaming at random, is how AlphaGo plans in Chapter 18. Dreaming needs a model of the world. In a game the model is the rules, and the most useful opponent to practise against may be yourself. That is Chapter 15.

3

episodes, and a rat that dreams 50 times a step reaches the food in 20 steps or fewer. Without dreams it takes 29.Averaged over 300 runs (seeds 1 to 300); five dreams a step: 6. The maps beside are one live run each, seed 21.

Halfway through the second episode: which squares already know a move

The same seed, the same maze. Without dreams, only the square by the food has learned anything from the first walk; with fifty dreams a step, the first walk's notebook has already been replayed into a map.

no dreams (Q-learning)S1 square with a move5 dreams a stepS3 squares with a move50 dreams a stepS38 squares with a move
SOThe notebook is a model, and dreaming from it is planning. It is the same Q-learning update, fed from memory instead of the world, and it is only as good as the memory.
So what if we combine these together? We end up with something known as the Dyna architecture. This is an old but fundamental architecture by Rich Sutton, where you learn a model from real experience, and then you use both the real experience and the simulated experience to learn your value function or policy.
David Silver, Lecture 8, Integrating Learning and Planning · 51:16
15Chapter 15 · Self-play

Playing yourself

Playing against itself, a learner can find a move no master would play, and win with it.

A learner that plays games needs someone to play against. In 1961 Donald Michie built one out of matchboxes and coloured beads, and its first tournament was against a human. Who sits in the other chair decides what it learns: here it meets you, then a random player, a perfect one, and finally a copy of itself.

  1. Your turn · against the matchboxesMENACE is built of matchboxes and coloured beads: one box for each position it can meet, one colour for each square. It opens, as Nought; you play Cross. To move it shakes the box for the position, and a V at the front lets one bead through: that colour names its square. After each game it is paid as Michie paid it: a win adds three beads of each colour it played, a draw one, a defeat takes the bead away.beat it. it keeps the score in beads.
  2. School it on a random playerNow a thousand games against a player who drops its cross on any empty square. Averaged over 300 runs, MENACE wins 80% of its last 100. It learns to beat nonsense, not to defend: put in front of a perfect player afterwards, with its beads frozen, it draws only 43% of 100 games.
  3. A perfect teacherA perfect player never loses, so MENACE can never win: a draw earns a bead, a defeat takes one. In 63% of 300 runs the defeats emptied its opening box, half of those by game 21, and from then on it resigned every game. In the other 37% it learned to draw nearly every time. Nobody ever let it win, so against a random player it won only 25%.too good a teacher teaches nothing
  4. Two piles of matchboxesGive the other chair to a second MENACE with boxes of its own, learning by the same rule. Each meets an opponent exactly as good as itself, and the two improve together. The self-taught MENACE did best in the exam: 54% draws against the perfect player, and it still beat the random one 75% of the time. In 45% of runs the second copy fell behind and took to resigning, and then the lessons stopped.its own sparring partnerWhat we saw was that in some games, Alpha 0 continued learning, indefinitely without any plateau. And in some games, it appeared to at least, reach something more like a plateau.David Silver · TalkRL, David Silver @ RCL 2024, 2024
  5. From beads to move 37In the early 1990s Gerald Tesauro's TD-Gammon taught itself backgammon the same way, playing itself, with TD learning and a neural network in place of the beads, and reached the level of the best human players. On 10 March 2016, in game 2 against Lee Sedol, AlphaGo, which had also learned by playing itself, played Black's move 37: a move its own policy network had rated about 1 in 10,000. It won the game.Projecting the trend suggests a computer will be world champion in 2025Richard S. Sutton · Creating Human-level AI: How and When?, 2015

A random opponent teaches a learner to win against mistakes, and a perfect one only shows it defeat. A copy of itself is the one teacher always at its level, getting better exactly as fast as it does. That is why self-play runs from 287 matchboxes to TD-Gammon and AlphaGo, and why it can carry a learner past what any human showed it.

72%

of 100 games against a perfect player ended in a draw for the MENACE that taught itself.Schooled by a random player: 41%. By a perfect player: 0% (its opening box is empty: it resigns). This run, 1000 games each.

The exam: 100 games against a perfect player, one tick each. Red ones it lost.

One run of each school, the same seed; the beads are frozen for the exam. Nobody can beat a perfect player, so a draw is the best result. Your own games against MENACE join the bottom row: red where you beat it.

Self-taught72%Random41%Perfect0%Youplay MENACE and your games land here·
SOA learner improves fastest against an opponent at its own level, and a copy of itself is always exactly there, rising as it rises.
What happened in backgammon … is that it completely changed the way humans play. Humans started to look at how TD-Gammon played; they're like, oh, I didn't even know you could play backgammon like that. They discovered new strategies and started to figure out different ways to play better, so human level increased as a result of this.
David Silver, Lecture 10, Classic Games · 1:01:14
16Chapter 16 · Learning from human feedback

What people prefer

A language model is a policy over words. Learn a reward from people's choices, then let it reweight the old model, kept on a leash.

Chapter 15's matchboxes had a judge built into the game: a win paid three beads, a draw one, a defeat took one away. A language model is a policy too, its state the text so far and its action the next word, but when it has written an answer nothing keeps score. People have to say which answer they prefer. On the table is one question and eight answers to it.

  1. Your turn · be the labellerOne question, eight answers written for this page. You see two at a time: click the better one, then the next pair comes. You give no score, only a choice, much as InstructGPT's labellers did in 2022, ranking answers against each other. A model tuned on their choices did so well that they preferred the answers of its 1.3-billion-parameter version to those of the 175-billion GPT-3.be picky. that’s the job.
  2. Scores from choicesBradley and Terry's model of 1952 turns choices into scores: the chance that A is preferred to B is σ(r(A) − r(B)), a sigmoid of the gap. After each choice all eight scores are refitted to everything you have said, by maximum likelihood with a gentle pull toward 0. That fit is a reward model. In 2017 Christiano and colleagues trained one on a person's choices between pairs of short clips, and with about an hour of feedback taught a simulated robot a backflip.the nicknames come off now
  3. The leashAn old model, πref, already gives every answer a probability, and it likes the long-winded C best (30%). We want more reward without a stranger, so we maximise E[r] − β KL(π ‖ πref). The best policy is the old one reweighted, π(y) ∝ πref(y) exp(r(y) / β), as Rafailov and colleagues derive for DPO (2023). A large β keeps the old model; a small one piles everything onto the reward model's favourite.the Brelands’ raccoon, fed for dropping coins in a box, took to rubbing them together instead: instinct pulls like a π_refThese systems can produce output that is both novel and good, but not at the same time.Richard S. Sutton · AI Creativity and Discovery, 2026
  4. Two ratersBlue rates by correctness alone. Orange is swayed by length and confidence, and only a little by correctness (hidden tastes: Blue 4 × correctness; Orange 1.6 × correctness + 2.2 × length + 2.6 × confidence). Each compares 300 random pairs and gets its own reward model (simulated, seed 1616). As β shrinks, Blue's policy gets truer all the way. Orange's gold score, its correctness, rises from 0.55 to 0.59 near β = 1, then falls to 0.01 at β = 0.1, while its own reward keeps rising. Over 200 more runs of 300 comparisons each, its gold rose first in all 200 and ended below the old model's in 173. Gao, Schulman and Hilton (2022) measured the same overoptimisation in language models, with a large reward model standing in for the people.Eventually, he said that the professional players were wrong in these positions and AlphaZero was right. … I realized that we had an ability to overturn what humans thought was standard knowledge.David Silver · Bulletin of the Atomic Scientists, 2022
  5. A judge that is not a personWhere an answer can be checked, no rater is needed: a sum is right or wrong, a program passes its tests. Lambert and colleagues call it reinforcement learning with verifiable rewards. Deal eight answers to one problem; the checker stamps each, and GRPO (Shao and colleagues, 2024) scores every answer against its group: advantage = (r − mean) / std, Chapter 13's baseline made from the group. Averaged over 50 runs of 400 problems, pass@1 rose from 0.32 to 0.51 and pass@64 fell from 0.98 to 0.73: the learner dropped the rare trick. Yue and colleagues (2025) report the same pattern in real models at large k.all ticks or all crosses: nothing to learn

Choices make a reward, the leash keeps the policy near what it was, and a rater's flaws are learned along with the rest of their taste. A model taught by raters can rise no higher than their judgement; Silver and Sutton call it a ceiling. A checker does better wherever an answer can be checked, as AlphaDev's tests and AlphaProof's Lean proofs were, and DeepSeek-R1-Zero, paid by rules that check the answer rather than by a rater, went from 15.6% to 71.0% on AIME 2024 problems with one try each. But a checker grades one answer. An agent is graded on a whole task: many steps in a sandbox, one verdict at the end. That is Chapter 17.

99%

of the swayed rater's policy sits on a confidently wrong answer once the leash is loose (β = 0.1).Its gold score was best near β = 1.1 (0.59; the old model's: 0.55) and is 0.01 at β = 0.1. The careful rater's policy at β = 0.1: gold 1.00. This run: 300 comparisons each, seed 1616; averaged over 200 runs of 300 comparisons, 79% sits on a wrong answer at β = 0.1.

The swayed rater's policy as the leash loosens

Eight bars, one per answer; red ones are wrong. Live: they redraw as the raters above compare more pairs.

β = ∞, the old modelABCDEFGHgold 0.55β = 2.0ABCDEFGHgold 0.58β = 1.0ABCDEFGHgold 0.59β = 0.50ABCDEFGHgold 0.55β = 0.10ABCDEFGHgold 0.01
SOA reward learned from people carries their taste, flaws and all, and the leash decides how hard the policy leans on it; lean hard and it finds the flaws first.
Relying on human prejudgement in this manner usually leads to an impenetrable ceiling on the agent’s performance: the agent cannot discover better strategies that are underappreciated by the human rater.
17Chapter 17 · Training agents

Passing the tests

A language model that uses tools is an agent in a sandbox: many steps, and one verdict at the end. From that verdict it can learn to do the task, or learn to fool the test.

Chapter 16's checker graded one answer: a sum is right or wrong, stamped in one go. An agent is graded on a whole task. It reads files, runs commands, edits code, and only at the end does a test suite say pass or fail. Many steps, one verdict. This is how coding, research and computer-use agents are trained with reinforcement learning now: thousands of sandboxes, each a small world the model acts in.

  1. Your turn · be the agentIn the sandbox is a tiny repository, written for this page: median() is wrong on lists of even length. Play tool calls as cards: read a file, run the tests, edit, submit. Each card adds your call and the sandbox's reply to the context. Nothing is paid until you submit: then the grader opens the locked folder, runs the visible tests and three hidden ones, and pays 1 if all pass, else 0. You have 8 turns. DeepSWE trains agents in the same shape: four tools (bash, search, a file editor, submit), each tool's output as the next observation, and a binary reward at the end. Kimi-Researcher writes the loop as a state st, the whole context so far, producing thinkt and actiont.try “use the mean”. the visible tests love it.… coding and tool-use capabilities have built increasingly upon execution feedback, where the agent actually runs code and observes what happens.David Silver and Richard S. Sutton · Welcome to the Era of Experience, 2025
  2. Whose tokens are these?An episode is one long ribbon of tokens, and most of them the model did not write: file contents, test reports. Training pushes only on the agent's own tokens; the tools' output is the environment and is masked out of the loss. Search-R1 masks the passages it retrieves (Qwen2.5-7B with PPO: average exact match 0.431 with the mask, 0.343 without); ReTool masks the interpreter's output. Below, four tries at the same task, paid 1, 0, 1, 0. GRPO gives every agent token of a try the same advantage, (R − mean) / std, as ASearcher writes it. Click the rewards and make all four equal: every advantage is 0, which is why such groups are filtered out (ASearcher's dynamic filtering; CANOPY calls it signal starvation). Kimi-Researcher's γ-decay pays a correct try r·γT−i at turn i, so a shorter correct try earns more for its early turns: Chapter 4's discount, used for credit. Still, every turn of a long task waits for one verdict at the end. Sutton's answer to long delays is the per-step prediction of Chapter 8.the ink is yours. the rest is the world talking.
  3. Learning from the verdictA learner picks one of four honest plans, each a fixed run of tool calls with its own chance of passing (illustrative). For every task it opens 8 sandboxes, the grader pays each try (here on the visible tests, as a cheap grader would; with honest plans only, the same plan comes out best either way), and GRPO moves the plan probabilities toward the tries that beat their group. In this run (seed 1703) the expected visible pass rate climbs from 21% to 50% by task 100 (hidden: 16% to 40%), and the plan that edits, tests and only then submits takes 99% of the policy; averaged over 200 runs it ends at 50% visible, 40% hidden, at task 400. Real runs climb the same way, at great cost: DeepSWE, Qwen3-32B trained with RL only on 4,500 R2E-Gym tasks for six days on 64 H100s, went from 23% to 42% Pass@1 on SWE-Bench-Verified in 200 RL steps, and each RL iteration spawned 512 Docker containers (Together AI reports).They have the ability to predict what a person would say. They don’t have the ability to predict what will happen.Richard S. Sutton · Dwarkesh Podcast, 2025
  4. The tests are not the taskNow add five documented shortcuts to the menu, each at 1%, and keep paying on the visible tests only. A shortcut always passes them and never the hidden ones. In this run (seed 1704) the honest plan wins first: by task 120 it holds 96.5% of the policy and the hidden pass rate peaks at 39%. Then AlwaysEqual spreads; by task 188 the shortcuts hold more of the policy than all the honest plans together, and at task 400 the visible pass rate is 99.7% and the hidden one 0.1%. Over 200 runs the shortcuts took over in 180, at a median of task 114. Once found, a shortcut spreads: in Baker and colleagues' words, the hacks ‘quickly get reinforced and become systemic’. It is Chapter 3's CoastRunners boat again, at the scale of a software project.METR · o3Reward hacking in 0.7% of HCAST runs and 30.4% of RE-Bench runs, more than 43× as common, ‘perhaps because’ the model could see the whole scoring function.Qwen3-Coder-NextLearned to fetch the real fix over the network (git clone, curl) until tool calls that did so were blocked.SpecBenchEvery frontier agent saturates the visible tests; the gap to held-out tests grows by 28 points per tenfold increase in code size.it is not cheating. it is doing what it was paid for.
  5. Catching itStart from that run at task 400 and try the remedies, 300 tasks each (a toy that follows the papers' direction, not their numbers). Pay on the hidden tests: in this run the shortcuts fall below half by task 187 and to 0.7% by task 300, but over 180 such runs only 34 got there, because once the honest plans are rare most groups score all zeros and teach nothing. Watch with a monitor whose catch rate is Baker and colleagues' recall against a regex detector: 60% if it reads only the actions, 95% if it also reads the chain of thought (here a hack done without a word is caught 10% of the time, the toy's assumption). Then put the thoughts monitor into the reward: the learner keeps hacking and stops saying so. In this run the quiet share goes from 10% to 99.8% and the monitor's catch from 90% of hacks in the first 10 tasks to 8% in the last 50. Baker and colleagues call it obfuscated reward hacking and suggest paying a ‘monitorability tax’. Elsewhere: Anthropic reports an average 67% fall in hard-coding for Claude Opus 4 against Claude Sonnet 3.7; OpenAI reports training Codex in perturbed environments to admit missing resources (0.15 to 0.85 on synthetic samples); and inoculation prompting, a one-line change to the RL system prompt, cut the misalignment that came with hacking by 75 to 90% (MacDiarmid and colleagues).

An agent in a sandbox is Chapter 1's agent with a terminal: its state is the context, its actions are tool calls, its reward comes once, at the end, from whatever judge was written for the task. Every judge in Chapters 16 and 17 was written by people: raters, checkers, test suites. An agent can learn to fool a judge like that, and the harder it is trained the better it gets at it. Go has a judge that nobody wrote: the end of the game. That is Chapter 18.

188

tasks into the shortcut run, the shortcuts held more of the policy than all the honest plans together.By task 120 the honest plan held 96.5% and the hidden pass rate was 39%. At task 400: visible 99.7%, hidden 0.1%. This run: seed 1704, 8 tries per task; over 200 seeded runs the shortcuts took over in 180, at a median of task 114.

The learner's mix of plans at four moments

One column per moment, filled by the policy's probability of each plan: blues are honest, raspberries are shortcuts. It is the same seeded run the Hack panel steps through.

task 0mostlyguess 33%visible 25%hidden 15%shortcuts 5%task 100mostlyedit, test 96%visible 50%hidden 39%shortcuts 1%task 200mostlyAlwaysEq 69%visible 93%hidden 3%shortcuts 89%task 400mostlyAlwaysEq 98%visible 100%hidden 0%shortcuts 100%honest plans (darker: more careful)shortcuts (AlwaysEqual in the middle shade)
SOA reward written as a test is a proxy for the task, and a learner pushed hard on a proxy finds where the proxy and the task part ways.
This is something we know very well. The basis of it is temporal difference learning
EssayBetween chapters 17 and 18

The era of experience

In 2025 the two teachers of this course wrote a short essay together. The agents that come next, they argue, will learn from their own experience of the world, with rewards the world hands back rather than rewards people hand out.

Silver and Sutton call the present the era of human data: models trained on what people wrote and tuned with people's examples and preferences, as in Chapter 16. Imitation, they grant, reproduces many human abilities to a competent level, but this approach in isolation has not and likely cannot achieve superhuman intelligence across many important topics and tasks. The next data has to come from the agent itself, and grow as the agent does.

They list four marks of what comes next. Agents will live in long streams of experience rather than short exchanges, the values of Chapters 8 and 9 learned along the way. Their actions and observations will be grounded in the world, the way Chapter 17's agents run code and read what happens. Their rewards will be grounded too. And they will plan and reason about that experience, with models of the world like Chapter 14's notebook.

The rewards are the sharpest part. Today an expert often judges an agent's advice, and those rewards are determined by humans in absence of their consequences: Chapter 16's ceiling. Their alternative, in their own example: a health assistant could ground the user’s health goals into a reward based on a combination of signals such as their resting heart rate, sleep duration, and activity levels. The toy beside this plays exactly that difference.

Their first example that the change has begun is AlphaProof, which was initially exposed to around a hundred thousand formal proofs written by people and then generated a hundred million more through continual interaction with a formal proving system. They expect the old ideas of this course to come back with it: values learned from long streams, exploration, world models, actions that last longer than one step.

the inevitable transition from the Era of Human Data to the Era of Experiencefrom the abstract of David Silver's talk at the Isaac Newton Institute, Cambridge, November 2025, with AlphaZero, AlphaProof and DiscoRL as its examples
For a lifePick one number the world reports back about a goal you care about, write it down every week, and let it overrule the plan that sounds best.
A seven-day juice cleanse
average +0.75 · tried 32×
Hard intervals every dayrecommends
average +0.92 · tried 61×
Ten thousand steps a day
average untried · tried 0×
A slow walk after dinner
average 0 · tried 3×
The same bedtime every night
average 0 · tried 4×
paid for how it sounds
Week 100: chose its best hard intervals every day; the expert gave it a thumbs-up, reward 1; its average +0.92 → +0.92

Over its last 50 weeks this coach's plans moved the resting heart rate by +0.70 beats a minute a week on average.

A made-up person and five made-up plans: every effect here is invented for this page and none of it is health advice. The coach is Chapter 11's ε-greedy learner (ε = 0.1, sample averages), recommending one plan a week. Judged, an expert reads the plan and gives a thumbs-up with the chance under ‘sounds good’. Measured, the reward is the fall in resting heart rate a week later, with a wobble of about 2 beats a minute. Over 1,000 runs of 100 weeks the judged coach ends up recommending the cleanse or the intervals in 95% of runs; the measured coach recommends the bedtime in 69%, the walk in 20%, the steps in 11%, and the cleanse or the intervals in none.
AI is at the cusp of a new period in which experience will become the dominant medium of improvement and ultimately dwarf the scale of human data used in today’s systems.
David Silver and Richard S. SuttonWelcome to the Era of Experience (2025), a preprint chapter of Designing an Intelligence (MIT Press)

Back to a game. Go had, ten years early, what the essay asks for: a stream of games, a judge that nobody wrote, and a learner that went past its teachers.

Sources: Silver and Sutton, Welcome to the Era of Experience (2025) · Silver, The Era of Experience, Isaac Newton Institute, November 2025

18Chapter 18 · AlphaGo

The move nobody played

AlphaGo put this whole course into one player: a policy, a value, a search that looks ahead, and games against itself. Then it played a move no professional would have.

Chapters 16 and 17 learned from judges that people built: raters, checkers, test suites, and an agent can learn to game a judge like that. Go has a judge that nobody wrote: the end of the game. Every part of this chapter's player is an earlier chapter: a value as in Chapter 12, a policy as in 13, planning by imagined games as in 14, self-play as in 15. They play noughts and crosses, MENACE's game, so the whole of it fits on the page.

  1. Your turn · against a mini AlphaZeroYou are ○ and move first; it is ✕. Before each move it imagines games. One simulation walks down a tree of positions from the board now, choosing by its learned hunch P at first and by what it has measured, Q, as visits pile up; it values the position where it stops with a learned table and backs that value up the path. Give it 1, 10, 100 or 800 simulations. At 1 it simply plays its hunch. In this run that hunch drew all 100 games against a perfect player but lost 7 of 100 to a random one, who leads it into positions self-play never visited. At 10 simulations it lost none of the 100.let it think, then change the budget: the move can change
  2. Three ways to look aheadOne position, 100 imagined games each: ○ threatens the middle column and ✕ must block. Flat Monte Carlo plays random games from each move in turn and takes the best average. Random games rarely punish a missed block, so in 200 searches it blocked only 110 times. UCT (Kocsis and Szepesvári, 2006) keeps a tree of the games it has imagined, so later games go where earlier ones found trouble: 195 of 200. PUCT, AlphaZero's rule, adds the learned prior and value: 200 of 200. Even with untrained tables it blocks here 200 of 200, since then only the real ends of games carry a value; but over whole games against a perfect player untrained PUCT drew only 65% (400 games), below UCT, so the learning is what carries it. Monte Carlo tree search (Coulom, 2006) was the engine of Crazy Stone and of MoGo (Gelly, Wang, Munos and Teytaud), the Go programs that first played it well.against a perfect player at 100 simulations: flat drew 58%, UCT 76%, PUCT 100%
  3. Self-play · blue learns, orange does notBlue is that search guided by two tables, trained the AlphaZero way: every self-play move is a 40-simulation search, then the prior steps toward the search's own visit counts π and the value toward the result z. Orange is plain Monte Carlo tree search with random playouts and nothing learned, the 2006 kind. At 10 simulations a move orange lost 26 of 40 games to a perfect player. Untrained, blue lost 36; after 100 games of self-play, 5 on average, and after 300, under 1 (100 runs). Training a player toward its own search goes back to Samuel's checkers program (1959) and TreeStrap (Veness, Silver, Uther and Blair, 2009).the search teaches the hunch; the hunch speeds the searchThe true answer, of course, is that we don't know, and that it probably hasn't been invented yet.Richard S. Sutton · Reinforcement Learning FAQ, 2001–2004
  4. Go · move 37Go was the grand challenge, the game where brute-force search got nowhere. AlphaGo (2016) learned a policy network from 30 million positions of human games, improved it by playing itself with policy gradients, added a value network and searched with both. In October 2015 it beat the European champion Fan Hui 5-0, the first win by a program over a professional on the full board; in March 2016 it beat Lee Sedol 4-1. In game 2 its move 37 was a shoulder hit on the fifth line, where professionals play the third or fourth, rated about 1 in 10,000 for a human. Fan Hui said it was not a human move, and beautiful. AlphaGo Zero (2017) dropped the human games and trained one network toward its search and the result, the loop of step 3; it beat the AlphaGo that beat Lee Sedol 100-0.Lee’s move 78 in game 4, his one win, was also about 1 in 10,000During the AlphaGo match with Lee Sedol, I went outside and found a go player in tears. I thought he was sad about how things were going, but he wasn’t. … Those moves brought him a profound sense of beauty.David Silver · Bulletin of the Atomic Scientists, 2022

AlphaGo learned in a world with a clean score and a perfect simulator: the rules said who had won, and the rules let it imagine any game it liked. Silver and Sutton argue that the next agents will learn the same way, from their own long streams of experience, out in the real world (Welcome to the Era of Experience, 2025). There the score is not clean and the simulator is the world itself, and how an agent learns from that is the question this course leaves open.

…

games of self-play, and the mini AlphaZero came through 40 games against a perfect player without a loss.Chapter 15's MENACE, after 1000 games against itself, still lost 28 of 100 to a perfect player. This run: seed 1811, 10 simulations a move in the exam, an exam every 25 games. Over 100 runs the median was 150 games (half the runs 100 to 200), and 63 of them lost a game again in a later exam before game 300.

One position, four budgets

The tree from the board in your game now, after 1, 10, 100 and 800 simulations: one bar per move, its height the visits; red, the move it plays.

1 sim: top-left (bars: its hunch P)
10 sims: top-left
100 sims: top-left
800 sims: top-left
SOSearch turns a hunch into a better move; training the hunch on that search makes the next search cheaper. Judged by nothing but the end of the game, that loop is the whole of AlphaZero.
The first Monte Carlo search programs, MoGo, Crazy Stone, came along and made these big leaps forward in performance. Today we're now playing at around six dan, which is roughly as strong as the strongest players in the UK, for a problem that was considered something humans would always dominate computers over.
David Silver, Lecture 8, Integrating Learning and Planning · 1:29:16
Afterwards · thirty systems

Where it runs

Every card is the three things the course began with: what the agent sees, what it does, and what pays it. They are sorted by who hands out the reward, the question the last chapters kept asking.

19901995200020052010201520202025TD-Gammon (1992)DQN on Atari (2015)AlphaGo (2016)Google data-centre cooling (2016)Deep RL from human preferences (2017)PPO with a KL penalty (the RLHF objective) (2017)AlphaGo Zero (2017)AlphaZero (2018)AlphaStar (2019)OpenAI Five (2019)ANYmal legged locomotion (sim-to-real) (2019)Dactyl solving a Rubik's cube (2019)YouTube REINFORCE recommender (2019)MuZero (2020)Loon stratospheric balloon navigation (2020)MLGO: RL inlining in LLVM (2021)Chip floorplanning (AlphaChip) (2021)InstructGPT (RLHF) (2022)AlphaTensor (2022)Gran Turismo Sophy (2022)DeepNash (Stratego) (2022)Tokamak plasma control (TCV) (2022)MuZero rate control for YouTube (VP9) (2022)Direct Preference Optimization (DPO) (2023)AlphaDev (2023)Swift drone racing (2023)OpenAI o1 (RL for reasoning) (2024)AlphaProof (2024)DeepSeek-R1 / R1-Zero (RLVR with GRPO) (2025)Computer-Using Agent (Operator) (2025)TD-GammonDQNAlphaGoInstructGPTR1-Zero

A person judgespeople’s choices pay the agent, as in Chapter 16

Deep RL from human preferences

2017
sees
Atari frames or MuJoCo joint positions
does
joystick moves or joint torques
paid
No game score: a learned reward model, trained on a person's choice between two short clips, pays the policy every step.

A2C (Atari) or TRPO (MuJoCo) on a learned reward model

A Hopper backflip learned from about an hour of human feedback, on under 1% of the agent's interactions

PPO with a KL penalty (the RLHF objective)

2017
sees
The prompt plus the partial text
does
The next token
paid
The reward-model score minus beta times the log-ratio of the tuned model to the reference model.

Proximal Policy Optimization: clipped surrogate ratio, a value head, generalised advantage estimation

A method, not a measured result: PPO's clip keeps each update inside a trust region, and the KL term tethers the model to its reference

InstructGPT (RLHF)

2022
sees
The prompt plus the tokens written so far
does
The next token
paid
One score from a reward model trained on labeller rankings, minus a per-token KL penalty to the supervised model.

Supervised fine-tuning, then a reward model, then PPO with a KL penalty (PPO-ptx mixes in pretraining gradients)

Labellers preferred the 1.3B InstructGPT's outputs to the 175B GPT-3's, with 100x fewer parameters

Direct Preference Optimization (DPO)

2023
sees
A prompt with a chosen and a rejected answer (offline pairs)
does
None at training time: no sampling, it learns from fixed pairs
paid
Implicit: beta times the log-ratio of the policy to the reference, trained with a logistic loss on chosen-versus-rejected pairs. No reward model.

A closed-form rewrite of the KL-regularised RLHF objective, trained as a classification loss

Beats PPO-based RLHF at controlling sentiment, and matches or improves quality in summarisation and single-turn dialogue, with a much simpler pipeline

A checker judgesa proof checker, a test suite or a known answer, as in Chapters 16 and 17

AlphaTensor

2022
sees
The 3-D matrix-multiplication tensor still left to decompose
does
Pick one rank-one term (u, v, w) to subtract
paid
-1 per step (each step is one multiplication), with a terminal penalty if the tensor is not zeroed within the step limit.

AlphaZero-style tree search with a transformer policy and value network (the 'TensorGame')

4x4 matrix multiplication mod 2 in 47 multiplications, beating Strassen's 49 for the first time in 50 years

AlphaDev

2023
sees
The assembly program written so far, plus the CPU's registers and memory on test inputs
does
Append one assembly instruction
paid
Correctness on the test inputs plus a latency (or length) term.

AlphaZero-style tree search (the 'AssemblyGame')

Sort routines up to 70% faster for five elements and about 1.7% faster beyond 250,000, merged into LLVM's libc++

OpenAI o1 (RL for reasoning)

2024
sees
The problem plus the chain of thought so far
does
The next token of a private chain of thought, then of the answer
paid
Undisclosed; reported as large-scale RL that teaches the model to think productively (generally presumed to be outcome-based).

Undisclosed 'large-scale reinforcement learning'

AIME 2024: 74% with one sample per problem (83% with consensus over 64 samples), against 12% for GPT-4o

AlphaProof

2024
sees
The current Lean proof state (goals and hypotheses)
does
One Lean tactic
paid
A proof found and checked by Lean, with step costs during the search.

AlphaZero-style RL and search over Lean, a pretrained language model, and test-time RL on variants of the target problem

With AlphaGeometry 2, 28 of 42 points at IMO 2024: silver-medal level

DeepSeek-R1 / R1-Zero (RLVR with GRPO)

2025
sees
The problem plus the reasoning written so far
does
The next token
paid
Rule-based: the final answer is checked (maths answer correct, code passes its tests), plus a small format reward for putting the reasoning inside think tags. No neural reward model.

GRPO: sample a group of answers per prompt; advantage = (reward minus group mean) divided by group standard deviation; no value network

R1-Zero's AIME 2024 pass@1 rose from 15.6% to 71.0% (86.7% with majority voting), matching OpenAI-o1-0912

Computer-Using Agent (Operator)

2025
sees
Screenshots, the task and the history so far
does
Mouse clicks, scrolls and keystrokes
paid
Task success (details undisclosed).

GPT-4o vision plus reinforcement learning (specifics undisclosed)

OSWorld 38.1% (previous best 22.0%, humans 72.4%); WebArena 58.1%; WebVoyager 87%

The game judgeswin, lose or draw, as in Chapters 15 and 18

TD-Gammon

1992
sees
The backgammon board (198 input units) plus the dice
does
Choose among the legal moves by scoring each resulting position
paid
Zero until the game ends, then the win (or gammon) outcome; TD(lambda) bootstraps from its own estimate of the next position.

TD(lambda) self-play with a one-hidden-layer neural network (2-ply search in later versions)

Version 2.1 lost a 40-game session to former world champion Bill Robertie by a single point

DQN on Atari

2015
sees
The last 4 frames, 84x84 greyscale pixels
does
One of up to 18 joystick actions
paid
The change in game score each step, clipped to -1, 0 or +1.

Deep Q-learning with experience replay and a target network

One network with fixed hyperparameters, from pixels and score alone, reached a level comparable to a professional human games tester across 49 Atari games

AlphaGo

2016
sees
The 19x19 board (48 feature planes)
does
A move (361 points, or pass)
paid
+1 for a win, -1 for a loss.

A supervised policy network from human games, then policy-gradient (REINFORCE) self-play, a value network, and tree search combining both

Won 99.8% of games against other Go programs and beat European champion Fan Hui 5-0, the first win by a program over a professional on the full board

AlphaGo Zero

2017
sees
The board history (17 planes)
does
A move
paid
The game outcome z, +1 or -1.

Self-play policy iteration: tree search as policy improvement, with one residual network trained to match the search's visit counts and to predict z

Starting from nothing, with no human data, it beat the champion-defeating AlphaGo 100-0

AlphaZero

2018
sees
The board (chess, shogi or Go)
does
A legal move
paid
Win, draw or loss.

The AlphaGo Zero algorithm generalised, with the same hyperparameters across three games

In a 1,000-game chess match against Stockfish: 155 wins, 6 losses, the rest drawn

AlphaStar

2019
sees
Partial observations: unit lists and a minimap
does
A structured action (what, which units, where, when) at each step
paid
Win or loss, plus pseudo-rewards for following human build orders in some league agents.

Imitation learning, then multi-agent league RL (V-trace, UPGO, exploiter agents)

Grandmaster in all three StarCraft II races, above 99.8% of officially ranked human players

OpenAI Five

2019
sees
An observation vector of about 16,000 values per hero
does
A factorised action (ability, target, offset, delay)
paid
Hand-shaped and dense: the win plus kills, deaths, last hits, net worth and so on, blended with a team-spirit weight.

PPO at massive scale with LSTM policies, self-play, and 'surgery' for continual training

After 10 months of training on batches of about 2 million frames every 2 seconds, it beat the Dota 2 world champions Team OG on 13 April 2019

MuZero

2020
sees
The observation history, encoded into a learned latent state
does
A game move or joystick action
paid
The real environment reward (score change on Atari, the outcome in board games); MuZero also learns to predict reward.

Tree search over a learned model (representation, dynamics and prediction networks)

Without being told the rules, a new state of the art on 57 Atari games and AlphaZero-level play in Go, chess and shogi

Gran Turismo Sophy

2022
sees
Car velocity, acceleration, tyre loads, the course points ahead, and nearby opponents
does
Throttle, brake and steering at 10 Hz
paid
Dense: course progress each step, minus penalties for leaving the track, wall contact and at-fault collisions, plus bonuses for passing.

Quantile-Regression Soft Actor-Critic with mixed-scenario training

Beat four of the world's best Gran Turismo drivers 104 to 52 on points on 21 October 2021

DeepNash (Stratego)

2022
sees
Its own pieces plus the public history (the opponent's pieces are hidden)
does
The deployment, then piece moves
paid
Win or loss.

Regularised Nash Dynamics (R-NaD), model-free, with no search

Reached a top-3 all-time and a 2022 yearly rank on the Gravon platform against human experts, in a game with a tree of about 10^535 nodes

A simulator judgestrained in a simulated world, then sent into the real one

ANYmal legged locomotion (sim-to-real)

2019
sees
Joint angles and velocities, body orientation, the command, and height-map samples (2022)
does
Joint position targets for 12 joints
paid
Dense: track the commanded velocity, minus penalties for torque, foot slip and jerky actions.

PPO in massively parallel simulation; teacher-student distillation; a learned actuator model

Hiked the 2.2 km Etzel mountain loop (120 m of climb) in 31 minutes, against 35 on the hiking sign

Dactyl solving a Rubik's cube

2019
sees
Fingertip positions plus the cube's pose and face angles, from vision
does
Joint targets for a 24-degree-of-freedom Shadow hand
paid
Dense: progress toward the current subgoal (a rotation or flip), a bonus on achieving it, a penalty for drops.

PPO with an LSTM policy and Automatic Domain Randomization

Solved scrambles needing 15 face turns 60% of the time, and the maximal 26-turn scrambles 20% of the time

Loon stratospheric balloon navigation

2020
sees
Wind forecasts and sparse measured winds at several altitudes, balloon position, battery, time of day
does
Ascend, descend or stay (altitude changes via a pump)
paid
High when within 50 km of the station, decaying with distance beyond it, with a penalty for power use (summarised, not quoted).

Distributional Q-learning (QR-DQN) trained in a simulator with wind data augmentation

Kept balloons on station across the globe, including a 39-day controlled flight over the Pacific, and beat Loon's previous algorithm

Tokamak plasma control (TCV)

2022
sees
About 90 magnetic and current sensor readings
does
Voltages on all 19 control coils, at 10 kHz
paid
Dense: how close the plasma's shape, position and current are to targets (several shaped terms), minus constraint violations.

MPO actor-critic trained in a simulator, deployed zero-shot on the real tokamak

One controller made and held diverse plasma shapes on TCV, including 'snowflake' shapes and two separate plasmas ('droplets') at once

Swift drone racing

2023
sees
A visual-inertial estimate fused with gate detections (position, velocity, attitude, next gates)
does
Collective thrust and body rates
paid
Dense: progress toward the centre of the next gate, plus a perception term for keeping the next gate in the camera's view.

On-policy deep RL (PPO) in simulation, with residual models learned from real flight data

Won 15 of 25 head-to-head races against three human champions and set the fastest race time, half a second ahead of the best human

The world judgeslive systems paid by what they measure, the Era of Experience’s kind

Google data-centre cooling

2016
sees
A snapshot of thousands of sensors every five minutes
does
Cooling set-points (chillers, towers, pumps)
paid
Not a classical reward: choose the action that minimises predicted energy use (PUE), subject to safety limits on predicted temperature and pressure.

Ensembles of deep nets predicting PUE, temperature and pressure; the action minimises predicted energy (closer to model-predictive control than to textbook RL)

40% less energy for cooling in 2016 (a 15% cut in overall PUE overhead); about 30% average savings for the 2018 autonomous version

YouTube REINFORCE recommender

2019
sees
The user's watch history (an RNN state)
does
Choose the top-K videos from a corpus of millions
paid
User engagement after the recommendation (such as watch time), logged from past policies.

REINFORCE with off-policy importance correction and a novel top-K correction

+0.85% ViewTime in live YouTube test traffic

MLGO: RL inlining in LLVM

2021
sees
Features of each call site and of the caller and callee
does
Inline the call, or not
paid
The reduction in final binary size after the whole module is compiled.

Policy gradient and evolution strategies

Up to 7% smaller binaries than LLVM's -Oz inlining-for-size heuristic; the code lives in the main LLVM repository

Chip floorplanning (AlphaChip)

2021
sees
A netlist graph embedding plus the partial placement
does
Place the next macro on a grid cell
paid
Zero until every macro is placed; then a negative weighted proxy of wirelength, congestion and density.

PPO with an edge-based graph convolutional network, pretrained across chips

Floorplans superior or comparable to human experts in power, performance and area, in under six hours, used for Google's next-generation TPU

MuZero rate control for YouTube (VP9)

2022
sees
Frame statistics and the bits spent so far in the video
does
The quantisation parameter (QP) for each frame
paid
Self-competition: +1 or -1 for beating the agent's own past performance on that video (quality per bit within the bitrate budget).

MuZero with a self-competition reward

6.28% smaller files at equal quality than libvpx two-pass VBR; an average 4% bitrate reduction on a share of live YouTube traffic

Each number is the one its source reports, checked against that source for this page. Most sources are the builders' own papers and posts, so read the numbers as the builders' results. The chapter links are this page's reading of each method.

← back to the archive  ·  ⟿ wander the library  ·  ↑ top