Error Bounds & Stopping Rules
From the size of the last update to a guarantee on the greedy policy.
Value iteration's values converge only in the limit, yet you act with a policy, and you have to stop somewhere. Everything computable while sweeping, the last change, the smallest and the largest change, turns into a guarantee. This lesson proves the classic ones: a Bellman-residual bound that is tight to the constant, MacQueen's monotone bounds that certify an optimal policy in the two-state world after 4 backups, while the standard rule needs 36 just to guarantee a loss below 1, a test that discards actions for good, and how many sweeps pass before the greedy policy is exactly optimal.
What you’ll learn
- Prove that a policy greedy for any loses at most , where is the Bellman residual of , and show that the constant cannot be improved.
- Derive MacQueen's lower and upper bounds on from two successive iterates, and the span-based stopping rule they give.
- Use the bounds to eliminate suboptimal actions permanently.
- Bound the number of sweeps until the greedy policy is exactly optimal through the action gap, and state what is known about the complexity of value iteration.
What the Bellman residual guarantees
Three distances matter: the error of the values, ; the loss of the policy you act with, ; and the Bellman residual . Only the last can be computed without knowing , and value iteration gets it for free: the residual of is the last change, . The theorem turns it into a guarantee about the greedy policy.
Both value functions are near . Write and , where by greediness. Each first term is at most times the distance being bounded:
Split the loss with one-step operators. The triangle inequality alone would give . To earn the factor , use for an optimal and , and add and subtract and :
The outer terms are times averages of vectors bounded in step 1, and the middle term is nonpositive because maximizes the lookahead under . Since :
Which policy does value iteration certify? Apply the theorem to two tables. The actions used by backup are greedy for , whose residual is , so they lose at most . The greedy policy for does better: the residual of is , so it loses at most . The classic rule therefore certifies both policies, the newer one with loss below .
Value iteration with reports a last change . What is guaranteed about the policy greedy for , the one the last backup used?
- It loses at most 0.05
- It loses at most 0.45
- It loses at most 0.9
- It loses at most 0.81
Show the answer
C. It loses at most 0.9
Its residual is , so its loss is at most . The policy greedy for the newer table has residual at most , hence the smaller bound .
Monotone bounds from two iterates
The residual bound uses only the largest change. MacQueen (1966) noticed that the smallest change carries information too. Let and , and write for the span of a vector.
is monotone ( implies ) and shifts constants, . So gives , and by induction each later change is at most . Summing them:
For the lower bound, run the same argument with the policy's own operator. , and is monotone and shifts constants too, so its iterates from , which converge to , change by at least at step :
Subtract the outer bounds. Since the span never exceeds twice the max norm, the span rule is never worse than the residual rule, and it is far better when the changes are nearly uniform:
| Backup | Change | Span | Lower bound on | Upper bound on | Loss bound for the policy used |
|---|---|---|---|---|---|
| 1 | 1 | 9 | |||
| 2 | 0.9 | 8.1 | |||
| 3 | 0.1 | 0.9 | |||
| 4 | 0 | 0 |
Why does the span collapse? Once the backups keep using one policy , the changes evolve linearly, , and averaging by a stochastic matrix shrinks the span by its ergodicity coefficient, with . Under (go, stay) both states move to , the two rows of are equal, , and one backup makes the change uniform. The max norm contracts by ; the span contracts by . In an episodic task the change at a terminal state is always 0, so the span is at least the largest change and the monotone bounds add little: they pay off in continuing problems whose chains mix.
Backup 3 changes the values by . With and the smallest and largest entries of that change, how wide is MacQueen's bracket, , in each state?
Show the answer
0.9
. The bracket already contains , while the a posteriori bound only says , which happens to be the true error.
Eliminating actions for good
Bounds on also expose actions that can never be optimal. Suppose componentwise. Since is at most the same expression with in place of , an action whose optimistic value falls below the pessimistic value of its state is beaten by some other action there, whatever later sweeps reveal.
In the two-state world, after backup 3 the bracket is , :
- go in : , eliminated;
- stay in : , it survives for now.
After backup 4, , and stay goes too. Only (go, stay) remains, so optimality is certified by elimination after 4 backups.
Each eliminated action makes every later sweep cheaper. In MacQueen's 1967 trial on Howard's automobile replacement problem, the test cut the computation of the dynamic programming routine by, conservatively, 75%. Puterman (1994, §6.7) combines elimination with modified policy iteration and a sharper stopping criterion.
How many sweeps until the policy is optimal?
Values converge only in the limit, but the greedy policy of value iteration becomes optimal after finitely many sweeps. The reason is a margin. The action gap of an MDP is the smallest amount by which a non-optimal action falls short of the best:
Let be the lookahead the greedy policy maximizes. It differs from by times an average of :
An optimal action and a non-optimal action have true values at least apart, so the lookaheads still rank them correctly. No non-optimal action can be greedy, and the sweep count follows from .
In the two-state world the bound gives sweeps; the truth is 2. More importantly, it depends on , which can be arbitrarily small in MDPs of a fixed size: How Fast Is Policy Iteration? gives a two-state example in which value iteration needs as many sweeps as you like, and Feinberg and Huang (2014) proved that value iteration is not strongly polynomial, even for a fixed .
For data written with bits, though, the gap cannot be arbitrarily small. solves a linear program (Linear Programming for MDPs), so its entries are rationals of size polynomial in the input, and so is any nonzero gap. Tseng (1990) turned this into a bound: value iteration finds an optimal policy after a number of sweeps polynomial in , , and , so it runs in polynomial time for a fixed . Littman, Dean and Kaelbling (1995) explain the argument and give three-state MDPs on which value iteration needs on the order of sweeps to find the optimal policy.
Key takeaways
- A policy greedy for any loses at most , with the Bellman residual of (Williams & Baird); the bound is attained in the two-state world. Value error and error give and (Singh & Yee).
- The actions used by backup lose at most ; the policy greedy for at most .
- MacQueen's bounds bracket between and ; the span of the change contracts by , so in mixing problems the bounds certify optimal policies very early, and they let suboptimal actions be eliminated for good.
- The greedy policy is optimal once . With -bit data that takes a number of sweeps polynomial in , , and (Tseng), but no bound in and alone exists.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
The residual bound is called tight. What does that mean?
- Every greedy policy loses exactly
- It holds with equality in the limit only
- No smaller constant works for all MDPs: some value function with residual has a greedy policy that loses arbitrarily close to that much
- It is the best bound in terms of
Show the answer
C. No smaller constant works for all MDPs: some value function with residual has a greedy policy that loses arbitrarily close to that much
Tightness is a worst-case statement. In the two-state world, has residual and a greedy policy that loses . Many other value functions with the same residual have optimal greedy policies.
Why can MacQueen's span-based rule stop much earlier than the max-norm rule?
- It uses a smaller tolerance
- Once the backups keep one policy, the changes are averaged by its transition matrix, which can make them uniform much faster than they shrink, so their span falls far below their maximum
- It needs fewer arithmetic operations per sweep
- It ignores the states whose values change most
Show the answer
B. Once the backups keep one policy, the changes are averaged by its transition matrix, which can make them uniform much faster than they shrink, so their span falls far below their maximum
The bounds depend on , not on . A uniform change, however large, is pure information: it says exactly how far the values still have to move. The span contracts by , the max norm only by ; in the two-state world the span hits 0 at backup 4.
MacQueen's test drops action in state when , with . Why may it be dropped forever?
- Because the test chains , so is strictly worse than optimal
- Because had the smallest lookahead in the last sweep
- Because and will not change again
- It may not: dropped actions must be rechecked every sweep
Show the answer
A. Because the test chains , so is strictly worse than optimal
The test compares 's most optimistic value with the state's most pessimistic one. If even the optimistic estimate loses, is proven, and later sweeps cannot change a fact about .
Why does value iteration's greedy policy become exactly optimal after finitely many sweeps, although its values never reach ?
- Because there are only finitely many policies, so the greedy policy must repeat
- Because a finite MDP has a positive action gap , and once the value error is below no non-optimal action can be greedy
- Because value iteration is policy iteration in disguise
- It does not: the greedy policy is only -optimal
Show the answer
B. Because a finite MDP has a positive action gap , and once the value error is below no non-optimal action can be greedy
Errors in the values shift the lookaheads by less than once , and that cannot reverse a ranking separated by at least . The number of sweeps grows as shrinks, which is why value iteration is not strongly polynomial.
Further reading
- R. J. Williams & L. C. Baird, "Tight performance bounds on greedy policies based on imperfect value functions," Technical Report NU-CCS-93-14, Northeastern University (1993); also in Proceedings of the Tenth Yale Workshop on Adaptive and Learning Systems (1994).
- S. P. Singh & R. C. Yee, "An upper bound on the loss from approximate optimal-value functions," Machine Learning 16(3), 227–233 (1994).
- J. MacQueen, "A modified dynamic programming method for Markovian decision problems," Journal of Mathematical Analysis and Applications 14, 38–43 (1966); and "A test for suboptimal actions in Markovian decision problems," Operations Research 15(3), 559–561 (1967).
- M. L. Puterman, Markov Decision Processes: Discrete Stochastic Dynamic Programming, §6.6–6.7 (Wiley, 1994).
- M. L. Littman, T. L. Dean & L. P. Kaelbling, "On the complexity of solving Markov decision problems," Proceedings of UAI (1995).