Abstract

How can an agent learn to act well when the feedback for an action arrives many steps later, or only once in a long run? Reinforcement learning answers with a small set of ideas. Fix a goal as a numerical reward, define the value of a situation as the reward expected from it onward, and note that values obey a consistency equation that Bellman’s dynamic programming exploits. Temporal-difference learning and Q-learning apply the same equation to sampled experience, with convergence proofs that hold for tables of values and visit conditions that must be met exactly. Policy-gradient methods adjust the policy directly. Combined with neural networks, as in TD-Gammon, DQN and AlphaGo, these methods worked far beyond the reach of their proofs. Each theorem holds only under its stated conditions, and two security consequences follow: an optimiser exploits the reward it is given, and a learned policy can be attacked through what it observes.

The problem

Agent, environment, reward and return

An agent acts in an environment. In the basic formulation the agent sees the state, a description of the situation that includes what matters about the past (a fully observed process). At each time step it chooses an action, and receives from the environment a number called the reward and a new state. The learner is not told which actions are correct. In Sutton and Barto’s account it “must discover which actions yield the most reward by trying them”, and two features set the field apart from other kinds of learning: trial-and-error search and delayed reward.1 Real systems often see only an observation, which may omit part of the state; the security section returns to this gap.

The goal is stated as a single number to be accumulated. Sutton and Barto call this the reward hypothesis: all that is meant by goals and purposes can be well thought of as the maximisation of the expected value of the cumulative sum of a received scalar signal.2 This is a modelling assumption with limits. Abel and colleagues give finite examples in which no Markov reward on the given state space can express a desired policy or ordering of trajectories, a question about what reward can express that is separate from a designer picking a poor proxy.3 The quantity to be maximised is the return, the sum of future rewards, usually discounted:

G = R1 + γ R2 + γ² R3 + ...

The discount rate γ lies between 0 and 1. A reward received k steps ahead is worth γ^(k-1) times what it would be worth now. With γ = 0 the agent cares only about the next reward; as γ approaches 1 it weighs the distant future almost as much as the present.2 Discounting arithmetic is worth doing once by hand. With γ = 0.9, three rewards of 1 in a row have return 1 + 0.9 + 0.81 = 2.71. A reward of 1 on every step forever has return 1 / (1 - γ) = 10, which is finite because the weights shrink geometrically. A single reward of 100 that arrives on the tenth step is worth 100 × 0.9^9 = 38.74 at the start. With γ < 1 and bounded rewards the infinite sum is finite, which several theorems below require.

Markov decision processes

The standard formal model is the Markov decision process (MDP). It consists of a set of states, a set of actions, and the dynamics: the probability that taking action a in state s leads to state s’ with reward r. The Markov property says that the next state and reward depend on the past only through the current state and action. Sutton and Barto say it is best viewed as a requirement on the state: the state must include information about all aspects of the past interaction that make a difference for the future.2 Sutton and Barto credit Bellman (1957) with introducing the discrete stochastic version of optimal control known as the Markov decision process, and Howard (1960) with devising policy iteration.4

A policy π gives the probability of each action in each state. The value of a state under π, written v_π(s), is the expected return from s when actions follow π. The action value q_π(s, a) is the expected return from taking a in s and following π afterwards.5 Learning means finding a policy whose values are as high as possible in every state, the optimal policy, whose value function is v*.

The Bellman equations

The central fact is a consistency condition. The return from now equals the next reward plus γ times the return from the next state, so the value of a state is the expected next reward plus γ times the expected value of the next state:

v_π(s) = Σ_a π(a|s) Σ_(s',r) p(s',r|s,a) [ r + γ v_π(s') ]

This is the Bellman equation for v_π. Sutton and Barto note that its solution exists and is unique provided γ < 1 or termination is guaranteed from every state under π, and that when the dynamics are known it is a system of linear equations, one per state.5 The optimal value function satisfies the same relation with the average over actions replaced by a maximum:

v*(s) = max_a Σ_(s',r) p(s',r|s,a) [ r + γ v*(s') ]

For finite MDPs with bounded rewards and γ < 1 this Bellman optimality equation has a unique solution (at γ = 1 a zero-reward self-loop satisfies it for every constant value, so finiteness alone is not enough), and any policy that puts probability only on the maximising actions is optimal.6

Bellman’s own statement of the idea, in his address to the American Mathematical Society, delivered on 3 September 1953 and published in November 1954, is the principle of optimality: “An optimal policy has the property that whatever the initial state and initial decisions are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decisions.”7 In the finite, infinite-horizon discounted setting, a stationary rule can choose an optimal action from the current state. In Bellman’s finite-horizon example the value functions are indexed by stages remaining, so a rule in that setting generally depends on both the current state and the remaining horizon. Bellman put it this way: “if at any particular time we know what to do, it is never necessary to know the decisions required at subsequent times.”7

Exploration and exploitation

An agent that always takes the action that currently looks best may never discover a better one. Exploring can mean passing up an action with higher expected immediate reward. Sutton and Barto describe this as a challenge that arises in reinforcement learning and not in other kinds of learning: the agent must exploit what it has experienced to obtain reward and explore to select better actions in future, and neither can be pursued exclusively without failing at the task.1 The simplest remedy is ε-greedy action selection: with probability ε pick an action at random, otherwise pick the one with the highest estimated value. It reappears below because the convergence results for model-free learning depend on exploration continuing.

Delayed and sparse reward, credit assignment

In many tasks the reward that follows a good decision comes much later. A chess move that wins the game thirty moves on is rewarded only at the end. Credit assignment is the problem of deciding which of the many earlier decisions deserves the credit. Value functions are the main tool: a value estimate converts a distant reward into a signal available at every step, because the value of the next state already summarises what lies beyond it.

Sparse reward makes this harder. Suppose a task pays 1 only after one exact sequence of 20 actions drawn from 4 choices, and zero otherwise. A policy that chooses uniformly at each step has probability 4^-20, about 9 × 10^-13, of seeing a positive return on each 20-step attempt.

Planning with a model

Dynamic programming

If the dynamics p are fully known, finding the optimal policy is a computation, not a learning problem. Sutton and Barto trace the method to the mid-1950s work of Bellman and others, who defined a value function and a functional equation, now called the Bellman equation, and note that the name dynamic programming is Bellman’s.4 The classical way to optimise a multi-stage decision process is to enumerate every sequence of decisions, compute the return of each and take the best. Bellman observes that for even a moderate number of stages and choices “the dimension of the resultant maximization problem will be uncomfortably high”, and that this “price of excessive dimensionality” comes from demanding too much information.7 Sutton and Barto attribute the phrase “curse of dimensionality” to Bellman (1957), and define it as the fact that the number of states often grows exponentially with the number of state variables.8

Policy evaluation, policy improvement, policy iteration

Iterative policy evaluation turns the Bellman equation for v_π into an update rule: start with arbitrary values and repeatedly replace each state’s value by the right-hand side evaluated with the current values. Sutton and Barto state that the sequence converges to v_π under the same conditions that guarantee v_π exists.5 Policy improvement then makes the policy greedy with respect to the computed values. Alternating the two is policy iteration. In a finite discounted MDP, retain the current action whenever it is already greedy. Otherwise choose a greedy action. If nothing changes, the policy is optimal. If any action changes, the new policy is better in at least one state and no worse in any state. Because there are only finitely many deterministic policies, policy iteration reaches an optimal policy and value function in a finite number of iterations.5 The policy improvement theorem and policy iteration are credited to Bellman (1957) and Howard (1960).4

Value iteration

Value iteration truncates policy evaluation to a single sweep and folds improvement into it. Its update takes the maximum over actions inside the Bellman equation. For an arbitrary starting v_0, the sequence converges to v under the same conditions that guarantee v exists, and exact convergence is in general only a limit, so in practice one stops when a sweep changes values by little. In a small example such as the one below it can reach v* exactly in finitely many sweeps.5

A three-state example worked by hand

Take an MDP with two non-terminal states, S1 and S2, and a terminal state G whose value is always 0. Let γ = 0.9. In S1 the agent may choose stay, which pays 1 and leaves it in S1, or go, which pays 0 and moves it to S2. In S2 the only action is finish, which pays 20 and moves to G.

Sweep kv_k(S1) from stayv_k(S1) from gov_k(S1)v_k(S2)
000
11 + 0.9×0 = 10 + 0.9×0 = 0120
21 + 0.9×1 = 1.90 + 0.9×20 = 181820
31 + 0.9×18 = 17.20 + 0.9×20 = 181820

Value iteration reaches v* = (18, 20) after two sweeps and the third changes nothing. Each sweep computes v_(k+1) from v_k only. Reading the greedy action off the table, go beats stay from sweep 2 onward, so the optimal policy is to go.

Policy iteration reaches the same answer in a different way. Start with the policy that always stays. Evaluating it gives, for S1, the sequence 1, 1.9, 2.71, 3.439, and so on up to 1 / (1 - 0.9) = 10, and v(S2) = 20. Improvement compares stay (1 + 0.9×10 = 10) with go (0 + 0.9×20 = 18) and switches to go. Evaluating the new policy gives v(S1) = 18, and a second improvement step changes nothing, so the process stops.

Why the iteration converges

Denardo (1967) treated dynamic programming through contraction mappings, as the book’s notes record.4 The core of the argument is short. For bounded rewards and γ < 1, applying the one-sweep update to two value functions shrinks the largest gap between them by at least a factor γ, because a maximum of sums moves by no more than the largest change in what is summed and each next-state value is multiplied by γ. This derivation is the writer’s own condensation, not a quotation. One sweep therefore leaves at most γ times the previous gap, and the error after k sweeps is at most γ^k times the starting error. In the example the starting sup-norm error is 20, so the bound is 18, 16.2 and 14.6 for k = 1, 2, 3, and the actual errors were 17, 0 and 0. A γ near 1 makes the worst case slow.

Sutton and Barto note that dynamic programming finds an optimal policy in time polynomial in the number of states and actions, although the number of deterministic policies is exponential. Its limit is that the number of states often grows exponentially with the number of state variables. With the computers of the book’s date, 2018, DP methods can solve MDPs with millions of states.8

Learning without a model

When the dynamics are unknown, one route is to learn directly from sampled experience without a model; this model-free route is the subject of this part. The agent can instead estimate a model from experience and plan with it, as in the article on world models.1 Two model-free families are Monte Carlo and temporal-difference methods. Both estimate v_π for a fixed policy (prediction) and extend to finding good policies (control).

Monte Carlo

Monte Carlo methods wait until an episode ends, observe the actual return that followed each visit to a state, and move the estimate toward it. A constant step size α gives the update V(S) ← V(S) + α [G − V(S)], where G is the return actually observed after the visit.9 For the first visit to a state in an episode, the observed return is an unbiased sample of that state’s value under the fixed policy; every-visit averaging is consistent although its samples are not independent. The target depends on everything that happens until the episode ends, so it can vary a lot.

Temporal-difference learning

Temporal-difference (TD) learning replaces the observed return with a one-step estimate: the reward just received plus γ times the current estimate of the next state’s value.

V(S) ← V(S) + α [ R + γ V(S') − V(S) ]

The bracketed quantity is the TD error. It is the difference between two successive predictions, the old estimate and a better-informed one. Sutton and Barto call updating a guess from a guess bootstrapping.9

Sutton’s 1988 paper introduced and analysed the class. Its abstract says that, whereas conventional prediction methods assign credit by the difference between predicted and actual outcomes, the new methods assign credit by the difference between temporally successive predictions. It notes that such methods had been used in Samuel’s checker player, Holland’s bucket brigade and Sutton’s own Adaptive Heuristic Critic but had “remained poorly understood”, and claims convergence and optimality proofs for special cases.10 Sutton and Barto credit Arthur Samuel’s 1959 checkers program with the first learning method that included temporal-difference ideas.1

A TD(0) update with numbers

Take the example with the policy fixed to go, values starting at 0, α = 0.5 and γ = 0.9.

  1. Episode 1. Step S1 → S2 with reward 0: the TD error is 0 + 0.9×0 − 0 = 0, so V(S1) stays 0. Step S2 → G with reward 20: the TD error is 20 + 0 − 0 = 20, so V(S2) = 0 + 0.5×20 = 10.
  2. Episode 2. Step S1 → S2: the TD error is 0 + 0.9×10 − 0 = 9, so V(S1) = 0.5×9 = 4.5. Step S2 → G: the error is 20 − 10 = 10, so V(S2) = 10 + 5 = 15.
  3. Episode 3. Step S1 → S2: the error is 0 + 0.9×15 − 4.5 = 9, so V(S1) = 4.5 + 4.5 = 9. Step S2 → G: the error is 20 − 15 = 5, so V(S2) = 17.5.

The true values are 18 and 20. The reward information travels backwards one state per episode: S2 learns about the reward first, and S1 learns only once S2’s estimate has moved. A constant-step Monte Carlo update in this deterministic chain would reach V(S1) = 0.5 × 18 = 9 after one episode, because it uses the whole return, 0 + 0.9×20 = 18, as target. This is the trade. Monte Carlo uses the full outcome and waits for it; TD updates at every step from what it already believes, and can learn during a long or never-ending episode.9 For stochastic tasks Sutton and Barto report that TD methods have usually been found to converge faster than constant-α Monte Carlo, and add that nobody has proved mathematically that one converges faster than the other.9

What Sutton (1988) proved

The theory concerns a particular setting: data from an absorbing Markov process, one in which every sequence eventually terminates, as in a bounded random walk, and a linear learner whose prediction is a weighted sum of an observation vector. Theorem 1 states that the linear TD(1) rule produces the same per-sequence weight changes as the Widrow-Hoff supervised rule. Theorem 2 states that for any absorbing Markov chain, any starting distribution, any outcome distributions with finite expected values and any linearly independent set of state observation vectors, there exists an ε > 0 such that for all positive step sizes α < ε and any initial weights, the predictions of linear TD(0), updated after each sequence, converge in expected value to the ideal predictions. Theorem 3 shows that for linearly independent state observation vectors and a sufficiently small positive constant step size, with weights updated after each complete pass through a finite training set, the predictions converge to the maximum-likelihood estimates.10 The paper states that, up to that point, “no TD method has ever been proved stable or convergent to the correct predictions” (its wording is “hitherto”).10

The scope is narrow in four ways. The result is about prediction for a fixed process, not about choosing actions. It is convergence in expected value for a small enough constant step size, not almost-sure convergence. It requires a linear learner with linearly independent state observation vectors, which includes the table of values as a special case. And the paper’s Figure 3 had an error that was corrected in a published erratum, attached to the author’s copy of the paper.10 Sutton and Barto summarise the later state: for any fixed policy, TD(0) has been proved to converge to v_π in the tabular case, in the mean for a sufficiently small constant step size and with probability 1 if the step size decreases under the usual stochastic approximation conditions; some proofs cover general linear function approximation, where the limit is the TD fixed point, an approximation to v_π.9

Sutton’s paper also defines TD(λ), in which each correction is applied to earlier predictions with weights decaying by a factor λ per step into the past. With λ = 1 it coincides with the supervised procedure of Theorem 1, and with λ = 0 only the current prediction is updated.10 Eligibility traces are treated in the book’s chapter 12.9

Q-learning and off-policy learning

For control the agent learns action values, because with them the best action in a state is simply the one with the highest value. Watkins’s Q-learning does this without a model. After taking action a in state x, getting reward r and landing in state y, it moves Q(x, a) toward the reward plus the discounted best value available from y:

Q(x, a) ← (1 − α) Q(x, a) + α [ r + γ max_b Q(y, b) ]

This is the update given in the Watkins and Dayan paper, which proved its convergence in detail.11

A Q-learning update with numbers

Suppose the current table has Q(S1, go) = 0 and Q(S2, finish) = 10, with α = 0.5 and γ = 0.9. The agent takes go in S1, receives 0 and lands in S2. The target is 0 + 0.9 × max Q(S2, ·) = 0.9 × 10 = 9. The new value is Q(S1, go) = 0 + 0.5 × (9 − 0) = 4.5.

The convergence theorem and its conditions

The theorem in Watkins and Dayan (1992) is exact about what it needs. It assumes a finite world with discrete states and actions, a look-up table for the Q values, discount γ < 1 (the paper sketches an extension to undiscounted tasks with absorbing goal states), and bounded rewards. It requires learning rates 0 ≤ α_n < 1 such that, for every state-action pair, the sum of the rates applied to that pair is infinite and the sum of their squares is finite. Then Q_n(x, a) converges to Q*(x, a) for all x and a, with probability 1.11

The paper states the most important implicit condition in words: the sequence of episodes must include an infinite number of episodes for each starting state and action. Watkins and Dayan use “episode” for a single recorded transition (state, action, next state, reward), so an ordinary multi-step rollout need not start at every pair; the working condition is that every state-action pair is updated infinitely often. The authors call this strong, and argue that under the stochastic conditions of the theorem no method could be guaranteed to find an optimal policy under weaker conditions.11 The paper also observes that the description assumes a look-up table, and that Watkins (1989) showed Q-learning “may not converge correctly for other representations”.11 Sutton and Barto note that the behaviour policy determines which pairs are updated. It must keep updating every pair, and the step sizes must still satisfy the convergence conditions.12

The two step-size conditions are the classic stochastic approximation pair. Rates of 1/k, with k the number of updates of that particular pair, satisfy both: the harmonic series diverges while the sum of 1/n² converges. A constant rate violates the second condition, so the theorem does not apply to it as stated.

On-policy and off-policy; Sarsa

A learner is off-policy when the policy it evaluates or improves differs from the one that generates its experience. Q-learning is off-policy: it learns about the greedy policy while behaving, perhaps, ε-greedily. Sarsa is its on-policy counterpart, which updates toward the action actually taken next, and Sutton and Barto state that, in the finite tabular setting, Sarsa converges with probability 1 to an optimal policy and action-value function under the usual step-size conditions, as long as all state-action pairs are visited infinitely often and the policy converges in the limit to the greedy policy, so any decay of ε must preserve infinite visitation while becoming greedy.12

The two differ in their targets. Suppose Q(s, a) = 4, the agent receives 0, and the next state s’ has Q(s’, a1) = 10 and Q(s’, a2) = 2, but exploration makes the agent take a2. With α = 0.5 and γ = 0.9, Q-learning uses the best next value: 4 + 0.5 × (0 + 9 − 4) = 6.5. Sarsa uses the action actually chosen: 4 + 0.5 × (0 + 1.8 − 4) = 2.9. Q-learning learns about the policy it wishes it were following. Sarsa learns about the one it is following, exploration included. In Sutton and Barto’s cliff-walking example Q-learning learns the optimal route along the cliff edge but sometimes falls off because of ε-greedy selection, while Sarsa learns a longer, safer route with better online performance; and both methods can approach optimal play if ε falls to zero while preserving infinite visitation and the step sizes satisfy the convergence conditions.12

Function approximation and where the guarantees stop

Why tables fail

A table of state values needs one entry per state, and a table of action values one per state-action pair. The AlphaGo paper gives Go a breadth b of about 250 legal moves and a depth d of about 150 moves, so about b^d move sequences (paths in a search tree, which differs from the number of distinct board positions), and chess b ≈ 35, d ≈ 80.13 By arithmetic, 250^150 is about 10^360 and 35^80 about 10^124. An Atari 2600 frame in the 2013 DQN paper is a 210 × 160 image with a 128-colour palette, so 128^33,600, about 10^70,800, is an upper bound on the number of distinct pixel arrays.14 It says nothing about how many occur in practice. An agent that meets states it has not seen must generalise. Function approximation, fitting a parametrised function such as a linear model or a neural network, is one way; state aggregation, which lets one table entry stand for a group of states, is another.15 The article on neural networks covers such function approximators, and the article on what can be learned from examples covers generalisation in the supervised setting. The new difficulty here is that the targets come from the learner’s own estimates, and the data distribution depends on the policy being learned.

Linear approximation: the guarantee that survives

In the continuing discounted setting, with on-policy sampling and suitable feature and step-size conditions (set out in the book’s section 9.4 and in Tsitsiklis and Van Roy’s 1997 theorem for a single endless trajectory of an irreducible aperiodic Markov chain), linear semi-gradient TD(0) converges to a particular point called the TD fixed point.1516 At that point the stationary-distribution-weighted mean squared value error is at most 1 / (1 − γ) times the smallest achievable, which can be large when γ is near 1.15 They add a condition: “Critical to these convergence results is that states are updated according to the on-policy distribution. For other update distributions, bootstrapping methods using function approximation may actually diverge to infinity.”15

The deadly triad

Sutton and Barto name the three ingredients whose combination risks divergence:17

  • Function approximation, a scalable way of generalising from a state space much larger than the available memory and computation.
  • Bootstrapping, where update targets include existing estimates, as in dynamic programming and TD methods, instead of relying only on actual rewards and complete returns.
  • Off-policy training, learning from a distribution of transitions other than that produced by the target policy. Sweeping uniformly through all states, as dynamic programming does, counts as off-policy.

Their statement is that the risk of instability and divergence arises whenever all three are combined, that it is not due to control or to learning (it occurs also in planning with a known environment), and that if any two are present but not all three, instability can be avoided.17 The book credits Tsitsiklis and Van Roy (1997) with a thorough analysis.17

Baird’s counterexample is the standard demonstration. It is an episodic MDP with seven states and two actions, zero reward on every transition, and γ = 0.99. The values are approximated linearly with eight weights, and the true value function, zero everywhere, is exactly representable with all weights at zero. The feature vectors are linearly independent, so the problem looks favourable. Yet off-policy semi-gradient TD(0), started from nonzero weights as in the book’s Figure 11.2 (zero weights are already a fixed point), makes the weights diverge to infinity for any positive step size. The instability persists when an expected, dynamic-programming-style update replaces sampling. For that expected variant, changing only the distribution of updates to the on-policy distribution restores convergence to a solution with the bound above.17

Neural networks: the proofs no longer apply

For nonlinear approximators the sources do not offer a general guarantee. The Nature DQN paper opens its explanation of the method with the statement that reinforcement learning “is known to be unstable or even to diverge when a nonlinear function approximator such as a neural network is used to represent the action-value” function, and gives three causes: correlations in the sequence of observations, small updates to Q that change the policy and therefore the data distribution, and correlations between the action values and their target values.18 The earlier 2013 paper is blunter about what it does and does not have: after reporting no divergence in its experiments, it concludes that “despite lacking any theoretical convergence guarantees” the method trains large networks in a stable manner.14 The 2017 PPO paper says in its introduction that Q-learning with function approximation “fails on many simple problems” and is poorly understood.19 For the deep Q-learning methods compared here, the justification is experimental, with proofs available mainly for tabular and linear cases and for the separate policy-gradient route covered below. The 2015 paper also acknowledges earlier stable methods such as neural fitted Q-iteration, which it judged too inefficient for large networks.18

TD-Gammon

Tesauro’s 1995 article describes a multilayer network trained by TD(λ) while the program plays against itself, scoring each legal move and choosing the highest. The best raw-encoding network had 40 hidden units and 200,000 training games and reached “a strong intermediate level of play approximately equal to Neurogammon”, the winner of the 1989 International Computer Olympiad backgammon championship. Versions with hand-designed features added “greatly surpassed Neurogammon and all other previous computer programs”. Against human experts, version 1.0 lost a net 13 points in 51 games, about a quarter point per game.20 Sutton and Barto call it one of the most impressive applications of reinforcement learning to that date, a straightforward combination of TD(λ) and a multilayer network trained by backpropagating TD errors.21

The result showed that the combination of TD learning and a neural network can work in one domain. The divergence results above explain why it need not work in general.

Policy gradients

Learning the policy directly

Value-based methods derive a policy from learned values. Policy-gradient methods represent the policy itself with parameters θ and adjust θ by gradient ascent on expected return. Sutton, McAllester, Singh and Mansour (1999) set out the motivation: the value-function approach is oriented toward deterministic policies whereas, as they argue, the optimal policy is often stochastic (a deterministic optimal policy always exists in a finite, fully observed discounted MDP, so their point concerns other settings), and an arbitrarily small change in an action’s estimated value can make it be selected or not, which they identify as a key obstacle to convergence assurances. With a policy that is a smooth function of its parameters the action probabilities change smoothly.22 Sutton and Barto conclude that stronger convergence guarantees are available for policy-gradient methods than for action-value methods.23

REINFORCE

Williams’s 1992 paper defined the REINFORCE class of algorithms. In each trial every parameter w is incremented by

Δw = α (r − b) e

Here r is the immediate reinforcement, b is a baseline conditionally independent of the unit’s output given the weights and input, and α is a nonnegative rate that depends at most on the unit’s weights and time. The characteristic eligibility e = ∂ ln g / ∂w is the derivative of the log-probability of the unit’s sampled output with respect to w. The name is an acronym for “REward Increment = Nonnegative Factor × Offset Reinforcement × Characteristic Eligibility”.24 Its Theorem 1 states that for any REINFORCE algorithm the inner product of the expected update and the gradient of expected reinforcement is nonnegative, is zero only when that gradient is zero if all rates are positive, and that if all rates equal a constant α the expected update equals α times the gradient.24 The abstract says the algorithms adjust weights along the gradient of expected reinforcement “without explicitly computing gradient estimates”, for immediate reinforcement and “certain limited forms of delayed-reinforcement tasks”.24 Sutton and Barto give the textbook form for the undiscounted episodic case (with discounting, a factor γ^t also appears for the start-state objective): θ ← θ + α G ∇π(A|S,θ) / π(A|S,θ), the return times the gradient of the probability of the action taken divided by that probability, which equals the return times the gradient of its logarithm.23

A two-armed bandit worked by hand

A bandit is a one-state problem. Let the agent choose arm 1 with probability p = σ(θ), where σ is the logistic function, and arm 0 otherwise. For a Bernoulli-logistic unit whose single input is fixed to 1, Williams’s equation 7 gives the characteristic eligibility as (y − p), where y = 1 if arm 1 was chosen and y = 0 otherwise.24 Start at θ = 0, so p = 0.5, with α = 0.1 and no baseline.

Case A: arm 1 pays 1, arm 0 pays 0. If arm 1 is drawn, Δθ = 0.1 × 1 × (1 − 0.5) = 0.05. If arm 0 is drawn the reward is 0 and Δθ = 0. The expected update is 0.5 × 0.05 = 0.025. Expected reward is σ(θ), whose derivative at θ = 0 is p(1 − p) = 0.25, and α × 0.25 = 0.025. The expected sample update equals α times the true gradient, as Theorem 1 says.

Case B: arm 1 pays 11, arm 0 pays 10. If arm 1 is drawn, Δθ = 0.1 × 11 × 0.5 = 0.55. If arm 0 is drawn, Δθ = 0.1 × 10 × (−0.5) = −0.5. The expectation is 0.5 × 0.55 + 0.5 × (−0.5) = 0.025, still correct, but individual updates are 0.55 or −0.5, about twenty times the average and of opposite signs. Learning by this rule is noisy.

Case C: subtract a baseline b = 10.5, the average reward, chosen without looking at which arm was drawn. If arm 1 is drawn, Δθ = 0.1 × (11 − 10.5) × 0.5 = 0.025. If arm 0 is drawn, Δθ = 0.1 × (10 − 10.5) × (−0.5) = 0.025. Every update equals the true expected update and the variance is zero in this example. A baseline, in Sutton and Barto’s words, leaves the expected value of the update unchanged but can have a large effect on its variance. For MDPs the baseline should vary with the state, and one natural choice is an estimate of the state value.23 The baseline is allowed because the subtracted term sums to zero over actions.23 Williams’s paper says its analysis offers no basis for comparing baselines, though reinforcement comparison is generally believed to perform better.24

REINFORCE as stated is a Monte Carlo method: it uses the full return, so it is defined for episodic tasks and updates after the episode. Sutton and Barto show that the expected update points along the performance gradient and note that Monte Carlo returns can have high variance and lead to slow learning.23

The policy gradient theorem with function approximation

The expected return depends on the policy through two routes: the actions chosen and the states visited. The second looks hard to differentiate. Sutton, McAllester, Singh and Mansour showed that it need not be. In Theorem 1 the performance gradient sums, over states and actions, the action value times the gradient of the action probability. The state weights are discounted visitation from the designated start state or, for average reward, the stationary distribution, assumed to exist independently of the initial state under each policy. The paper stresses that there are no terms for the effect of policy changes on the distribution of states.22 Theorem 2 says that an approximate action-value function f_w that satisfies the weighted residual orthogonality of the paper’s Eq. 3 (a stationary point of a squared-error fit gives it), and is compatible with the policy parameterisation (its gradient with respect to w equals the gradient of the log-probability of the policy), can replace the true action value in that expression. Theorem 3 uses this result for the specified idealised compatible-critic updates. With bounded rewards, bounded second derivatives and step sizes that go to zero with an infinite sum, performance converges and its gradient tends to zero. A vanishing gradient can occur at several types of stationary point, including a local maximum.22

With a different structure, then, a convergence proof survives function approximation. It covers a stated idealised algorithm with a compatible critic and guarantees a vanishing gradient, which falls short of a guarantee for every deep policy-gradient system.

Actor-critic methods and PPO

REINFORCE with a learned baseline uses the value of the state before the action. Actor-critic methods go further, applying the learned state-value function also to the next state. The reward plus the discounted value of the next state forms a one-step return that assesses the action. The learner of values is the critic and the policy is the actor. The one-step return can reduce variance and lets updates happen before the episode ends, at the cost of bias. Sutton and Barto note that the bias comes from using the critic’s estimate, and that the actor would be biased even if the critic were learned by Monte Carlo.23

Proximal policy optimisation (PPO), proposed by Schulman and colleagues in 2017, is a practical descendant. The paper describes methods that alternate between sampling data by interaction with the environment and optimising a surrogate objective by stochastic gradient ascent, with an objective that allows multiple epochs of minibatch updates, where standard policy gradient performs one update per data sample. Its clipped objective takes the minimum of the probability-ratio-weighted advantage and the same quantity with the ratio clipped to the interval [1 − ε, 1 + ε], with ε = 0.2 given as an example. The authors say the clipped objective is a pessimistic (lower) bound on the unclipped surrogate; it does not bound the true return or strictly cap policy movement. They say it gives much of the benefit of trust-region policy optimisation (TRPO) with first-order optimisation only.19 The paper’s tests are on simulated robot locomotion and Atari play.19 The article on reinforcement learning from human feedback covers language-model training, which is outside the scope of this reader.

Deep reinforcement learning, 2013 to 2017

DQN on Atari

The 2013 paper from DeepMind by Mnih and colleagues claims to present “the first deep learning model to successfully learn control policies directly from high-dimensional sensory input using reinforcement learning”: a convolutional neural network trained with a variant of Q-learning, with preprocessed frame stacks as network input and estimated action values as output. It applied the method to seven Atari 2600 games with no adjustment of architecture or learning algorithm, and reports that it outperforms all previous approaches on six of them and surpasses a human expert on three.14 The six-of-seven comparison is the authors’ own, and Table 1 qualifies it: the competing HNeat method produces deterministic policies and was scored on its single best episode.14 The paper’s Table 1 gives average scores for DQN under an ε = 0.05 policy and comparison scores for a human player: Breakout 168 against 31, Pong 20 against −3, Enduro 470 against 368, Beam Rider 4092 against 7456, Seaquest 1705 against 28010. The paper states that DQN beat the human expert on Breakout, Enduro and Pong, came close on Beam Rider, and was far from human performance on Q*bert, Seaquest and Space Invaders, which it attributes to those games requiring a strategy extending over long time scales.14

Two devices made training with a neural network workable. The first is experience replay: the agent stores its transitions (s, a, r, s’) in a replay memory and trains on minibatches sampled at random from it. The 2013 paper’s reasons: consecutive samples are strongly correlated, and without replay the current parameters determine the next training data, so feedback loops may arise. Learning from replayed data requires learning off-policy, which Q-learning does.14 Training rewards were clipped to 1 and −1.14

The second device, added in the 2015 Nature paper, is a separate target network. The loss for each minibatch is the squared difference between the Q value and the target r + γ max Q(s’, a’; θ⁻) (just r on terminal transitions), where θ⁻ are parameters of a copy of the network that are updated from the main network only every C steps and held fixed between.18 The stated purpose is to reduce correlations between the action values and their targets. The input is a stack of four 84 × 84 frames, followed by three convolutional layers and a fully connected layer of 512 units, with one output per valid action.18

The 2015 paper reports 49 Atari 2600 games with the same algorithm, architecture and hyperparameters, a separate network trained for each game. DQN, whose network observes preprocessed stacks of frames with score changes as reward, “was able to surpass the performance of all previous algorithms and achieve a level comparable to that of a professional human games tester across a set of 49 games” in the abstract. In the text, it outperforms the best existing reinforcement learning methods on 43 of the games and reaches more than 75% of the human score on more than half of the games, 29 in all, with scores normalised so that random play is 0% and the professional tester 100%.25 Training used 50 million frames, around 38 days of game experience, per game, and the paper’s ablations, disabling the replay memory, the separate target network and the convolutional architecture in turn, report detrimental effects on performance.18

The 2013 paper states that the method lacks theoretical convergence guarantees. The training reward was clipped, which the 2015 paper says could affect performance because the agent cannot distinguish rewards of different magnitude.18

AlphaGo

The AlphaGo paper (Silver and colleagues, published online 27 January 2016 and in the issue of 28 January 2016) gives, in its full text, a tree of about 250^150 sequences, as above, and describes two general ways to cut it down: truncate the search depth with an approximate value function, and narrow the breadth by sampling moves from a policy.13 Its program trained its neural networks in stages, then combined them with Monte Carlo tree search (MCTS).26

  1. A supervised policy network. A 13-layer convolutional network was trained on 30 million positions from the KGS Go Server to predict the moves of strong human players. It predicted held-out expert moves with 57.0% accuracy using all input features and 55.7% using only raw board position and move history, against 44.4% for the best result of other groups at the date of submission. A faster rollout policy reached 24.2% accuracy at 2 microseconds per move against 3 milliseconds for the network.13
  2. A reinforcement learning policy network. The RL policy network, initialised with the supervised network’s weights, was trained by policy-gradient reinforcement learning from games against randomly selected earlier versions of itself, with the update proportional to the gradient of the log-probability of the move times the game outcome. Without any search, it won more than 80% of games against the supervised network and 85% against Pachi, an open-source Monte Carlo search program that runs 100,000 simulations per move.13
  3. A value network. A network with a similar architecture and a single output was trained by regression on state-outcome pairs to minimise the mean squared error between its prediction and the game result, targeting the outcome of games played by the RL policy. Training on complete games from the KGS data made it memorise results, because successive positions differ by one stone but share a target (test error 0.37 against 0.19 on training). A new set of 30 million distinct positions, one per game, gave mean squared errors of 0.226 on the training set and 0.234 on the test set. Each game began with moves from the supervised policy, followed by one uniformly sampled legal move and then a continuation from the reinforcement-learned policy.13
  4. Search. Monte Carlo tree search used the supervised policy network’s output as prior probabilities for move selection and a mixture of the value network and fast-rollout results to evaluate positions. The paper notes that the supervised policy performed better in the search than the stronger RL policy, presumably because humans select a diverse beam of promising moves, while the value function derived from the RL policy performed better than one derived from the supervised policy. In comparisons among AlphaGo variants, a mixture weight of 0.5 did best, winning at least 95% of games against variants that used the value network or the rollouts alone; the value-network-only variant still used tree search and supervised priors and exceeded all other Go programs.13

The AlphaGo results, as stated in the paper: single-machine AlphaGo, with 40 search threads, 48 CPUs and 8 GPUs, won 494 of 495 games, 99.8%, against other Go programs. A distributed version with 1,202 CPUs and 176 GPUs won 77% of games against the single-machine version. Against Fan Hui, a professional 2 dan and winner of the 2013, 2014 and 2015 European Go championships, the distributed version played a formal five-game match over 5 to 9 October 2015 and won 5 games to 0. The paper states this was the first time a computer Go program defeated a human professional player without handicap in the full game of Go.13 The abstract states the 99.8% win rate and the 5 to 0 result as well.26

The system combines both families in this article: policy-gradient learning for one network, regression of values for another, and a search step that plans with the game’s known rules, which is model-based planning with a given model. The article on world models covers the case where the model is learned.

Security: the reward and the observation

Two properties of the method matter here: the agent optimises the reward it is given, which may differ from what the designer intended, and the policy acts on its observations, which an adversary may control.

Reward misspecification and reward hacking

In the formalism the scalar reward is what gets optimised, and it may differ from the designer’s goal. A designer cannot hand over intent directly, so writes a measurable proxy. Amodei and colleagues’ 2016 paper “Concrete Problems in AI Safety” lists five practical problems of accident risk: wrong objective functions (“avoiding side effects” and “avoiding reward hacking”), an objective too expensive to evaluate frequently (“scalable supervision”), and undesirable behaviour during learning (“safe exploration” and “distributional shift”).27 The reward hacking section opens: “Imagine that an agent discovers a buffer overflow in its reward function: it may then use this to get extremely high reward in an unintended way.” From the agent’s point of view, the paper says, such a hack is a valid strategy like any other for achieving reward.27

The paper’s running example is a cleaning robot. If it is rewarded for not seeing any messes, it might close its eyes instead of cleaning; if rewarded for cleaning messes, it may create work to earn more reward. It lists ways the problem arises, with its own examples:27

  • Partially observed goals. The robot sees only part of the office, so rewards based on what it sees can be hacked.
  • Complicated systems. The authors suggest that the chance of a viable hack grows with the complexity of the agent and its strategies.
  • Abstract rewards. A learned reward function may be vulnerable to adversarial counterexamples, or to hacking if it has pathologically high values along at least one dimension.
  • Goodhart’s law. A metric that correlates with the goal under ordinary conditions stops doing so under strong optimisation. The paper’s example is a robot rewarded for consuming bleach, which pours it down the drain.
  • Environmental embedding. The reward is computed somewhere, on a sensor or in hardware, and a sufficiently broad agent could tamper with it, which the paper calls “wireheading”.

The article on AI alignment covers specification gaming in more depth, and the article on reinforcement learning from human feedback covers how learned reward models are exploited in language-model training. Where a higher-scoring loophole is feasible and the learner discovers it, the optimiser has an incentive to use it, because the reward is its only measure. The paper’s examples illustrate possible failures; they do not show that a learned policy always finds the global maximiser.

Attacks on policies through observations

A trained policy is a function from observations to actions, often a neural network, so it can share the weaknesses of neural networks, including adversarial examples. Huang, Papernot, Goodfellow, Duan and Abbeel (2017) tested this on policies trained for Atari games. Their threat model gives the adversary the ability to introduce small perturbations to the input of the policy (the paper applies them after Atari preprocessing; its section 5.1 describes the policy selection and evaluation rollouts), and they characterise the vulnerability across tasks and training algorithms.28

The method is the fast gradient sign method (FGSM): linearise the policy’s cost around the current input and move each pixel by at most ε in the direction that most increases it. For a linear function w·x with each pixel changed by no more than ε the optimal perturbation is ε times the sign of w. The authors also use ℓ2- and ℓ1-constrained versions. They tested four games (Chopper Command, Pong, Seaquest, Space Invaders) and three training algorithms (A3C, TRPO and DQN), using the top performers among five policies trained per game and algorithm, at most three.28

The white-box findings, in the paper’s words, are that “regardless of which game the policy is trained for or how it is trained” it is possible to significantly decrease the policy’s performance with relatively small perturbations. “Notably, in many cases an ℓ∞-norm FGSM adversary with ε = 0.001 decreases the agent’s performance by 50% or more”, and when converted to 8-bit image encodings these perturbations are indistinguishable from the originals. The ℓ1 adversary, which changes a few pixels by large amounts, gave the largest decrease for the same ε. Policies trained with DQN were more susceptible than those from A3C and TRPO, especially to ℓ∞ perturbations on Pong, Seaquest and Space Invaders.28 The paper reports effect sizes as curves of average return against ε, not in tables, so only the statements above are given.

For the black-box case they tested two levels of adversary knowledge. In transfer across policies, the adversary knows the training environment, algorithm, hyperparameters and network architecture, but not the random initialisation of the target. In transfer across algorithms it additionally does not know the training algorithm or hyperparameters. The result: “the less the adversary knows about the target policy, the less effective the adversarial examples are”. Transfer across algorithms is less damaging than transfer across policies, which is less damaging than a white-box attack, but for most games transfer across algorithms still significantly decreases performance, especially for larger ε. For ℓ1 adversaries, transfer across algorithms is nearly as effective as no transfer for most game and algorithm combinations.28 Within the tested models, games and access assumptions, the authors conclude that it is fairly easy to confuse such policies with computationally efficient adversarial examples even in black-box scenarios, and that this has significant implications for deployment of neural network policies.28

What to ask of an RL-driven or agentic security product

These questions are the writer’s inferences from the sources and are not requirements from any standard.

  1. What is the reward, written down, and who can change it? A system rewarded for closing alerts, blocking connections or reducing detected incidents can improve the number without improving security. In the cleaning-robot example, rewarding the absence of visible mess invites closing its eyes; the analogue is a detector rewarded for not seeing incidents. Ask what behaviour would raise the reward without serving the goal, and whether anyone has tried to find it.
  2. Is the reward computed from a channel the system can influence? If it comes from the same logs or telemetry the agent’s actions can alter, the environmental-embedding loophole is open.
  3. What does the policy observe, and who controls it? Huang and colleagues perturbed Atari frames. A security product’s inputs (telemetry, logs, packets, files, text) are an analogy to that setting, and some of them may be authored by the adversary; the study does not test them, so they need their own evidence. Ask whether perturbation of those inputs has been tested, including perturbations crafted against a different model, since transfer is the route this study tested.
  4. How was it evaluated, and on what distribution? The Amodei paper lists distributional shift as a separate problem: the agent meets situations unlike its training.27 Ask for results on data collected after training, from other environments and under adversarial conditions, and not only on a held-out slice of the training distribution.
  5. Is learning continuing in production? Two questions are separate: who can shape the experience a learner trains on, and what damage an exploratory action can do when the system is deployed. The tabular control results discussed above require continued coverage during training. Amodei and colleagues use safe exploration for the problem of limiting harmful consequences when a learner tries unfamiliar actions.27
  6. What guarantees are claimed, and for what setting? Watkins and Dayan’s discounted theorem assumes a finite table, bounded rewards, a discount below one and suitable step sizes for every state-action pair.11 Sutton’s 1988 prediction result assumes a fixed absorbing Markov process, linearly independent state observation vectors and a sufficiently small positive constant step size.10 These settings differ from a deep network acting in an adversarial environment.

Agents built on language models can face the same two problems: how they were rewarded in training, and what they read at run time, which other parties may write. The articles on AI agents and tool use and on MITRE ATLAS, the catalogue of attacks on AI systems, treat those settings.

Annotated reference list

Bellman (1954), The theory of dynamic programming

Bulletin of the American Mathematical Society 60, pages 503 to 515. DOI 10.1090/S0002-9904-1954-09848-8. Archived copy: https://web.archive.org/web/20250303015638if_/https://www.ams.org/journals/bull/1954-60-06/S0002-9904-1954-09848-8/S0002-9904-1954-09848-8.pdf (opens in a new tab).7 Claimed: the principle of optimality gives a rule that selects a decision from the current state and the number of stages remaining. Mattered: it states the principle of optimality and derives the functional equations of dynamic programming. Later: the stochastic MDP formulation and policy iteration come from Bellman’s 1957 and Howard’s 1960 work, as Sutton and Barto credit.4

Sutton (1988), Learning to predict by the methods of temporal differences

Machine Learning 3, pages 9 to 44. Author’s copy with erratum: http://incompleteideas.net/papers/sutton-88-with-erratum.pdf (opens in a new tab).10 Claimed: TD methods, driven by differences between successive predictions, with convergence for linear TD(0) on absorbing Markov chains. Mattered: the paper describes its results as the first formal results in the theory of TD methods. Later: convergence with probability 1 in the tabular case under decreasing step sizes, and the off-policy divergence results of the deadly triad.917

Watkins and Dayan (1992), Q-learning

Machine Learning 8, pages 279 to 292. Author-hosted copy: https://www.gatsby.ucl.ac.uk/~dayan/papers/cjch.pdf (opens in a new tab).11 Claimed: with bounded rewards, discount below 1 and learning rates whose per-pair sums diverge while their squares converge, Q-learning converges to the optimal action values with probability 1 if all actions are sampled repeatedly in all states and values are stored in a table. Later: DQN applied it with a nonlinear network, outside the theorem’s conditions.14

Williams (1992), Simple statistical gradient-following algorithms for connectionist reinforcement learning

Machine Learning 8, pages 229 to 256. Author-hosted copy: https://people.cs.umass.edu/~barto/courses/cs687/williams92simple.pdf (opens in a new tab).24 Claimed: REINFORCE algorithms follow the gradient of expected reinforcement in expectation without computing gradient estimates. Mattered: a foundational policy-gradient paper, cited by the 1999 authors as implying their gradient expression. Later: the 1999 theorem gives a gradient form with a critic and notes that Williams’s theory can be viewed as implying it.22

Tesauro (1995), Temporal difference learning and TD-Gammon

Communications of the ACM 38(3), March 1995. https://www.bkgm.com/articles/tesauro/tdl.html (opens in a new tab).20 Claimed: a TD(λ)-trained network playing itself reached strong intermediate play from a raw encoding and near-expert play with added features. Later: the deadly-triad analysis explains why such success is not guaranteed.17

Sutton, McAllester, Singh and Mansour (1999), Policy gradient methods for reinforcement learning with function approximation

Advances in Neural Information Processing Systems 12. Abstract page: https://papers.nips.cc/paper/1999/hash/464d828b85b0bed98e80ade0a5c43b0f-Abstract.html (opens in a new tab). Paper: https://proceedings.neurips.cc/paper_files/paper/1999/file/464d828b85b0bed98e80ade0a5c43b0f-Paper.pdf (opens in a new tab).22 Claimed: the policy gradient theorem without a derivative of the state distribution, a compatible function approximator, and convergence of performance, with the gradient tending to zero, for an idealised policy iteration scheme. Later: PPO trades such conditions for practical performance.19

Mnih et al. (2013), Playing Atari with deep reinforcement learning

arXiv 1312.5602, 19 December 2013: https://arxiv.org/abs/1312.5602 (opens in a new tab).14 Claimed: a convolutional network trained by Q-learning with experience replay learns control from pixels on seven Atari games. Mattered: it reported learning from pixels on seven games with one architecture. Later: the 2015 study used 49 games and added the target network.25

Mnih et al. (2015), Human-level control through deep reinforcement learning

Nature 518, pages 529 to 533, 25 February 2015. DOI 10.1038/nature14236. https://www.nature.com/articles/nature14236 (opens in a new tab); full text also hosted by DeepMind at https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf (opens in a new tab).2518 Claimed: a deep Q-network reaches a level comparable to a professional human games tester across 49 games. Later: the PPO paper in 2017 names deep Q-learning, vanilla policy gradient and trust-region methods as the leading approaches and aims at more robustness.19

Nature 529, pages 484 to 489, 28 January 2016. DOI 10.1038/nature16961. https://www.nature.com/articles/nature16961 (opens in a new tab); full text also hosted by DeepMind at https://storage.googleapis.com/deepmind-media/alphago/AlphaGoNaturePaper.pdf (opens in a new tab).2613 Claimed: supervised and reinforcement-learned policy networks and a value network, combined with Monte Carlo tree search, beat the European champion 5 to 0 and won 99.8% of games against other programs. Later: Sutton and Barto’s case-study chapter covers AlphaGo Zero among its successors.21

Sutton and Barto (2018), Reinforcement Learning: An Introduction, second edition

MIT Press, 2018; free full text from the authors: http://incompleteideas.net/book/the-book-2nd.html (opens in a new tab); PDF: http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab).29 Claimed and covered: the standard statements of the MDP framework, dynamic programming, TD, Q-learning, Sarsa, function approximation, the deadly triad and policy gradients. Later: the book itself is the later synthesis of the 1990s results above.1

Huang, Papernot, Goodfellow, Duan and Abbeel (2017), Adversarial attacks on neural network policies

arXiv 1702.02284, 8 February 2017: https://arxiv.org/abs/1702.02284 (opens in a new tab).28 Claimed: FGSM-style adversarial examples degrade trained policies, in white-box settings and by transfer in black-box settings. Mattered: it extended adversarial examples from classifiers to agents acting over time. Later: no later work is assessed here; the article on MITRE ATLAS covers how attacks on AI systems are catalogued.

Schulman, Wolski, Dhariwal, Radford and Klimov (2017), Proximal policy optimization algorithms

arXiv 1707.06347, 20 July 2017: https://arxiv.org/abs/1707.06347 (opens in a new tab).19 Claimed: a clipped surrogate objective allows multiple epochs of minibatch updates and keeps much of TRPO’s benefit with simpler implementation. Later: the article on reinforcement learning from human feedback covers language-model training.

Amodei, Olah, Steinhardt, Christiano, Schulman and Mané (2016), Concrete problems in AI safety

arXiv 1606.06565, 21 June 2016: https://arxiv.org/abs/1606.06565 (opens in a new tab).27 Claimed: five research problems about accidents in learning systems, among them reward hacking, framed by a buffer overflow in the reward function. Later: the article on AI alignment covers specification gaming.

Conclusion

Bellman equations express consistency between current and future values. Dynamic programming uses them with a known model, and temporal-difference learning and Q-learning estimate values from sampled transitions. Policy-gradient methods differentiate expected performance directly, and Monte Carlo REINFORCE needs no Bellman bootstrap. The discounted tabular Q-learning theorem requires bounded rewards, a discount below one and suitable step sizes applied across infinitely many updates of every pair. The linear TD(0) prediction result assumes on-policy sampling along with feature and step-size conditions. The 1999 policy iteration result uses a compatible critic. The DQN and AlphaGo studies demonstrate their results empirically. In the cited security examples, a reward can favour behaviour the designer did not intend, and changes to observations can degrade a learned policy’s performance. A practitioner who can state the reward, the observation channel and the evaluation distribution of a system is in a position to ask whether it can be trusted.

Footnotes

  1. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., sections 1.1, 2.2, 3.1 and 8.2 (trial-and-error and delayed reward; model-free versus model-based; exploration versus exploitation; early history, Samuel 1959, Shannon 1950), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
  2. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., chapter 3 (reward hypothesis, discounted return, Markov property), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3
  3. David Abel et al., On the expressivity of Markov reward, arXiv:2111.00876, 1 November 2021. https://arxiv.org/abs/2111.00876 (opens in a new tab) ↩
  4. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., chapter 1 early history and the bibliographical notes to chapters 3 and 4 (Bellman 1957, Howard 1960, Denardo 1967), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
  5. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., chapter 4 (value functions, iterative policy evaluation, policy iteration, value iteration), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
  6. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., section 3.6 (Bellman optimality equation and optimal policies), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩
  7. Richard Bellman, The theory of dynamic programming, Bulletin of the American Mathematical Society 60, 503-515, November 1954 (address of 3 September 1953), DOI 10.1090/S0002-9904-1954-09848-8; Internet Archive capture of the AMS PDF, 3 March 2025. https://web.archive.org/web/20250303015638if_/https://www.ams.org/journals/bull/1954-60-06/S0002-9904-1954-09848-8/S0002-9904-1954-09848-8.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4
  8. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., section 4.7 (efficiency of dynamic programming) and its note on the phrase curse of dimensionality, full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2
  9. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., chapter 6 (Monte Carlo and TD prediction, bootstrapping, convergence of TD(0)) and chapter 12 (eligibility traces), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
  10. Richard S. Sutton, Learning to predict by the methods of temporal differences, Machine Learning 3, 9-44, 1988 (author’s copy with erratum). http://incompleteideas.net/papers/sutton-88-with-erratum.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
  11. Christopher J. C. H. Watkins and Peter Dayan, Technical note: Q-learning, Machine Learning 8, 279-292, 1992 (theorem on page 282). https://www.gatsby.ucl.ac.uk/~dayan/papers/cjch.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  12. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., sections 6.4 to 6.5 (Sarsa, Q-learning, convergence statements, cliff walking), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3
  13. Silver et al., Mastering the game of Go with deep neural networks and tree search, full text hosted by DeepMind, 2016. https://storage.googleapis.com/deepmind-media/alphago/AlphaGoNaturePaper.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
  14. Volodymyr Mnih et al., Playing Atari with deep reinforcement learning, arXiv:1312.5602, 19 December 2013. https://arxiv.org/abs/1312.5602 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
  15. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., sections 9.3 to 9.5 (state aggregation, linear methods, TD fixed point, error bound), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4
  16. John N. Tsitsiklis and Benjamin Van Roy, An analysis of temporal-difference learning with function approximation, IEEE Transactions on Automatic Control 42(5), May 1997. https://rll.berkeley.edu/deeprlcourse/docs/TsitsiklisVanRoy-1997.pdf (opens in a new tab) ↩
  17. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., sections 11.2 and 11.3 (Baird’s counterexample, the deadly triad) and chapter 11 notes, full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  18. Volodymyr Mnih et al., Human-level control through deep reinforcement learning, Nature 518, 529-533, 2015, full text hosted by DeepMind. https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
  19. John Schulman et al., Proximal policy optimization algorithms, arXiv:1707.06347, 20 July 2017. https://arxiv.org/abs/1707.06347 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  20. Gerald Tesauro, Temporal difference learning and TD-Gammon, Communications of the ACM 38(3), March 1995. https://www.bkgm.com/articles/tesauro/tdl.html (opens in a new tab) ↩1 ↩2
  21. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., chapter 16 (section 16.1 TD-Gammon; table of contents entries for sections 16.5 and 16.6), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2
  22. Richard S. Sutton, David McAllester, Satinder Singh and Yishay Mansour, Policy gradient methods for reinforcement learning with function approximation, Advances in Neural Information Processing Systems 12, 1999. https://proceedings.neurips.cc/paper_files/paper/1999/file/464d828b85b0bed98e80ade0a5c43b0f-Paper.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
  23. Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., chapter 13 (policy gradient theorem, REINFORCE, baselines, actor-critic), full PDF, 2018. http://incompleteideas.net/book/RLbook2020.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  24. Ronald J. Williams, Simple statistical gradient-following algorithms for connectionist reinforcement learning, Machine Learning 8, 229-256, 1992. https://people.cs.umass.edu/~barto/courses/cs687/williams92simple.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  25. Volodymyr Mnih et al., Human-level control through deep reinforcement learning, Nature 518, 529-533, 25 February 2015, DOI 10.1038/nature14236. https://www.nature.com/articles/nature14236 (opens in a new tab) ↩1 ↩2 ↩3
  26. David Silver et al., Mastering the game of Go with deep neural networks and tree search, Nature 529, 484-489, 28 January 2016, DOI 10.1038/nature16961. https://www.nature.com/articles/nature16961 (opens in a new tab) ↩1 ↩2 ↩3
  27. Dario Amodei et al., Concrete problems in AI safety, arXiv:1606.06565, 21 June 2016. https://arxiv.org/abs/1606.06565 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  28. Sandy Huang, Nicolas Papernot, Ian Goodfellow, Yan Duan and Pieter Abbeel, Adversarial attacks on neural network policies, arXiv:1702.02284, 8 February 2017. https://arxiv.org/abs/1702.02284 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  29. Richard S. Sutton and Andrew G. Barto, Reinforcement Learning: An Introduction, second edition, MIT Press, 2018 (authors’ page with the free full text). http://incompleteideas.net/book/the-book-2nd.html (opens in a new tab) ↩