Maximization Bias & Double Q-Learning
Why the max of noisy estimates overestimates, and how two estimators fix it.
Choose the best of ten restaurants from a handful of reviews each, and the winner will usually disappoint: you picked it partly because its reviews were lucky. Decision analysts call this the optimizer's curse. In Q-learning it is built into every target, and bootstrapping copies it from state to state. This lesson measures the bias exactly, shows how it compounds and when it changes what the agent does, proves that splitting the data between two estimators reverses the sign of the error, and compares the corrections that deep RL inherited.
What you’ll learn
- Prove that the maximum of unbiased estimates overestimates the maximum of their means, characterize when it does not, and compute the bias exactly for uniform and Gaussian noise.
- Explain how bootstrapping propagates and compounds the bias, and when it changes the greedy policy.
- Prove that the double estimator never overestimates in expectation, compute both estimators' biases in a two-action example, and explain why no estimator can be unbiased for every problem.
- Compare Double Q-learning, Double DQN, weighted double estimators, maxmin Q-learning and clipped double Q by the bias they aim for.
The optimizer’s curse, exactly
Let actions have true values and unbiased estimates , . Q-learning's target uses as an estimate of , and the order of the maximum and the expectation matters.
So the bias vanishes only if noise never lifts another estimate above a best action's. That is the typical situation only when the gaps between actions are large compared with the noise; maximization bias is worst when many actions are nearly tied. For equal means it can be computed in closed form.
Let with independent and uniform on . The maximum of independent uniforms on has distribution function and mean . Rescaling to :
One action: no bias. Two: . Ten: , almost the whole noise amplitude. A Q-learning target multiplies it by ; Thrun and Schwartz used this formula to quantify the overestimation that noise from a function approximator causes in Q-learning.
| Actions | 2 | 3 | 5 | 10 | 20 | 100 |
|---|---|---|---|---|---|---|
| , | 0.564 | 0.846 | 1.163 | 1.539 | 1.868 | 2.508 |
| 1.177 | 1.482 | 1.794 | 2.146 | 2.448 | 3.035 |
In Sutton and Barto's maximization-bias MDP, B's ten actions each pay , and going right from A is worth exactly 0. If each of B's actions is estimated by the average of rewards, how large must be before the expected largest estimate drops below 0?
Show the answer
237
Each average has standard deviation , so the expected largest is about , which is negative once : rewards for each of the ten actions. With four rewards each it is about . Until B has been sampled thousands of times, its maximum looks better than the sure 0 to the right.
How bootstrapping spreads the bias
In the maximization-bias MDP the reward for going left is 0, so is updated toward : B's maximization bias becomes A's estimation error, and it competes with . That is why Q-learning first goes left most of the time. In general every backup adds its own maximization bias to the bias it inherits from the next state.
Suppose each backup's maximum overestimates by on average, and the next state's estimates are already too high by . The error at the next state back is
Unrolling, the errors grow toward a fixed point. A state that loops back to itself reaches it directly, since then :
With the per-backup bias is multiplied by 19. Van Hasselt (2010) ran Q-learning on roulette: 170 bets, each losing about 5 cents per dollar, all returning to the same state, plus walking away for $0; with every bet is worth about . After 100,000 synchronous rounds of updates, Q-learning valued every bet at about $22.6 with step sizes and about $9.6 with . Double Q-learning, introduced below, did not suffer from significant underestimation there.
When does it change what the agent does? A bias shared equally by all actions leaves the greedy policy alone; the damage comes from bias that differs between actions, through more noise, more actions or longer paths behind some choices. Thrun and Schwartz (1993) made this quantitative for deterministic tasks with a single reward of 1 at a goal. Along an optimal path the correct values are at distance from the goal, so consecutive states differ by , a margin that shrinks geometrically with distance. If each backup overestimates by about , the values stop increasing toward the goal once , and a greedy agent that far out can no longer tell which way is better. They turned this into conditions on and on the noise level under which Q-learning is expected to fail, consistent with the failures they observed with noisy function approximators at large in simulated robot navigation.
Two estimators: the double estimator errs downward
The bias comes from using the same noise twice: once to select the apparently best action, once to value it. Split the data into two independent sets, with estimates and , select with one and value with the other: with .
depends only on , which is independent of , so conditioning on the selection does not change 's mean:
Subtract the best value. The bias is minus the expected gap of the action selected by , its expected regret:
Every term is nonpositive and vanishes exactly for best actions, so the inequality is strict iff a suboptimal action is selected with positive probability. With equal means, the optimizer's-curse setting, the double estimator is exactly unbiased; with different means and overlapping noise it underestimates.
| True means | Single estimator | Double estimator |
|---|---|---|
Double Q-learning (van Hasselt, 2010) applies the double estimator inside the TD target. It keeps two tables; on each step a fair coin picks one, say , and
with the roles swapped otherwise; the behavior can be ε-greedy in . Each sample updates only one table, but both tables guide the behavior. In a finite MDP with , if every pair is visited infinitely often, both tables receive infinitely many updates with Robbins–Monro steps, and rewards have finite variance, then and both converge to with probability 1. The proof writes 's target as Q-learning's target plus and shows that this perturbation dies out, the same device that proves SARSA's convergence under GLIE.
A family of corrections
Function approximation made the problem worse and the fixes more varied. Van Hasselt, Guez and Silver (2016) found that DQN's value estimates on Atari games were often far above the discounted returns its own policies achieved, and proposed Double DQN; later methods made the size and even the sign of the bias a tunable choice.
| Method | Bootstrap value at | Bias it aims for |
|---|---|---|
| Q-learning | upward | |
| Double Q-learning (van Hasselt, 2010) | none for tied actions; downward when gaps are small relative to the noise | |
| Double DQN (van Hasselt, Guez & Silver, 2016) | reduced upward bias: the online network selects, the target network evaluates, and the two are not independent | |
| Weighted double (Zhang, Pan & Kochenderfer, 2017) | , | between single () and double (); grows with the spread of through a constant |
| Maxmin Q-learning (Lan, Pan, Fyshe & White, 2020) | over tables | is Q-learning; larger pushes the bias down, so some makes it about zero |
| Clipped double Q in TD3 (Fujimoto, van Hoof & Meger, 2018) | deliberately downward |
Is overestimation always bad? Optimism can help exploration, as optimistic initial values and upper confidence bounds show; but those are calibrated to shrink as data accumulate, while the maximum's bias tracks whatever noise the estimates have, and with a self-loop it feeds on itself, as in roulette. Pessimism is not free either: Double Q-learning's slowness when left became better is the price of a downward bias, and TD3 accepts that price because an actor exploits any overestimated action directly. In offline RL, where the agent cannot test its optimism, pessimism becomes the design principle (Offline RL).
Key takeaways
- , with equality only if a best action's estimate is almost surely the largest; for equal means the bias is with uniform noise and about for ten Gaussian estimates.
- Bootstrapping passes each state's bias to its predecessors and adds a new one at every backup; with a self-loop the bias settles at , and a bias that differs between actions can reverse the greedy choice far from the reward.
- Selecting with one estimate and valuing with an independent one gives a bias equal to minus the expected gap of the selected action: never upward, zero for tied actions, downward otherwise. With Gaussian estimates no estimator is unbiased for every configuration of means.
- Double Q-learning converges to in the tabular case and removes the upward bias, at the cost of slowness when a better action is hidden in noise; Double DQN, weighted double estimators, maxmin Q-learning and TD3's clipped double Q choose different points between over- and underestimation.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Each action's value estimate is unbiased. When is the largest estimate an unbiased estimate of the largest true value?
- Whenever the estimates are independent
- Whenever the noise is Gaussian
- Only when, with probability 1, a best action's estimate is the largest one
- Always, since each estimate is unbiased
Show the answer
C. Only when, with probability 1, a best action's estimate is the largest one
for a best action , the expectation of a nonnegative quantity. It is zero only if is the maximum almost surely, which essentially requires the gaps to dwarf the noise.
A state's only action leads back to itself, and each backup's maximum overestimates by on average. With , about how large does the estimate's error become?
- It grows without bound
Show the answer
C.
The error satisfies , so . Bootstrapping feeds the bias back into its own target at every step, and the effective horizon multiplies it.
The double estimator selects and reports , with independent of . What is its bias?
- Zero, always, because is unbiased
- Minus the expected gap of the selected action: zero when the means are equal, negative when a worse action can be selected
- The same as the single estimator's, but with half the variance
- Positive but smaller than the single estimator's
Show the answer
B. Minus the expected gap of the selected action: zero when the means are equal, negative when a worse action can be selected
Independence gives , a weighted average of the means, which falls short of the best mean by the expected gap of the selection. It is exactly unbiased only when no suboptimal action is ever selected, for instance when all means are equal.
TD3 bootstraps from the minimum of two critics' estimates. What does that choice accept, and why?
- An unbiased target, because the minimum of two unbiased estimates is unbiased
- An upward bias, to encourage exploration
- A deliberate downward bias, because the actor exploits overestimated actions directly while underestimated ones are merely avoided
- No bias, because the two critics are trained on the same data
Show the answer
C. A deliberate downward bias, because the actor exploits overestimated actions directly while underestimated ones are merely avoided
The minimum of two noisy estimates is biased downward, just as the maximum is biased upward. In actor–critic methods an overestimated action attracts the actor and the error feeds on itself; an underestimated one is merely avoided. TD3 trades the first failure for the milder second.
Further reading
- S. Thrun & A. Schwartz, "Issues in using function approximation for reinforcement learning," Proceedings of the 1993 Connectionist Models Summer School (1993).
- H. van Hasselt, "Double Q-learning," Advances in Neural Information Processing Systems 23 (2010).
- H. van Hasselt, A. Guez & D. Silver, "Deep reinforcement learning with double Q-learning," AAAI Conference on Artificial Intelligence (2016).
- J. E. Smith & R. L. Winkler, "The optimizer's curse: Skepticism and postdecision surprise in decision analysis," Management Science 52(3), 311–322 (2006).
- Q. Lan, Y. Pan, A. Fyshe & M. White, "Maxmin Q-learning: Controlling the estimation bias of Q-learning," International Conference on Learning Representations (2020).