TL;DR
Q-learning updates each action's value toward a target that takes the best estimated value of the next state. When those estimates are noisy, the maximum of several noisy numbers tends to be too large. The result is a systematic overestimate, called overestimation bias, even when every individual estimate is right on average.
The effect is small in a toy problem and can be large in a real one with many actions and a function approximator. It matters because the errors feed into the next update and can compound.
Builds on: Q-Learning, Jensen's Inequality, Expected Value · Leads to: Double Q-Learning, Deep Q-Network
Where it's used
Game-playing agents with many moves. When a deep Q-network learns to play Atari games, it has to choose among a fixed set of controller actions and estimate each one's value from a neural network. Van Hasselt and colleagues (2016) showed that the standard DQN target overestimated action values in many games, with estimates above the returns the agent actually obtained later.
Trading and resource allocation. A learning agent that picks among many order sizes, or among many routes, and learns from noisy returns, will tend to believe its best-looking option is better than it is. The bias pushes the agent toward options whose estimates happened to be lucky.
Robot control with noisy sensors. A robot that estimates the value of many possible motions from noisy simulations inherits the same upward bias in the best motion. Any method that takes a maximum over noisy estimates faces this issue, which is why the fix is studied as a general statistical problem and not only a Q-learning one.
How it works
We follow one update of a tiny agent. The agent is in state , takes action , gets reward 0, and lands in state . In there are two actions, and both have true value 0.5. The agent's estimates are noisy: each estimate is the true value plus a random error of or , each with probability one half, independently.
- Setup. Discount , reward . The true best value at is , so the correct target for the update is .
- Noisy estimates. The agent holds two estimates for . Suppose they come out as . Check: each is the true 0.5 plus or minus 0.2.
- Max. Q-learning takes the larger estimate, , and forms the target . Check: the target is above the true target of 0.45 even though neither estimate is systematically high.
- Repeat over all noise patterns. The four equally likely patterns give maxima . Their average is , which is higher than the true best value 0.5.
- Result. The expected target is , not . The gap of is the overestimation bias that Q-learning would carry into the update.
flowchart LR T[True values 0.5, 0.5] --> N[Add noise plus or minus 0.2 to each] N --> M[Take the max over actions] M --> A[Average of the max is above 0.5]
The math
Step 2 in symbols: the noisy estimates
Let be the true action value and the estimate, where is noise with mean zero. Here , each with probability one half.
Step 3 in symbols: the target
The Q-learning target for a transition with reward is
The update moves toward . The correct target would use in place of .
Step 4 in symbols: the expected maximum
Take the case of actions, with the same true value and independent noise . The expected maximum estimate is
Since every has mean zero, each individual estimate is unbiased, so for each . But the maximum is not unbiased. For with equal probability, the maximum is only if every action draws , which has probability . So
Check with and : the formula gives , which matches Step 4 of the walkthrough, where the average maximum was 0.6 against a true value of 0.5.
Why it is Jensen's inequality
The maximum function is convex: for any two numbers, , and the gap grows with the spread. Jensen's inequality says that for a convex function , . Here is the maximum over a vector of random estimates, so . The left side is the true best value, and the right side is what Q-learning uses.
Worked examples
Two actions with true values 0 and 0. Each estimate is with probability one half, independently.
- The four equally likely noise patterns are , , , .
- Their maxima are .
- Average maximum: .
- The true best value is 0, so the bias is .
- Check with the formula: .
Interpretation: each estimate is unbiased, yet the best of two is too high by half a unit on average.
State has two actions, both with true value . The estimates are the true value plus noise of . Reward and discount for the transition into .
- Correct target: .
- Equally likely estimate pairs: , , , .
- Maxima: . Average: .
- Expected Q-learning target: .
- Check with the formula: with and is , so the average maximum is , as in step 3.
- The target is inflated by . Every update that passes through this state carries that error.
Interpretation: the reward is correct, the discount is correct, and the value estimates are unbiased. The bias comes entirely from taking the maximum.
A pricing agent chooses among prices. Suppose its estimates for all prices are unbiased, with noise as before, and all prices truly have the same value at the next state. Take .
- Expected maximum noise with : .
- Bias of the max: about , close to the full noise size, because with ten actions the best draw almost always contains at least one positive error.
- Inflation of the target: .
- Compare with the walkthrough: with two actions the inflation was . The noise is the same as before, so multiplying the number of actions by five has nearly doubled the bias, from 0.1 to 0.2.
- The lesson: the bias grows with the number of actions and with the noise, and a large action set is where it hurts most.
Try it: with actions and noise , what is the inflation of the Q-learning target when ? Answer: for the maximum's bias, so the target is inflated by .
Common mistakes and tradeoffs
It is tempting to think that an unbiased estimate of each action's value gives an unbiased estimate of the best value. In fact the maximum of unbiased estimates is biased upward, because the maximum rewards positive noise and discards negative noise. The estimates can each be exact on average and the maximum still be too high.
It is tempting to think that overestimation bias only happens with bad estimators. In fact it happens with perfectly good ones, and it is a consequence of choosing and evaluating with the same noisy numbers. Better estimators reduce the noise, but the maximum still inherits whatever noise remains.
It is tempting to think that the bias is harmless because the agent will correct it later. In fact the inflated target is fed back into later updates, so the error can persist and grow when values bootstrap from each other, which is what happens in deep Q-learning with function approximation.
When to worry: many actions, noisy returns, and function approximation. The bias is small in tabular problems with few actions and many visits.
When not to worry: a small problem where each action is tried often and the estimates are accurate, so the noise is small.
Fixes and alternatives: Double Q-Learning uses two estimators, one to pick the best action and the other to evaluate it, which breaks the link between the noise in the choice and the noise in the value. Deep versions use a Target Network to slow the change of the target, which reduces but does not remove the bias. Averaging several estimates is also an option, at the cost of more samples.
History
The problem was noticed in the early days of reinforcement learning with function approximation. Thrun and Schwartz (1993) analysed the effect of the maximum over noisy action values and showed that it can systematically inflate estimates. Q-learning itself, from Watkins in 1989 with the convergence analysis by Watkins and Dayan in 1992, was proved to converge in the tabular case, where the bias is small and vanishes with enough visits.
Van Hasselt (2010) proposed double Q-learning, which decouples action selection from evaluation. When deep Q-networks became practical in 2015, the same problem was found to be severe with neural function approximators. Van Hasselt, Guez and Silver (2015, published 2016) showed that the standard DQN target overestimated values, and that a double-estimator target reduced both the bias and the error in performance on many Atari games.
Recap
- Q-learning's target uses the maximum over estimated action values in the next state.
- Each estimate may be unbiased, but the maximum of noisy estimates is biased upward, by an amount that grows with the noise and with the number of actions.
- Jensen's inequality explains why: the maximum is convex, so the maximum of an average is no larger than the average of the maximum.
- The inflated target propagates through bootstrapped updates, so the bias can compound.
- Double Q-learning and related methods separate action selection from evaluation to reduce it.
Read next: Double Q-Learning for the standard fix, and Deep Q-Network for where the bias matters most.
Check yourself
QuestionRecall: why can each action's estimate be correct on average while the maximum over actions is still too high?Show answer
The maximum is a convex function of the estimates. It takes the largest draw, so positive noise is kept and negative noise is discarded. Averaged over noise patterns, the largest value sits above the true best value, by Jensen's inequality.
QuestionCompute: two actions with true value 0 and noise of plus or minus 0.5, each sign equally likely and independent. What is the expected maximum estimate?Show answer
Four equally likely patterns give maxima . Their average is . The formula agrees.
QuestionWhy does the bias grow as the number of actions grows, even when each action's noise is the same?Show answer
With more actions there are more chances that at least one estimate draws a large positive error. The probability that every estimate draws a negative error falls as , so the expected maximum rises toward the full noise size .
QuestionApplied: a team sees a Q-learning agent with 50 actions whose values keep climbing above what its test episodes earn. What is the likely cause, and what is one change to try?Show answer
The likely cause is overestimation bias: the target takes the maximum over 50 noisy estimates, and that maximum is inflated. One change to try is double Q-learning, which chooses the action with one set of estimates and evaluates it with another, so the choice's noise does not inflate the value.