Unit 9 of 10 · about 4 hours · derive, implement

Maximization bias, double estimators and dueling networks

The max operator prefers noise. Double estimation removes the preference without new data, and dueling separates state goodness from action choice.

You'll be able to

  • Derive the double-estimator split and show the bias it removes on a noisy example.
  • Implement double DQN as a two-line target change evaluated on identical samples.
  • Write the dueling aggregation and explain what the mean subtraction identifies.

Covers

Maximization bias and double estimatorsDueling networks
1

Read

In this order, only the parts listed

0 of 4 done

  1. Overestimation and the double targetDeep Reinforcement Learning with Double Q-Learning

    Overoptimism due to estimation errors (Theorem 1 and Figure 1: errors of any source push the max upward, and in practice more actions mean more overestimation) and the target in the Double DQN section of arXiv:1509.06461v3, whose sections are unnumbered: select with online weights, evaluate with target weights. Read the Atari table as the paper's reported numbers.

  2. Overestimation plots and double Q in lecture formBerkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Value-Based RL and Q-Learning in Practice

    Lecture 8, Part 3, slides 14 to 20: Q-accuracy plots, overestimation, Double Q-learning in practice, and generalized double Q-learning

  3. Dueling aggregation and identifiabilityDueling Network Architectures for Deep Reinforcement Learning

    Section 3 in arXiv:1511.06581v3, Equations 7 to 9: the unidentifiable naive sum, the max-subtracted form, and the mean-subtracted form used in practice. Section 4.1 (corridor policy evaluation) shows where the structure helps.

  4. Both improvements in codeHands-on Modern RL - From Q-Learning to DQN

    Double DQN (the selection versus evaluation split with its PyTorch snippet) and Dueling DQN (value and advantage streams with mean recombination) (page read 2026-10-14)

2

Focus on

  • The max over noisy estimates is biased upward: . Double DQN selects with online weights and evaluates with target weights.
  • The code change is two lines (argmax on one net, gather on the other). Compare against vanilla on identical samples and budgets, or the comparison is void.
  • The naive sum is unidentifiable: a constant shift cancels. Max-subtraction pins the best action's advantage at zero; the mean form used in practice stabilizes by moving only with the mean.
  • Dueling helps where state value dominates action differences. It does not fix overestimation; that is the double split's job.
Common mistakes · 3
  • Writing the reverse split, selecting with the target net and evaluating with the online net. It is still decoupled, but the label now depends on the weights being trained, so it must be detached and it moves every step. The paper evaluates on the frozen net.
  • Reading the dueling value stream as the state value under naive-sum semantics. Only the max form makes estimate the best action's value; the mean form is off by a constant.
  • Crediting double for a win on different samples, seeds or tuning. The paper's same-protocol discipline is load-bearing.
3

Try it yourself

Closed-book, before checking anything

Closed-book, compute the double target for online next-values , target next-values , , and no termination: show 0.99 against a vanilla 4.95. Then show two independent uniform noise draws over give above the true zero.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Online ranks action 2 best while the target values action 3 highest. Which number enters the double target?Answer

    The target net's value for action 2. Selection is online and evaluation is target; the highest target value is never touched.

  2. 2.Why does the bias grow with more actions?Answer

    More draws raise the expected maximum of the noise. The max has more chances to catch an upward error.

  3. 3.Add 5 to and subtract 5 from every under the naive sum. What changes?Answer

    Nothing in : the shift cancels, which is the unidentifiability. Under the mean form the same shift moves by 5, so the decomposition is pinned.

  4. 4.Dueling speeds up LunarLander hovering but overestimation persists. Expected?Answer

    Yes. Dueling restructures credit between state and actions; it does not remove max bias. Add the double split for that.

5

Practice

  • Deep-ML 477: Double Q-Learning Algorithm

    Implement double_q_learning. The tests check alternating-table updates: the first experience moves Q1 and the second moves Q2

    Then compare double against your vanilla DQN on identical samples. The section mini-project keeps the overestimation evidence.

  • Berkeley CS285 Homework 3: LunarLander with Double DQN

    The double-Q block marked Section 2.5 in hw3/src/agents/dqn_agent.py with hw3/experiments/dqn/lunarlander.yaml (LunarLander-v2, use_double_q: true, 500k steps). Start from the CartPole config first, since LunarLander takes much longer on your GPU or CPU. The homework environment needs the swig system package for gym[box2d]; ported to Gymnasium 1.x, the id becomes LunarLander-v3 and needs the box2d extra

You're done when

Deep-ML 477 passes, your hand double target matches, and a double-versus-vanilla comparison on identical samples shows the bias gap.

Only when you can do this without notes.

Leads to

Notes

Resources · 4 for this unit, 8 more in the section
  • Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Value-Based RL and Q-Learning in PracticeUC Berkeley · primary

    Slides are public at https://rail.eecs.berkeley.edu/deeprlcourse/static/slides/lec-N.pdf; current videos are not, and the public Fall 2023 playlist numbers lectures differently. Study Lecture 7 (value-based RL) and Lecture 8 (Q-learning in practice: replay, target networks, double Q-learning). Work the DQN part of Homework 3 (src/agents/dqn_agent.py, CartPole then LunarLander with double DQN) on CPU or one small GPU; the Atari run is optional. The homework pins gym==0.25.2, which fails on NumPy 2, so port it to Gymnasium (terminated and truncated) or pin numpy<2 in its own environment, and turn off its forced WandB logging.

  • Deep Reinforcement Learning with Double Q-LearningDeepMind · required

    Derive the action-selection and action-evaluation split, construct a noisy maximization example and compare DQN with Double DQN using identical samples and tuning budgets.

  • Dueling Network Architectures for Deep Reinforcement LearningWang et al. (ICML 2016) · support

    Read the dueling architecture and its aggregation equations (the mean-subtracted form). Implement it as an optional head and test that the value and advantage streams are identifiable only up to the stated constraint.

  • Hands-on Modern RL - From Q-Learning to DQNWalking Labs · support

    Use Sections 5.1 to 5.4, with the masked target on the components page (the formula on the first page omits the terminal mask). code/chapter04_dqn/dqn_cartpole.py trains CartPole on CPU in about two minutes. Treat score claims as hypotheses requiring local seed and version evidence. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its code/chapterNN folders do not follow the site chapter numbers.

Also in this section

  • Reinforcement Learning: An Introduction (2nd ed.) - Chapters 9 and 11Richard Sutton and Andrew Barto · required

    The authors post the full second edition free at incompleteideas.net; cite the printed page numbers. Study Sections 9.1 to 9.4 (value error, semi-gradient TD, linear methods) and Sections 11.1 to 11.3 and 11.6 (off-policy divergence, the deadly triad, why the Bellman error is not learnable). Reproduce Baird's counterexample (Section 11.2, Figure 11.1) and show the weights diverge under off-policy semi-gradient TD.

  • Stanford CS224R Spring 2026 - Q-Learning and Off-Policy MethodsStanford University · support

    Use Lecture 06 (Q-learning) and the TA Q-learning tutorial (material/CS224R_Tutotial_Max.pdf) as a second derivation of fitted Q-iteration, targets and overestimation. Its homeworks run on cloud GPUs; follow the Stanford honor code for course materials.

  • Playing Atari with Deep Reinforcement LearningDeepMind · required

    Read the algorithm, replay and target-network design plus experimental protocol. Reproduce DQN on a small discrete environment, then ablate replay and target networks rather than attempting an Atari score reproduction.

  • CleanRL DQNCleanRL · support

    Read the single-file DQN implementation and documented benchmark details after the blank-file update passes. Trace replay, target, seeding, termination and evaluation semantics. The script expects the final_info and final_observation keys of older Gymnasium releases; on Gymnasium 1.x (next-step autoreset) it logs no episode returns and raises KeyError at truncation, so run it in an environment with gymnasium==0.29.1 or patch those lines and say so.

  • Deep-ML - Function Approximation and DQN ProblemsDeep-ML · support

    Use named problems as closed-book checks after your own implementation passes: 530 (semi-gradient TD(0)), 556 (deadly-triad instability), 557 (Baird's counterexample), 537 (experience replay) and 477 (double Q-learning). Read each problem's tests before trusting its statement.

  • Reinforcement Learning Control Laboratory - Deep Value CoreRoadmap-Final · required

    Implement DQN and Double DQN with replay and target state, fixed-batch target tests, checkpoint and resume, overestimation evidence and injected online-target, detach, action-gather and replay defects.

  • Gymnasium - Time Limits and Vector AutoresetFarama Foundation · reference

    Read Termination, Truncation, Importance in learning code and Solution in the time-limits tutorial, plus the vector autoreset note at https://farama.org/Vector-Autoreset-Mode. Next-step autoreset is the default for Gymnasium 1.x vector environments; on Gymnasium 1.4.0 the step after an episode ends returns reward 0 with both flags false and is not a transition.

  • Gymnasium - Env.reset and seedingFarama Foundation · reference

    Read the Env.reset entry for the seeding contract: an integer seed resets the environment PRNG np_random, and a later reset with seed=None continues it, so seed once right after creation.