5.2.4 · D4Deep & Advanced RL

Exercises — Double DQN and Dueling DQN

2,292 words10 min readBack to topic

Two boxed formulas power almost everything below. We restate them so you never have to hunt:


Level 1 — Recognition

Problem 1.1

In one sentence each, name which disease of DQN each variant cures: Double DQN and Dueling DQN.

Recall Solution
  • Double DQN cures overestimation bias — the optimistic upward tilt caused by taking a over noisy estimates.
  • Dueling DQN cures sample inefficiency — it stops the net from re-learning "how good is this state?" separately for every action, by splitting off a shared value stream. Neither fix contradicts the other; they stack (see Problem 4.1).

Problem 1.2

Circle the network that does selection and the one that does evaluation in the Double DQN target. Which network is frozen?

Recall Solution
  • Selection (the ): the online network .
  • Evaluation (reading the value at the chosen action): the target network .
  • The frozen one is the target network — a slowly-updated copy, see Target Networks and Experience Replay. The online net updates every gradient step. Mnemonic from the parent: "Select-Online, Eval-Target" (SO-ET).

Level 2 — Application

Problem 2.1

At next state you have , . The two networks output, over 3 actions:

  • Online :
  • Target :

Compute and .

Recall Solution

Plain DQN. Select and evaluate with . (action ). Double DQN. Select with online: (value ). Evaluate that same with : . Why Double gives the lower (less inflated) target: the true action values here are all , so the "right" bootstrap value is near . Plain DQN latched onto (whichever action got lucky noise in the same net that scored it). Double DQN's evaluator has noise independent of 's luck on , so it does not confirm the optimism.

Problem 2.2

A Dueling head outputs and raw advantages for 3 actions. Using mean-centering, compute and verify .

Recall Solution

Mean of . Centered advantages: Recombine: . Check the anchor: ✔. Why centering matters here: if we had skipped it and used , then would no longer be the average of (that average is ). The offset would have leaked into , silently inflating everything and making meaningless.


Level 3 — Analysis

Problem 3.1

Prove that when the online and target networks are identical (), the Double DQN target equals the plain DQN target. What does this tell you about early training?

Recall Solution

If then , so the selection picks the same action as , and evaluating with reads the same number. Hence Interpretation: right after a target-network sync (when ), Double DQN offers no correction — the two nets agree. The de-biasing power comes from the drift between and that builds up between syncs. Their estimation noises decorrelate as keeps training while stays frozen.

Problem 3.2

Using the bound from the parent note, for i.i.d. zero-mean estimation errors of standard deviation : with , evaluate the bound for and describe the trend.

Recall Solution

Plug in ():

Figure — Double DQN and Dueling DQN

Trend: the upper bound on overestimation grows monotonically with the number of actions . With one action there is nothing to max over so the bias is exactly . With more actions there are more chances for one to get lucky noise, so the max drifts further above the true (zero) mean. Consequence: Double DQN's benefit is largest in large action spaces — exactly where vanilla DQN suffers most from Overestimation Bias in Q-learning.


Level 4 — Synthesis

Problem 4.1

You build a Double Dueling DQN. State (a) which part changes the network architecture, (b) which changes the target computation, and (c) whether these two changes ever conflict.

Recall Solution
  • (a) Architecture: the Dueling part — split the trunk into a scalar value stream and a vector advantage stream , recombined with mean-centering. This changes only how is produced from features.
  • (b) Target computation: the Double part — the label used in the loss becomes (select-online, eval-target). This changes only what number we regress toward.
  • (c) Conflict? None. They are orthogonal: one edits the forward pass, the other edits the training target. Whatever -values the dueling head produces are simply fed into the Double DQN target rule. This is why "Double Dueling DQN" is a standard baseline and a component of Rainbow DQN.

Problem 4.2

A Dueling head must output the same final regardless of whether it internally chose or . Show both raw pairs give after mean-centering, and explain what this "sameness" is telling you.

Recall Solution

Pair 1: , mean , centered , ✔. Pair 2: , mean , centered , .

These are not equal! Pair 2 gives , not . The trick: to force equality we'd also need to absorb the mean. The identifiability point is the reverse: many raw pairs collapse to the same centered , and mean-centering pins to the true average of . So for Pair 2 the centered advantages match Pair 1 () but the value differs, giving a shifted . Lesson: centering fixes the shape of the advantage (the anchor ) but the value stream still sets the overall level — that is exactly the clean, unique split we wanted, with in each case ( then ).


Level 5 — Mastery

Problem 5.1

Full pipeline. Transition: , , . At a Dueling net gives:

  • Online : , raw
  • Target : , raw

Compute the mean-centered and , then produce the Double DQN target. Contrast with the plain DQN target.

Recall Solution

Step 1 — center online advantages. mean . . . Step 2 — center target advantages. mean . . . Step 3 — Double DQN. Select with online: (value ). Evaluate with target: . Step 4 — plain DQN for contrast. (value ). Reading it: plain DQN grabs the biggest target-net number ('s ) — the classic optimism. Double DQN forces the choice through the online net (which prefers ), then reads under the target net (), producing the noticeably lower, less-inflated target vs .

Problem 5.2

Design reasoning. The parent note mentions a max-centered alternative , which pins . Give one reason mean-centering is preferred, and connect to the Advantage Function / Actor-Critic Methods viewpoint.

Recall Solution

Why mean over max: subtracting the mean is a smooth, low-variance operation — a small change in any advantage nudges the anchor only by . Subtracting the max depends on which action is currently the argmax; that argmax can flip between gradient steps, injecting a discontinuous, higher-variance signal into and destabilising training. Connection: with mean-centering the constraint is , i.e. advantages are relative to the average action. That matches the classical Advantage Function definition with — a mean, not a max. In Actor-Critic Methods the critic learns exactly this , and the advantage tells the actor how much better than average each action is. Dueling DQN bakes that same value/advantage decomposition into the network's shape.


Recall Final self-check

Which network selects in Double DQN? ::: The online net (evaluation is done by target ). After a target sync , does Double DQN differ from plain DQN? ::: No — they coincide until the nets drift apart. What does mean-centering pin to? ::: The average of over actions, . Are Double and Dueling in conflict? ::: No — one edits the architecture, the other the target; they stack into Double Dueling DQN.