Policy Iteration as Newton’s Method
Why policy iteration converges in so few steps.
Value iteration closes a fraction of the gap per sweep, so at it crawls. Policy iteration finishes in a handful of rounds almost regardless of . The explanation is that policy iteration is Newton's method on the Bellman equation (Puterman & Brumelle, 1979). This lesson derives the correspondence, proves when convergence is quadratic and why it is finite in finite MDPs, and follows the idea to the Riccati equation of linear–quadratic control, where every round squares the error, and to lookahead search.
What you’ll learn
- Show that one round of policy iteration is exactly a Newton step on , with the greedy policy supplying the Jacobian .
- Prove the error identity behind Newton's convergence, derive a quadratic rate under a Lipschitz condition, and explain finite termination through the action gap.
- Compute policy iteration and value iteration exactly on a scalar linear–quadratic control problem, and see quadratic against linear convergence.
- Interpret modified policy iteration as an inexact Newton method and one-step lookahead as a Newton step from a learned value.
One round of policy iteration is one Newton step
Newton's method solves by linearizing: . Apply it to the Bellman optimality equation written as .
is piecewise affine. On the set of value functions for which a deterministic policy is greedy, , so there and the Jacobian is . Where several policies are greedy at once, has a kink, and the matrix of any greedy policy is an element of its generalized Jacobian: this is the setting of semismooth Newton methods (Gargiani et al., 2022).
Greediness means . Write and , and substitute:
The two terms cancel, leaving the solution of the greedy policy's evaluation equations:
The picture in one dimension. Take a single state in which action pays and then continues with probability (otherwise the episode ends). Then is a maximum of lines: a convex, piecewise-linear function of the number . The optimal value is where it crosses the diagonal. A Newton step follows the line of the action that is greedy at to the diagonal, landing at , the value of always taking .
Because every line lies below the maximum, the landing point is never beyond ; and because decreases, each step moves up. So the iterates rise monotonically and stop after finitely many steps, since there are finitely many lines. In dimensions the same convexity, applied state by state, gives the monotone improvement of policy iteration.
Quadratic convergence and finite termination
The identity. For any policy , . Solve for and take :
The bracket. It is nonnegative because maximizes. For the upper bound, use that is greedy at , so , that is :
Norms. is nonnegative with max norm , which gives item 3; the Lipschitz condition turns it into the quadratic bound. Item 1 is the policy improvement theorem plus the identity, whose right-hand side is nonnegative.
Finite MDPs: the extreme case of fast convergence. Let be the action gap, the smallest amount by which a non-optimal action falls short: . If , every action that is greedy for is optimal, because one-step lookaheads move by at most . So near the greedy matrix is (or another optimal policy's), item 3 gives , and Newton's method stops exactly.
Combined with (policy iteration is never behind value iteration), policy iteration stops after at most about rounds. That is fast when the gap is large, but the count depends on , which can be arbitrarily small. Bounds that depend only on , and need a different argument (How Fast Is Policy Iteration?).
Newton's method usually converges only in the limit. Why does policy iteration on a finite MDP stop exactly after finitely many rounds?
- Because the discount factor is less than 1
- Because is piecewise affine with finitely many pieces: once the greedy policy is optimal, the Newton step lands exactly on
- Because each evaluation is done by exact Gaussian elimination, with no rounding error
- Because the values are integers
Show the answer
B. Because is piecewise affine with finitely many pieces: once the greedy policy is optimal, the Newton step lands exactly on
On each piece, is affine and Newton's step solves it exactly. Once the iterate is within of , the greedy policy is optimal, its piece contains , and the next step lands there. Policy improvement also forbids revisiting a piece, and there are finitely many pieces.
Newton beyond finite MDPs: the Riccati equation
Quadratic convergence shows itself when there are infinitely many policies. Take the simplest linear–quadratic regulator: state , cost per step to be minimized, no discount. A linear policy has cost , and the optimal solves the Riccati equation , that is . So , the golden ratio, with optimal gain .
- Value iteration is the Riccati recursion from .
- Policy iteration (Hewer, 1971; Kleinman, 1968, in continuous time) evaluates a gain exactly, , and improves it greedily, , from a stabilizing start .
| Value iteration | Its error | Policy iteration | Its error | |
|---|---|---|---|---|
| 0 | 0 | |||
| 1 | 1 | |||
| 2 | ||||
| 3 | ||||
| 4 |
Value iteration's error in this example shrinks by a constant factor per step. What is that factor, the derivative of at ?
Show the answer
0.15
The derivative is , which at is (using ). It equals , the square of the optimal closed-loop factor : value iteration forgets its initial guess as fast as the optimally controlled system forgets its initial state, squared. Linear convergence at a rate set by the dynamics, against Newton's squaring.
Hewer's iteration needs a stabilizing initial gain, here ; every later gain then stays stabilizing and decreases monotonically to at a quadratic rate. The same structure, an exact evaluation (a Lyapunov equation) followed by a greedy gain update, is policy iteration for LQR in any dimension, and its convergence analysis is the matrix version of the theorem above (Optimal Control & Model Predictive Control).
Inexact Newton steps: partial evaluation and lookahead
Modified policy iteration solves the Newton system only approximately, with sweeps started from : . The solve error is , a relative error of at most . In the theory of inexact Newton methods (Dembo, Eisenstat & Steihaug, 1982), solving each Newton system to a relative residual bounded by a forcing term gives local linear convergence, and forcing terms that shrink to 0 give superlinear convergence. Here, once the greedy policy is optimal, each iteration contracts the error by exactly ; letting grow recovers policy iteration's finish. λ-policy iteration replaces the Newton matrix by , a damped step between the fixed-point iteration () and Newton () (Modified & Generalized Policy Iteration).
Lookahead from a learned value. An agent with an offline-trained value that acts by one-step lookahead uses the policy greedy for , whose value is precisely the Newton step from . The error identity holds for any , not only for policy values: is controlled by , which vanishes once is within half an action gap. Bertsekas (2022) uses this to explain why online lookahead, such as AlphaZero's search at play time, improves so sharply on an imperfect trained value: near the solution, the error after the lookahead is of higher order than the error before it.
Key takeaways
- A round of policy iteration is a Newton step on : the greedy policy's matrix is the Jacobian of the active affine piece, and solving the linearization gives exactly the greedy policy's value.
- , bounded by ; Lipschitz greedy transitions give quadratic convergence, and in finite MDPs an action gap gives exact termination.
- On the scalar LQR the golden ratio appears: policy iteration's iterates are Fibonacci ratios whose index doubles per round (error squared), value iteration's gain two indices per step (error times ).
- Modified and λ-policy iteration are inexact or damped Newton methods, and acting by lookahead on a learned value is a Newton step from it.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
In policy iteration's Newton step from , which matrix plays the role of the Jacobian of ?
- , from the current policy
- , from an optimal policy
- The Hessian of
- , from the policy greedy for
Show the answer
D. , from the policy greedy for
is affine on the region where is greedy, with slope . Solving the linearization there gives , the next policy's value.
In the scalar LQR example, policy iteration's errors are about , and . About how large is the next one?
Show the answer
C.
Quadratic convergence squares the error up to a constant: , times a constant of about 0.065, gives , matching the exact iterate .
A finite MDP has action gap . Policy iteration reaches . What happens next?
- The next policy is optimal, so
- The error keeps shrinking by a factor per round
- The greedy policy may still pick non-optimal actions
- Policy iteration must switch to value iteration to finish
Show the answer
A. The next policy is optimal, so
One-step lookaheads computed from are within of the true , so no non-optimal action can win the argmax. The greedy policy is optimal and its exact evaluation is .
In the cost-minimizing LQR example, Hewer's policy iteration produces , decreasing to . Why does it approach from above?
- Because the initial gain was chosen too large
- Because value iteration approaches from below and the two must differ
- Each is the cost of an actual stabilizing policy, so it is at least , and improvement never makes it worse
- Because Newton's method always overshoots
Show the answer
C. Each is the cost of an actual stabilizing policy, so it is at least , and improvement never makes it worse
Policy iteration only ever evaluates real policies, whose costs are at least the optimal cost, and the improvement theorem (for costs: never larger) makes the sequence monotone. Value iteration from instead counts the optimal cost of ever-longer horizons, which is why it approaches from below.
Further reading
- M. L. Puterman & S. L. Brumelle, "On the convergence of policy iteration in stationary dynamic programming," Mathematics of Operations Research 4(1), 60–69 (1979).
- M. L. Puterman, Markov Decision Processes: Discrete Stochastic Dynamic Programming, ch. 6 (Wiley, 1994).
- G. A. Hewer, "An iterative technique for the computation of the steady state gains for the discrete optimal regulator," IEEE Transactions on Automatic Control 16(4), 382–384 (1971).
- M. Gargiani, A. Zanelli, D. Liao-McPherson, T. H. Summers & J. Lygeros, "Dynamic programming through the lens of semismooth Newton-type methods," IEEE Control Systems Letters (2022).
- D. P. Bertsekas, Lessons from AlphaZero for Optimal, Model Predictive, and Adaptive Control (Athena Scientific, 2022).