Reinforcement Learning: An Introduction III: The Policy Improvement Theorem and Policy IterationTextbook
Why policy improvement matters
Reinforcement learning methods search for good behaviour by alternating two activities: estimating how good the current behaviour is, and changing the behaviour in the direction those estimates suggest. Sutton and Barto call this pattern generalized policy iteration and use it as the organizing idea of their textbook (Sutton & Barto 2018, §4.6). Its mathematical justification is a single result of Chapter 4, the policy improvement theorem (p. 78): a comparison made one step ahead, at each state separately, certifies that a changed policy is at least as good everywhere. Policy iteration, value iteration, Monte Carlo control with ε-greedy policies (Chapter 5), Sarsa and Q-learning are all motivated by it.
The chapter's results go back to the foundations of dynamic programming: the Bellman optimality equation (Bellman 1957), and policy iteration with its finite termination for discounted finite Markov decision processes (Howard 1960). Standard modern treatments are Puterman 1994, Ch. 6, and Bertsekas 2012, Vol. II, Ch. 1.
Setting
A finite Markov decision process has a finite state set , a finite nonempty action set , a finite reward set and dynamics : for each state and action , a probability distribution over the next state and reward (Eqs. (3.2)–(3.3)). A policy gives probabilities of choosing each action in each state; a deterministic policy is a map .
Fix a discount rate . The state-value function of is the expected discounted return
and the action-value function is defined from it by (4.6):
the value of taking once in and following afterwards. A policy is optimal if its value is at least that of every policy at every state, and the optimal value function is . A deterministic policy is greedy with respect to if for all (4.9).
Formalization targets
Goal: the policy improvement theorem, (4.7)–(4.8), p. 78
For deterministic policies ,
and at every state where the hypothesis is strict, the conclusion is strict at that same state.
Milestones
- Iterative policy evaluation (4.5), p. 74. From any , the iterates converge to .
- Greedy improvement (4.9), p. 79. A greedy with respect to satisfies (4.7), hence .
- The stochastic case, p. 79. For stochastic , with as in (5.2), the theorem holds as stated, strictness included.
- Equality forces optimality, p. 79. If a greedy has , then solves the Bellman optimality equation (4.1), , and and are optimal.
- Policy iteration, p. 80. For every sequence of deterministic policies with greedy with respect to : each step is a strict improvement unless is optimal, and from some on every is optimal with .
- Value iteration (4.10), p. 83. is attained by one policy at all states, and from any the iterates converge to .
Significance
The results. The policy improvement theorem turns a local test into a global guarantee: it is enough to check, state by state, that one step of the new policy followed by the old one does no worse than the old one. Combined with the finiteness of the set of deterministic policies, it yields the finite termination of policy iteration and, with the equality case, the existence of a deterministic optimal policy. The stochastic form is what Chapter 5 invokes for ε-greedy control. Value iteration is the other classical way to compute .
Formalizing them. All of these results are classical and proved in the literature cited above; they are not open. The textbook presents them informally ("we chose not to produce a rigorous formal treatment", p. xiii): the improvement theorem is argued by an unbounded chain of expansions, and the policy evaluation and value iteration convergence claims are stated without proof. The mission makes each claim precise with explicit hypotheses and asks for machine-checked proofs against the book's own model with four-argument dynamics and stochastic policies. Related platform results use different models (cost minimization with deterministic policies in Bertsekas's Dynamic Programming; an expected-reward kernel and an assumed fixed point in Foundations of Machine Learning), and none states the policy improvement theorem itself.
Difficulty
The book's proof expands with (4.6) and reapplies (4.7) indefinitely, ending with "". Made rigorous, the chain is an inequality between truncated returns plus a remainder , and the passage to the limit needs the remainder to vanish and the truncated returns to converge to . Since is defined here as a series of expected rewards under the induced Markov chain, connecting it to the one-step quantities requires first establishing the Bellman equation for from that series. The strictness part does not follow from the weak inequality alone: strictness at one state must be shown to survive the averaging over later states, which requires tracking the contribution of the first step exactly. The policy iteration statement additionally requires handling ties: a greedy step taken from an optimal policy can move to a different optimal policy, so the sequence need not become constant.
Formalization scope
All objects live in the namespace SuttonBartoRL.DP. States and actions are finite types, actions nonempty where a maximum is taken; one action set serves all states (footnote 3, p. 48). Rewards form a finite set , and the dynamics are a function whose values off are never used. Policies are stochastic; deterministic policies are embedded as policies that choose one action with probability one.
Committed conventions:
- Discount throughout. The book also allows when "eventual termination is guaranteed" (p. 74) but never states that hypothesis precisely; the episodic case with a terminal state is out of scope. This is the only restriction relative to the text.
- from returns. , with the state transition matrix of and its expected one-step reward. is defined by (4.6), as the book does. The Bellman equation (4.4) is not assumed. Defining as the fixed point of a Bellman operator would make the goal an order property of that operator and is excluded.
- is the real supremum over all stochastic policies; the value iteration item also asserts it is attained. Optimality of a policy means dominance over all stochastic policies.
- Greedy means is any maximizer of ; tie-breaking is arbitrary and may differ between iterations.
- Stochastic case. The book only says the theorem "carries through as stated"; the meaning is taken from the book's (5.2), p. 101.
- Policy iteration is the idealized sequence with exact evaluation. The item does not claim that the boxed pseudocode on p. 80 stops, which it may fail to do under ties (Exercise 4.4, p. 82).
- Convergence of iterates is in the product topology on , equivalent to the sup norm for finite .
In-place (asynchronous) sweeps (§4.5) and truncated policy iteration are not formalized.
Needed infrastructure: summability of discounted series of bounded expected rewards, the Bellman equation for derived from the return definition, contraction arguments in the sup norm on , and finiteness of the set of deterministic policies. The definitions here duplicate those of the series' Chapter 3 mission and are intended to be merged with them; lemmas about , the Bellman equation and contraction are reusable by every later mission of the series, and contributions of such lemmas are welcome.
Selected references
- R. S. Sutton and A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018, ISBN 9780262039246, Chapter 4. http://incompleteideas.net/book/the-book-2nd.html
- R. Bellman, Dynamic Programming, Princeton University Press, 1957. https://press.princeton.edu/books/paperback/9780691146683/dynamic-programming
- R. A. Howard, Dynamic Programming and Markov Processes, MIT Press, 1960. https://mitpress.mit.edu/9780262080095/dynamic-programming-and-markov-processes/
- M. L. Puterman, Markov Decision Processes: Discrete Stochastic Dynamic Programming, Wiley, 1994. https://doi.org/10.1002/9780470316887
- D. P. Bertsekas, Dynamic Programming and Optimal Control, Vol. II, 4th ed., Athena Scientific, 2012. http://www.athenasc.com/dpbook.html