About this book
Reinforcement Learning: An Introduction is the founding textbook of a field. Richard Sutton and Andrew Barto published it with MIT Press in 1998, and a much expanded second edition appeared in 2018. Before the first edition, the ideas it collected were scattered across papers in artificial intelligence, psychology, neuroscience, control engineering and operations research. Researchers in each area used different words for related things. The book gave the subject a single vocabulary, a single set of core problems, and a clear account of how the main solution methods relate to one another. For two decades it has been the first thing a newcomer to the field is told to read.
The question the book sets out to answer is how an agent can learn to act well through interaction with its environment, when no one tells it what the right action is. The agent tries things. The environment responds with new situations and with a numerical signal called reward. The agent's aim is to collect as much reward as possible over the long run. It must work out, from experience alone, which actions in which situations lead to more reward later. This sounds simple, but it contains several deep problems at once: actions have delayed consequences, the agent must try unfamiliar actions to learn about them, and the situations it meets may be far too many to remember one by one.
The authors wrote for students and researchers in computer science and engineering, but they made a point of keeping the mathematics light. The first edition assumed little beyond elementary probability and some comfort with equations. The book explains ideas through small worked examples, such as a game of tic-tac-toe, a gridworld in which an agent walks between squares, a car trying to climb a hill too steep for its engine, and a gambler betting on coin flips. These examples are chosen to isolate one difficulty at a time, so that the reader can see exactly what each method solves.
The book was written at a particular moment. In the early 1990s Gerald Tesauro at IBM had built a backgammon program, TD-Gammon, that learned by playing against itself and reached the level of strong human players. Christopher Watkins had introduced Q-learning in his doctoral thesis in 1989. Researchers had begun to see links between these algorithms and the classical theory of optimal control and dynamic programming. Sutton and Barto's book drew these threads together and showed that they formed a coherent field. Two decades later, when programs that learned to play Atari video games and the board game Go brought reinforcement learning into public view, the vocabulary and methods they used were largely the ones this book had laid out.
It is worth being clear about what the book is not. It is not a manual for deep reinforcement learning with code for the latest algorithms, and it does not survey every application. It is an account of foundations, written so that the reader understands why methods work and how they relate, and can then read the research literature with judgement.
The authors have made the text, including the second edition, freely available online in addition to the printed book. That decision has made it one of the most widely read technical books in computing.
The authors
Andrew Barto
Andrew Barto spent most of his career at the University of Massachusetts Amherst, where he became a professor of computer science and co-directed a laboratory devoted to adaptive networks and learning. He came to computing with a background that included mathematics and an interest in how biological systems adapt. In the late 1970s he joined a project at Amherst to investigate an idea proposed by A. Harry Klopf, a researcher who had argued that neurons might behave like small goal-seeking agents, each trying to maximise a kind of pleasure signal. That idea, that adaptive behaviour might arise from many simple units each seeking reward, set the direction of Barto's work. He is now professor emeritus.
Richard Sutton
Richard Sutton studied psychology as an undergraduate at Stanford before moving into computer science. He came to Amherst as a doctoral student and wrote his dissertation under Barto, completing it in 1984. The thesis addressed the problem of temporal credit assignment, which is the question of how to tell which of many earlier actions deserves the credit or blame for a later outcome. In a 1988 paper he presented temporal-difference learning in a general form, the idea for which he is best known. He later worked at GTE Laboratories and AT&T Labs before joining the University of Alberta in Canada in 2003, where he built one of the leading research groups in the field. He has also worked with the DeepMind research laboratory and with a company pursuing general artificial intelligence.
Sutton is also known for a short essay published in 2019 called The Bitter Lesson. In it he argued that, across the history of AI, general methods that scale with computation, chiefly search and learning, have repeatedly overtaken methods that build in human knowledge about a problem. The essay is not part of this book, but it expresses a conviction that runs through it: that an agent should learn from its own experience rather than depend on what its designers already understand.
Recognition
In 2025 the Association for Computing Machinery announced that Barto and Sutton had received the Turing Award, often described as the highest honour in computer science, for developing the conceptual and algorithmic foundations of reinforcement learning. The award recognised work much of which is set out in this book. Their long partnership, first as teacher and student and then as co-authors, is one of the clearest examples in computing of a field being built by two people working patiently over decades.
The shape of the argument
The book moves from the simplest version of the problem to the hardest, removing one simplification at a time. It begins with a setting in which the agent faces the same situation over and over and must only choose among a fixed set of actions, each with an unknown average payoff. This strips the problem to its core: the tension between trying actions to learn about them and choosing the action that currently looks best. Once that tension is understood, the book introduces situations that change in response to actions, so that the agent must think about the future. It formalises this as a Markov decision process, a mathematical model of sequential choice under uncertainty.
The middle of the book then presents three families of solution methods and shows how each makes a different trade-off. Dynamic programming assumes a perfect model of the environment and computes good behaviour by systematic calculation. Monte Carlo methods assume no model and learn by averaging the actual returns observed in complete episodes of experience. Temporal-difference methods also assume no model, but they learn after every step by comparing successive predictions. The book shows that these are not three unrelated techniques but three corners of a single space, and much of its craft lies in showing how methods in between combine their strengths.
The second edition makes this structure explicit. Its first part treats the case in which the agent can keep a separate estimate for every situation and every action, which is possible only when there are few of them. This tabular case allows the methods to be understood exactly. The second part treats the realistic case in which there are too many situations to list, so the agent must use a parameterised function, such as a neural network, to generalise from situations it has met to ones it has not. This part also introduces methods that learn a policy directly rather than through a value estimate. The third part looks outward: to the links between reinforcement learning and animal psychology, to its links with neuroscience, to case studies of applications, and to open problems.
Two ideas organise the whole. The first is the value function, an estimate of how much reward an agent can expect from a given situation. Nearly every method in the book learns or uses such estimates. The second is what the authors call generalised policy iteration, the interplay between evaluating a way of behaving and improving it. Every method can be seen as some version of this loop: estimate how good the current behaviour is, change the behaviour to do better according to that estimate, and repeat. Seeing the whole book through these two ideas makes its many algorithms look like variations on one theme.
There is also a distinction the book keeps in view throughout: prediction against control. Prediction is the problem of estimating how good situations are under a fixed way of behaving. Control is the problem of finding a better way of behaving. Most methods are first introduced for prediction, where they are easier to analyse, and then extended to control. A reader who keeps track of which of the two problems a given section is solving will find the book much easier to follow, because the same idea often appears twice, once in each role.
The writing style supports this structure. Each method is presented first in words, then with a small example, then in a short boxed algorithm, and only then with whatever mathematics is needed. Proofs are kept brief or left to the references. The historical and bibliographical remarks at the end of each chapter tell the reader where each idea came from and who contributed it. This makes the book unusually honest about the field's debts to psychology, control theory and operations research.
The book is also shaped by a stance. It treats reinforcement learning as a computational approach to learning from interaction, and it is cautious about claiming more. It does not argue that all intelligence is reinforcement learning, but it repeatedly suggests that goal-directed learning from interaction is a central and underrated part of intelligence, and that much of what people call intelligence may be built from it.
Idea one: learning from reward
The book distinguishes reinforcement learning sharply from the two other main kinds of machine learning. In supervised learning, a system is given examples together with the correct answers and learns to produce those answers for new examples. In unsupervised learning, it is given examples without answers and finds structure in them. In reinforcement learning, no one gives the correct answer. The agent is told only how good its outcome was, often long after the decisions that produced it.
The difference matters. A supervised learner for chess would be shown positions with the best move for each, taken from an expert. It could learn to imitate the expert but not to surpass the expert, and it would be helpless in positions the expert never faced. A reinforcement learner for chess would be told only whether it won or lost at the end of each game. From that sparse signal it must work out which of its many moves deserved credit. This is far harder, but it has a decisive advantage: the learner is not limited by a teacher. It can discover strategies no one has thought of, which is what the game-playing programs of the last decade did.
The authors adopt what they call the reward hypothesis: that everything we mean by goals and purposes can be thought of as the maximisation of the expected sum of a single scalar signal. This is a strong claim, and the book is careful to present it as a working hypothesis rather than a proven truth. Its value is that it gives a precise and general way to specify what an agent should do. Its risk is that it can mislead: a reward signal is easy to write down, but it is very hard to write one that captures what one really wants. A designer who rewards a game-playing agent for collecting points may find that it learns to collect points in ways that defeat the purpose of the game.
A crucial point is that reward is not the same as value. Reward is the immediate signal at each step, a bit like pleasure or pain. Value is the total reward an agent can expect from a situation onward, a bit like judgement about what is good in the long run. An action can bring a small reward now and lead to a situation of great value, or a large reward now and lead to ruin. Much of human wisdom consists in learning to act on value rather than reward, and much of the book is about how a machine can learn to do the same.
The authors also insist that reward comes from outside the agent's decision-making part, even if it is computed inside the animal or the robot. In a living creature, reward might be generated by internal circuits that signal hunger satisfied or pain avoided. The agent, in the book's sense, is the part that makes decisions, and the reward is a fact about the environment it faces. This line between agent and environment is drawn by what the agent can change at will, not by the boundary of the body.
Idea two: exploration and exploitation
Imagine a row of slot machines, each paying out at a different unknown average rate. You have a fixed number of plays. Each time, you can pull the machine that has paid best so far, or try another to learn whether it might be better. If you always choose the best so far, you may lock onto a mediocre machine because of an early lucky streak. If you keep experimenting, you waste plays on machines you already know are poor. This is the multi-armed bandit problem, named after the slang term for a slot machine, and the book opens its technical treatment with it.
The bandit problem isolates the exploration and exploitation dilemma that runs through all of reinforcement learning. Exploitation means using what you know to get reward now. Exploration means gathering information that may let you get more reward later. Neither alone is good. The book presents several simple ways of balancing them. One is to choose the best-looking action most of the time but a random action with some small probability. Another is to start with optimistic estimates of every action's value, so that the agent is drawn to try each one until experience brings its estimate down. A third is to favour actions whose estimates are uncertain, adding a bonus that shrinks as an action is tried more often.
The dilemma appears everywhere in ordinary life. A person choosing a restaurant faces it: return to the reliable favourite or try the new place. A company faces it in deciding how much to invest in research against how much to invest in its existing products. A doctor faces it in deciding whether to keep prescribing a proven treatment or to enrol patients in a trial of a new one. In each case the right balance depends on how long one expects to keep choosing. If you are leaving a city tomorrow, eat at the place you know; if you are moving there for ten years, explore.
The book also points out that exploration is not the same as randomness. Sensible exploration is directed at the actions most likely to turn out better than expected. And the need for it does not go away as an agent becomes skilled, because the world may change. An agent that stops exploring entirely cannot notice that a once-poor action has become good.
The bandit chapter introduces, almost in passing, the simplest form of the update rule that the whole book will use. An estimate is moved a little toward each new observation, by a fraction called the step size. A new estimate equals the old estimate plus the step size times the difference between what was observed and what was expected. This pattern of updating by a fraction of an error recurs in nearly every algorithm that follows, and it is worth learning by heart in this simple setting.
Idea three: Markov decision processes and the Bellman equations
In a bandit problem, the agent's action has no effect on the situation it faces next. In most real problems it does. Moving a chess piece changes the board; turning a car's wheel changes its position. To handle this, the book introduces the Markov decision process. The agent is in some state. It chooses an action. The environment responds with a reward and a next state, drawn according to probabilities that depend only on the current state and action. The process repeats. The word Markov refers to the property that the current state contains all the information relevant to the future; the history of how one got there adds nothing.
The agent's goal is to maximise the return, the total of future rewards. Often future rewards are discounted, so that a reward received later counts for somewhat less than the same reward now. Discounting has two motivations: it keeps the total finite in tasks that never end, and it expresses a preference for sooner over later reward that is familiar from economics. A discount rate close to one makes the agent far-sighted; a rate close to zero makes it care only about the next step.
Given this setup, the book defines two kinds of value function. The state value of a situation under a given way of behaving is the expected return from that situation onward. The action value is the expected return from taking a particular action in that situation and then following the given way of behaving. The way of behaving itself is called a policy, a rule assigning an action, or probabilities over actions, to each state.
The key mathematical fact is that value functions satisfy a consistency condition known as the Bellman equation, after Richard Bellman, who developed dynamic programming in the 1950s. The value of a state equals the expected immediate reward plus the discounted value of the state that follows. In words: how good it is to be here is how good the next step is, plus how good it is to be where that step leads. This recursive relationship is the backbone of the field. Almost every algorithm in the book can be understood as a way of finding value functions that satisfy it, either exactly or approximately, either from a model or from experience.
An analogy may help. Think of the value of a position in a long journey as how close you are to home, measured in hours. The Bellman equation says that your distance from here equals the time for the next leg plus your distance from where that leg ends. If every town on the map has a distance estimate, and they are all consistent with each other in this way, then they are correct. If they are not consistent, you can improve them by repeatedly adjusting each one to match its neighbours. That is, in essence, what the learning methods do.
The Markov property is often misunderstood as a claim about the world. It is a requirement on the state representation. If the agent's description of its situation leaves out something that matters for the future, the problem is not Markov in that representation, and the methods may fail. Much practical difficulty lies in choosing a state description that captures what matters, and the book's later chapters discuss what to do when the agent cannot observe the full state.
Idea four: three ways to solve the problem
Once the problem is defined, the book presents three basic families of solution, each answering the question of how to find good value functions and good policies.
Dynamic programming
Dynamic programming assumes the agent has a perfect model: it knows, for every state and action, the probabilities of each next state and reward. With such a model, the Bellman equations can be solved by repeated sweeps. Policy evaluation computes the value of each state under the current policy. Policy improvement then changes the policy to choose, in each state, the action that looks best given those values. Repeating the two steps converges to an optimal policy. Value iteration merges them, updating each state's value directly toward the best action's value. These methods are exact and well understood, but they need a complete model and they must sweep through every state, which is impossible when there are very many.
Monte Carlo methods
Monte Carlo methods drop the need for a model. The agent simply acts, observes complete episodes from start to end, and estimates the value of each state as the average of the returns that actually followed visits to it. This is like estimating how long a commute takes by timing it many times. Monte Carlo methods are simple and make no assumptions about the environment's structure. Their drawback is that they must wait until an episode ends before learning anything, and their estimates can be noisy, because each return depends on many random events.
Temporal-difference learning
Temporal-difference learning, discussed fully in the next chapter of this edition, combines the two. Like Monte Carlo methods, it learns from raw experience without a model. Like dynamic programming, it updates estimates using other estimates, without waiting for the final outcome. The book treats this combination as the central idea of the field.
The value of seeing these three side by side is that their differences can be described along two dimensions. One is whether an update uses a model of all possible next steps or only a sample of the step that actually happened. The other is whether an update looks all the way to the end of the episode or only one step ahead before relying on an estimate. Dynamic programming uses full models and looks one step ahead. Monte Carlo uses samples and looks to the end. Temporal-difference learning uses samples and looks one step ahead. Exhaustive search would use full models and look to the end. Methods in between can be built by choosing intermediate points on each dimension.
Idea five: temporal-difference learning
If one idea had to be named as central and novel to reinforcement learning, the authors say, it would be temporal-difference learning. The idea is to learn a guess from a guess. When the agent moves from one state to the next and receives a reward, it compares its earlier estimate of the first state's value with the reward plus its current estimate of the next state's value. The difference between the two is called the temporal-difference error. The agent then nudges its earlier estimate toward the newer one by a small fraction of this error.
Consider predicting how long a drive home will take. You leave work expecting thirty minutes. Ten minutes in, you hit heavy traffic and now expect the rest to take thirty more. A Monte Carlo learner would wait until you arrive home to update its estimate for leaving work. A temporal-difference learner updates immediately: it now believes leaving work means about forty minutes, because ten minutes have passed and thirty are expected to remain. It learns from the change in its own prediction, without waiting for the outcome. This is often faster, uses less memory, and works in tasks that never end.
The method's power comes from this bootstrapping, the use of estimates to update estimates. Its danger comes from the same place. If the estimates being used are wrong, the errors can propagate. The book explains the conditions under which temporal-difference learning is proven to converge to correct values in the tabular case, and later warns of the conditions under which it can go wrong.
Temporal-difference ideas also extend to control, that is, to learning not just how good states are but what to do. Two algorithms are central. Sarsa, whose name comes from the sequence of state, action, reward, next state and next action that it uses, updates the value of an action toward the reward plus the value of the action actually taken next. Q-learning, introduced by Watkins, updates the value of an action toward the reward plus the value of the best action available next, regardless of what the agent actually does. This makes Q-learning an off-policy method: it learns about the best way of behaving while following a different, more exploratory way. Sarsa is on-policy: it learns about the way it is actually behaving, including its exploration.
The difference between on-policy and off-policy learning matters in practice. The book gives an example of a cliff walk, in which an agent must travel along the edge of a cliff to a goal. Q-learning learns the optimal path right along the edge, but because the agent sometimes explores randomly, it occasionally falls off while learning. Sarsa learns a safer path further from the edge, because it takes its own exploratory slips into account. Neither is simply better; they answer different questions.
Temporal-difference learning has a striking connection outside computing. In the 1990s, neuroscientists recording from dopamine neurons in monkeys found that these neurons fire in a pattern resembling a temporal-difference error: they respond to unexpected rewards, stop responding to rewards that have become predictable, and fire instead at the earliest reliable predictor of reward. Researchers including Wolfram Schultz, Peter Dayan and Read Montague proposed that dopamine signals a reward prediction error. The second edition devotes a chapter to this, and it is one of the most remarkable cases of a theory developed for machines turning out to describe brains.
Idea six: bridging one step and many
One-step temporal-difference learning and Monte Carlo learning are two extremes. The first looks one step ahead and then trusts its estimate. The second looks all the way to the end and trusts nothing but actual rewards. The book shows that there is a whole spectrum between them, and that the best methods usually sit somewhere in the middle.
An n-step method looks a fixed number of steps ahead, adds up the rewards actually received over those steps, and then uses its estimate for the state reached. With one step it is ordinary temporal-difference learning; with enough steps to reach the end, it is Monte Carlo. Intermediate values often learn faster than either extreme, because they combine some of the low noise of bootstrapping with some of the low bias of real outcomes.
Eligibility traces give an elegant and efficient way to blend all step lengths at once. The idea is that each state the agent visits leaves behind a fading mark, a trace that records how recently and how often it was visited. When a temporal-difference error occurs, every state is updated in proportion to its trace. Recently visited states get most of the credit or blame; states visited long ago get little. A single parameter controls how fast the traces fade, and so where the method sits between one-step learning and full Monte Carlo.
The intuition is familiar from ordinary life. When something good or bad happens, we tend to credit the actions we took just before, and to a lesser degree the ones taken earlier. A student who does well on an examination may credit the last week of revision most, the steady work of the term somewhat, and the first lecture very little. Eligibility traces formalise this habit, and they connect to older ideas in animal learning about how the strength of association between an event and a reward declines with the gap between them.
These methods address the credit assignment problem that motivated Sutton's thesis. In any long task, the reward arrives late and many decisions came before it. Which ones mattered? Traces and n-step returns are practical answers: they spread credit backward over time in a principled way, and they let the agent learn from delayed outcomes without waiting for every episode to finish.
Idea seven: generalisation and function approximation
Everything up to this point can be done with a table: one entry for each state, or each state and action. This works for tic-tac-toe or a small gridworld. It fails for backgammon, which has an astronomical number of positions, for a robot whose joint angles vary continuously, or for a game played from raw screen images. In such cases the agent will almost never see the same state twice. It must generalise, using what it learned in situations it has met to act well in ones it has not.
The book's answer is function approximation. Instead of a table, the agent represents its value function as a function with adjustable parameters, such as a weighted sum of features or a neural network. Learning means adjusting the parameters so that the function's outputs match the targets produced by the reinforcement learning methods. Because the parameters are shared across states, an update in one situation changes the estimates for similar situations too. This is how generalisation happens, and it is also how errors spread.
The choice of features matters a great deal. The book describes several ways of building them by hand, such as tile coding, which covers a continuous space with overlapping grids so that nearby points share features, and it explains the trade-offs between coarse and fine representations. It then discusses neural networks, which learn their own features. TD-Gammon, which used a neural network trained by temporal-difference learning through self-play, is the classic early success. Later systems that learned to play Atari games from pixels and that mastered Go combined deep neural networks with the methods in this book.
Function approximation brings a serious difficulty, which the second edition discusses frankly. The guarantees that hold for tabular methods do not all carry over. In particular, the book identifies a combination it calls the deadly triad: function approximation, bootstrapping and off-policy learning. Any two of these together are generally safe. All three together can make learning unstable, with estimates that grow without limit instead of settling down. Since all three are very useful, a great deal of research has gone into understanding and taming this instability. The practical tricks used in deep reinforcement learning, such as keeping a slowly updated copy of the network to compute targets, can be seen as responses to it.
The second edition also treats a distinction that becomes important with approximation: episodic tasks, which end, such as a game, and continuing tasks, which go on without limit, such as managing a power grid. For continuing tasks it introduces the average-reward setting, in which the agent seeks the highest reward per step over the long run rather than a discounted sum. The book argues that discounting, though convenient, is less natural in this setting than it first seems, and it is candid that the theory is still unsettled here.
A useful way to think about function approximation is as compression. A table remembers every case separately. An approximator summarises them in a much smaller set of numbers, which forces it to find what situations have in common. That is what makes learning in vast spaces possible at all. But a summary is always imperfect, and the agent must accept that its estimates will be wrong in some places, ideally in places that matter little.
Idea eight: planning, models and learning together
A model, in the book's sense, is anything an agent can use to predict how the environment will respond to its actions. With a model, the agent can plan: it can imagine sequences of actions and their consequences without actually taking them. Without a model, it can only learn from real experience. The book argues that planning and learning are not opposites but two uses of the same machinery. Both work by updating value estimates. Learning uses real experience; planning uses simulated experience generated by a model.
Sutton's Dyna architecture makes this concrete. A Dyna agent learns from each real step as usual. It also uses that step to improve a model of the environment. Then, between real steps, it generates imagined steps from the model and learns from those too. The more planning steps it performs, the faster it learns from limited real experience. If the environment changes and the model becomes wrong, real experience corrects it. This simple design unifies model-free and model-based approaches and shows how an agent can trade computation for experience.
An analogy is a chess player who studies after a game. The game itself is real experience. Afterwards, the player sets up positions from it and explores what would have happened with different moves. That study is planning with a model of the rules and of the opponent's likely replies. It makes the next real game better without requiring more real games.
The book also discusses planning at decision time, in which the agent searches forward from its current state just before acting. Monte Carlo tree search, which builds a search tree by running many simulated games and focusing on promising lines, is the leading example. It was a key component of the program that defeated top human players at Go, where it was combined with neural networks trained by reinforcement learning to evaluate positions and suggest moves. The combination of learned evaluation and search is one of the most powerful patterns the field has found.
A common confusion is to treat model-free and model-based methods as rival schools. The book's view is that real agents will usually need both: fast, habitual responses learned directly from experience, and slower, deliberate planning with a learned model. This division has a parallel in psychology, where researchers distinguish habitual from goal-directed behaviour, and the book draws the connection explicitly.
Idea nine: learning the policy directly
Most of the book's methods learn values and derive a policy from them, by choosing the action with the highest estimated value. The second edition gives a full chapter to a different approach: learning the policy directly. In policy gradient methods, the policy is itself a parameterised function that gives the probability of each action in each state. The agent adjusts the parameters in the direction that increases expected return, using experience to estimate that direction.
Learning a policy directly has advantages. It handles continuous actions, such as how much torque to apply to a motor, which value-based methods find awkward. It can learn stochastic policies, which are sometimes optimal, for example in games where being predictable is a weakness. And small changes to the parameters produce small changes in behaviour, which can make learning smoother. Its main disadvantage is that the estimates of which direction to move can be very noisy.
Actor-critic methods combine the two approaches. The actor is the policy, which chooses actions. The critic is a value function, which judges how good the actor's choices turned out to be compared with what was expected. The critic's temporal-difference error tells the actor which way to adjust. This reduces the noise of pure policy gradient while keeping its flexibility. Actor-critic designs are among the oldest ideas in the field, appearing in Barto and Sutton's work from the early 1980s, and they underlie many of the most widely used modern algorithms.
These methods matter beyond robotics and games. The fine-tuning of large language models from human preference judgements, which has shaped how conversational AI systems behave, uses policy gradient methods descended from this line of work. A model generates responses; a separate model trained on human comparisons scores them; the language model's parameters are adjusted to make higher-scoring responses more likely. The vocabulary of policy, reward and value from this book is the vocabulary of that process.
Idea ten: learning machines and learning animals
The third part of the second edition contains two chapters that many readers find the most surprising in the book. One sets reinforcement learning beside the psychology of animal learning. The other sets it beside neuroscience. Together they make a case that the book's algorithms are not just engineering tools but candidate theories of how living creatures learn to behave.
Psychologists distinguish two kinds of conditioning. In classical conditioning, an animal learns that one event predicts another, as when a dog comes to salivate at a sound that has repeatedly preceded food. In instrumental conditioning, an animal learns that its own actions produce consequences, as when a rat learns to press a lever for food. The book maps the first onto prediction, the learning of value functions, and the second onto control, the learning of policies. Temporal-difference learning, it argues, accounts for features of classical conditioning that older models struggled with, such as the way an animal comes to respond to the earliest reliable signal in a chain of signals leading to reward.
The book also discusses the distinction between habitual and goal-directed behaviour. A rat that has learned to press a lever for a particular food may keep pressing even after that food has been made unpleasant to it, if the habit is strong enough. Early in training, it stops at once. Psychologists interpret this as a shift from deliberate, goal-directed control, which consults the current value of the outcome, to habit, which acts on cached values without checking. The book maps these onto model-based and model-free reinforcement learning. Model-based control plans with a model of outcomes and so responds immediately when an outcome's value changes. Model-free control acts on learned values and must relearn slowly.
The neuroscience chapter develops the reward prediction error hypothesis of dopamine described earlier, and adds the idea that different parts of the brain may implement actor and critic. It is careful to present these as hypotheses with strong but incomplete support. Still, the convergence is striking. Methods worked out from first principles for machines, by people trying to solve an engineering problem, turned out to describe signals recorded from neurons.
This matters for how the book should be read. It is easy to treat reinforcement learning as a collection of algorithms for games. The book's own view is broader: it offers a computational account of learning from consequences that applies wherever there is an agent, an environment and something that matters to the agent. That account is incomplete, and the authors say so. But it is precise, and precision is what lets it be tested against animals, people and machines alike.
A word of caution is in order. Finding a reward prediction error in the brain does not show that everything people value reduces to reward, nor that the mind is nothing but a reinforcement learner. It shows that one important learning system in the brain behaves as the theory predicts. The book draws the parallel without overclaiming, and a careful reader should do the same.
The tradition around it
Reinforcement learning has two main roots, which the book traces in its first chapter and its historical notes. One is the psychology of animal learning. Edward Thorndike's law of effect, from around 1900, held that behaviours followed by satisfaction become more likely to recur. Later work on conditioning, by Ivan Pavlov and then by researchers who built mathematical models of learning in the mid-twentieth century, studied how animals learn to predict rewards and adjust behaviour accordingly. The Rescorla-Wagner model of classical conditioning, which updates associations in proportion to a prediction error, is a direct ancestor of temporal-difference learning.
The other root is the theory of optimal control. In the 1950s Richard Bellman developed dynamic programming and the equations that bear his name, and Ronald Howard developed policy iteration for Markov decision processes. These methods assumed full knowledge of the system to be controlled. Reinforcement learning can be described as what happens when one tries to achieve optimal control without that knowledge, learning from experience instead.
Within artificial intelligence, early learning programs pointed the way. Arthur Samuel's checkers program in the 1950s learned to evaluate positions by comparing its evaluations at successive moves, an early form of the temporal-difference idea. Donald Michie built a machine for learning tic-tac-toe out of matchboxes filled with coloured beads. Marvin Minsky's doctoral work considered reinforcement-based learning machines. After a period when AI attention moved elsewhere, Klopf, Barto and Sutton revived the subject in the late 1970s and 1980s.
Within this bay, Russell and Norvig's Artificial Intelligence: A Modern Approach gives a shorter introduction to Markov decision processes and reinforcement learning as part of its larger map, and it is a good companion. The Parallel Distributed Processing volumes record the neural network revival that supplied function approximators. Bishop's Pattern Recognition and Machine Learning and The Elements of Statistical Learning cover the supervised learning methods that reinforcement learning borrows for approximation. Pearl's Causality bears on a question this book raises implicitly: an agent that acts and observes is in a position to learn causes, not just correlations. And the books on the future and safety of AI, especially Russell's Human Compatible, Christian's The Alignment Problem and Bostrom's Superintelligence, are in large part reflections on what happens when reward-maximising agents become powerful.
Questions and criticisms
The reward hypothesis is the most debated element of the book. Critics argue that not all goals can be captured by a single number summed over time. Human values involve constraints, plural concerns that cannot be traded off against each other on one scale, and preferences about how outcomes are reached, not only what they are. Others argue that the hypothesis is true but unhelpful, because the hard part is finding the right reward, and the theory says nothing about that. The authors present the hypothesis as a working assumption, and a careful reader should keep it in that status.
A related problem is often called reward hacking or specification gaming. Agents trained to maximise a reward frequently find ways to obtain it that their designers did not intend: exploiting a bug in a simulator, circling endlessly to collect a repeating bonus, or satisfying the letter of an objective while violating its spirit. The book's framework explains why this happens: the agent maximises exactly what it is given. Christian's The Alignment Problem collects many examples. This is not a flaw in the algorithms so much as a warning about how they must be used.
Sample inefficiency is a practical criticism. Reinforcement learning agents often need vastly more experience than a person would to learn a comparable task. Game-playing systems have played millions of games; robots trained this way often learn in simulation because real trials would take too long. Model-based methods, transfer from related tasks, and learning from demonstrations are all attempts to address this, and progress has been real but uneven.
Some have questioned how general the successes are. Reinforcement learning has been spectacularly successful in games and simulations, where experience is cheap and the rules are fixed. Its record in messy real-world settings is more mixed, though there are successes in areas such as the control of cooling systems, robotics and the tuning of language models. A fair summary is that the methods work best when one can generate a great deal of experience safely and when the reward can be specified clearly.
Partial observability is a further gap. The core theory assumes the agent sees the true state. Real agents rarely do; they see noisy, incomplete observations and must infer what is going on. The second edition discusses approaches to this, such as building a state from the history of observations, but the problem remains one of the hardest in the field. A reader should notice how often the clean results of the early chapters depend on the Markov assumption.
Safe exploration is another open issue. Trial and error works when errors are cheap. A self-driving car, a medical treatment policy or an industrial controller cannot be allowed to explore by trying dangerous actions to see what happens. Learning from logged data, from simulation, or under constraints that rule out unsafe actions are active areas of research, and the book's methods must be adapted with care before they are used where mistakes are costly.
What has held up is the conceptual framework. The distinction between reward and value, the exploration and exploitation dilemma, the Bellman equations, temporal-difference learning and the idea of generalised policy iteration are now standard in fields from robotics to economics to neuroscience. The second edition's honesty about open problems, including the deadly triad and the difficulty of learning with partial observation, has also aged well. The book did not overpromise.
Why it is on this shelf
This is the shelf's account of how goal-directed behaviour can be learned. The other technical books in the bay explain how machines can represent knowledge, reason with probabilities and recognise patterns. This one explains how they can learn what to do, from consequences, without a teacher. Game-playing machines and the reward-based tuning of language models both rest on it, so anyone who wants to understand those systems at more than a slogan level needs its ideas.
A reader of Vedanta will find an unexpected mirror here. The book gives a precise model of an agent driven by reward, acting, receiving consequences, and adjusting its future action to seek more of what it values. That is close to a formal description of what the Indian traditions call karma in its psychological sense: action conditioned by its fruits, which shapes tendencies, which shape further action. The traditions call those accumulated tendencies samskaras, the impressions that past action leaves on the mind. The Bhagavad Gita's teaching of action without attachment to its fruit reads differently after one has seen, in mathematical form, how completely a reward-seeking agent is governed by the signal it is trying to maximise. The book does not make this comparison, and the shelf does not press it. But the parallel is exact enough to be useful in both directions.
For economics, the book's apparatus of value, discounting and sequential choice under uncertainty overlaps with dynamic programming in economic theory, and its exploration and exploitation dilemma is a general model of the tension between investment in learning and use of current knowledge. For Jyotish, which reasons about time, consequence and the unfolding of situations, the formal treatment of delayed consequences and of how present choices shape future states offers a disciplined counterpart. For technology, the case is direct: these are the methods by which many current systems are trained.
We also keep it for its manner. It is a model of how to write a technical book: patient, honest about what is unknown, generous with history, and built from small examples that a reader can work by hand. It teaches a field without inflating it. Placed beside the more speculative books in this bay, it is a reminder that claims about learning machines should be checked against what the methods actually do, and this is the book in which to check them.
How to read it
Use the second edition, which the authors provide free online as well as in print. It is the more complete and more careful book. The first edition remains readable but omits much that is now essential, including policy gradient methods and the chapters on psychology and neuroscience.
First pass, about four to five weeks
- Read chapter one entirely. It gives the overview, the history and the tic-tac-toe example, which shows the core idea of learning values from play before any formalism.
- Read the chapter on multi-armed bandits. Implement, or simulate on paper, a ten-armed bandit with the simple strategy of acting greedily most of the time and randomly some of the time. Watch how the step size and exploration rate change the results.
- Read the chapter on finite Markov decision processes slowly. Write out the Bellman equation for a three-state example of your own and check that you can compute values by hand.
- Read the dynamic programming chapter for the ideas of policy evaluation, policy improvement and generalised policy iteration. The proofs can wait.
- Skim the Monte Carlo chapter, then read the temporal-difference chapter carefully. Work the driving-home style prediction example with your own numbers. Make sure you understand the difference between Sarsa and Q-learning, using the cliff-walking example.
- Read the chapter that unifies the tabular methods with planning, focusing on Dyna.
- Read the opening sections of the function approximation chapter, then the chapter on policy gradient methods up to actor-critic.
- Read the chapters on psychology and neuroscience in the third part. They are accessible and they change how one sees the rest.
What to skip at first
On a first pass, skip the detailed convergence proofs, the more technical chapters on off-policy learning with approximation, and most of the material on eligibility traces beyond the basic idea. Return to them once the core methods are familiar.
Working method
This is a book best read with a pencil and, if possible, a computer. The examples are small enough to work by hand or code in an afternoon. Do at least one exercise in each of the first six chapters. Keep a single page on which you write the update rule of each method you meet, one under another; seeing them side by side reveals how small the differences are and how much they matter. Expect to spend two or three sessions on each core chapter.
What to read next from this shelf
Read the chapters on decision making in Russell and Norvig's Artificial Intelligence: A Modern Approach for context. Then read Russell's Human Compatible and Christian's The Alignment Problem, which take up the question this book leaves to its readers: what happens when reward-maximising agents become very capable and the reward is not what we really want. For the statistical tools behind function approximation, turn to Bishop's Pattern Recognition and Machine Learning.
Questions to carry
- In your own life, where do you act on immediate reward and where on long-run value, and how did you learn the difference?
- What is the right balance between exploring and exploiting for a decision you will face many times, and how does it change with the time remaining?
- Is there any goal you hold that cannot be expressed as maximising a single number over time?
- When an agent games its reward, whose mistake is it: the agent's, or the designer's?
- What would it mean for a state description to be complete enough to be Markov for a problem you care about?
- Why is learning a guess from a guess sometimes faster than waiting for the truth, and when is it dangerous?
- How far back in time should credit for an outcome be spread, and what determines the fading rate?
- What do you gain by planning with an imperfect model rather than learning only from real experience?
- Why might a stochastic policy be better than any fixed rule in a competitive situation?
- If dopamine signals a reward prediction error, what does that suggest about the difference between pleasure and learning?
- What would action without attachment to its fruit look like in the language of this book, if it can be expressed at all?
- Which real-world problems are poorly suited to learning by trial and error, because the errors are too costly?
- How should an agent behave when it is not sure that its reward signal reflects what its designers intended?
Words to know
- Agent: the learner and decision maker, defined by what it can choose to do.
- Environment: everything outside the agent's control that responds to its actions with new states and rewards.
- Reward: the immediate numerical signal the environment sends after each action.
- Return: the total of future rewards, often discounted, that the agent seeks to maximise.
- Discount rate: a number between zero and one that sets how much future rewards count compared with immediate ones.
- Policy: the agent's way of behaving, a mapping from states to actions or to probabilities over actions.
- Value function: an estimate of the expected return from a state, or from taking an action in a state, under a given policy.
- Multi-armed bandit: a simplified problem in which the agent repeatedly chooses among actions with unknown average payoffs in a single unchanging situation.
- Exploration and exploitation: the trade-off between trying actions to learn about them and choosing the action that currently looks best.
- Markov decision process: a formal model of sequential decision making in which the next state and reward depend only on the current state and action.
- Markov property: the condition that the current state contains all information relevant to predicting the future.
- Bellman equation: the recursive relationship expressing a state's value as immediate reward plus the discounted value of the next state.
- Dynamic programming: methods that compute optimal policies from a complete model of the environment by repeated sweeps of the Bellman equations.
- Monte Carlo method: learning value estimates by averaging returns observed over complete episodes.
- Temporal-difference learning: updating an estimate toward the observed reward plus the estimate for the next state, without waiting for the final outcome.
- Bootstrapping: updating estimates partly on the basis of other estimates.
- Temporal-difference error: the difference between the current estimate and the reward plus next-state estimate; the signal that drives learning.
- Q-learning: an off-policy temporal-difference control method that learns the value of the best action regardless of the action actually taken.
- Sarsa: an on-policy temporal-difference control method that learns the value of the actions the agent actually takes.
- Eligibility trace: a fading record of recently visited states that spreads credit for an error backward in time.
- Function approximation: representing value functions or policies with parameterised functions so that learning generalises across states.
- Deadly triad: the combination of function approximation, bootstrapping and off-policy learning, which can make learning unstable.
- Dyna: an architecture that combines learning from real experience with planning from simulated experience generated by a learned model.
- Policy gradient: a family of methods that adjust the parameters of a policy directly in the direction that increases expected return.
- Actor-critic: a method in which a policy (the actor) is improved using the evaluations of a learned value function (the critic).
A note on this edition
This is a study edition written for this shelf in our own words. It is a companion and commentary, not a substitute for the book. Reinforcement Learning: An Introduction is in copyright, and none of its text, figures, algorithms or exercises is reproduced here. The authors generously make the second edition available to read online, and the printed book is worth getting from a library or a bookshop. Read it slowly, with a pencil, and work the small examples yourself.