Deep Reinforcement Learning/DQN Improvements: Double, Dueling, and Prioritized Replay

Lesson 4.21,917 words

DQN Improvements: Double, Dueling, and Prioritized Replay

Three refinements that turn plain DQN into the standard modern value-based agent, each touching a different part of the system. Double DQN fixes the maximization bias in the target by splitting action selection from evaluation; dueling networks restructure the network around a state value and per-action advantages; prioritized replay changes which transitions are learned from.

╌╌╌╌

This builds on Deep Q-Networks, which set up the neural action-value function, the deadly triad, and the two stabilizers — experience replay and a target network — that make deep Q-learning train. Those give a working agent; the three refinements here each improve a different component without changing the overall structure.

Improvement one: Double DQN

DQN inherits a flaw from tabular Q-learning: the operator overestimates. The target takes the maximum over estimated values, and estimates are noisy — some above the truth, some below. Taking the max systematically prefers the ones that happen to be inflated, so the target carries a persistent positive bias, and the bias compounds through bootstrapping.1

The problem is that answers two questions with one network: which action is best (an ), and how good is it (evaluating that action). Writing the max as makes the double role explicit. Both questions go to the same weights, so a value inflated by noise is both selected and trusted, biasing the answer in the same direction twice.

Double DQN decouples the two. Use the online network to select the greedy action, and the target network to evaluate it:1

Because selection and evaluation now come from networks with different weights, an error that inflates an action's value in one network is unlikely to inflate it in the other, and the two cross-validate each other's estimates. The change is one line in the target — the online weights choose , the frozen weights score it — and it reliably yields better policies at no extra network cost, reusing the two networks DQN already maintains.

How much bias, quantitatively. The overestimation has a clean bound. Suppose in some state the true action values are all equal to a common , so no action is genuinely better, and the estimates are unbiased but noisy: each with the errors independent, zero-mean, and of comparable spread. The single-network target uses , and the maximum of several zero-mean noises is positive in expectation — for actions with variance it grows roughly like . So the target overshoots the truth by an amount that increases with both the noise and the number of actions; van Hasselt, Guez, and Silver (2016) show this bias compounds through bootstrapping and measurably inflates DQN's value estimates on Atari, sometimes by an order of magnitude, without a matching gain in score.2 Double DQN's decoupled estimate cancels the correlation between which action is picked and which error inflates it, so its target is far closer to unbiased.

For example, say three next-actions have true value each, and the two networks estimate:

actiononline target

Plain DQN takes of the target column: , an overestimate of over the truth of . Double DQN picks the greedy action from the online column (, at ) and evaluates that action in the target column: , an estimate of from the truth. The online network's overestimate of is not confirmed by the target network, and the target network's overestimate of never enters the target, because was not selected. The decoupling turns into .

Double DQN. The online network names the greedy next action ("action a3 looks best"), and the target network reports that action's value — separating selection from evaluation so noise does not inflate the target twice.

Improvement two: dueling networks

Double DQN changed the target; the dueling architecture changes the network, and it does so without touching the control algorithm at all.3 The insight is about the action-advantage function: in many states the choice of action barely matters (the cart-pole balanced and upright is fine either way), and there the useful quantity is — how good the state is — not the near-identical Q-values across actions. Forcing a single stream to learn directly wastes capacity relearning inside every action's estimate.

A dueling network shares the early layers (the convolutions, on Atari) and then splits into two streams: one outputs a single scalar , the other a vector of advantages . They recombine into Q-values. The naive recombination is unidentifiable — add a constant to and subtract it from and is unchanged — so DQN subtracts the mean advantage to make the decomposition unique:

The dueling architecture. Shared layers feed two heads — a scalar state value and a per-action advantage — recombined (advantages centered on their mean) into the Q-values. The control algorithm is unchanged; only the network differs.

Subtracting the mean shifts and off their true values by a constant, but it leaves the relative ranking of actions intact, so the greedy policy is unaffected. The benefit is that the state-value stream is trained by every action's update rather than only the action taken, so — the component shared across all actions in a state — is learned more efficiently and with lower variance. Dueling plugs straight into Double DQN; the combination is often called dueling DDQN.

Improvement three: prioritized experience replay

Plain replay samples the buffer uniformly, spending equal effort on transitions the agent already predicts perfectly and on the rare surprising ones that carry the most to learn. Prioritized experience replay samples the surprising ones more often.4 The measure of surprise is the absolute TD error: a transition whose target is far from the current prediction is one the agent misjudged, and replaying it yields the most learning. The priority of transition is

with the TD error and a small so that even zero-error transitions keep a chance of being replayed. Sampling strictly by priority is brittle — noisy errors would trap the agent on a handful of transitions — so PER samples stochastically, drawing transition with probability

where interpolates between uniform replay () and pure greedy prioritization (). Every transition retains a nonzero sampling probability, monotone in its error.

One correction remains. Sampling non-uniformly changes the distribution of the updates, which biases the expectation the gradient is estimating — precisely the kind of distribution mismatch that endangers off-policy learning. PER offsets it with importance-sampling weights that scale each transition's update down in proportion to how often it is over-sampled,

normalized by their maximum so weights only ever scale updates down and keep training stable. The exponent is annealed toward 1 over training, fully correcting the bias by the end, when the agent is near convergence and the bias would matter most. The weights multiply into the loss, so PER changes which transitions are seen and how much each one counts, without changing the target.

For example, take five transitions whose absolute TD errors are and set , . The priorities raised to are , summing to . Dividing gives sampling probabilities . The high-error transition is drawn about more often than the near-zero one — but the exponent keeps even the transition at a chance, so nothing is starved. Compare , which flattens every to the uniform . The importance weight for the top transition, with and , is ; the rarest transition gets . After normalizing by the max, and : the over-sampled transition's update is scaled down to a fifth, exactly undoing its over-representation.

Rainbow and distributional value learning

Double DQN, dueling, and prioritized replay were each published as a separate improvement, and each helped on its own. The natural question is whether they compose. Rainbow (Hessel et al., 2018, AAAI) answers it by combining six extensions into one agent and ablating each: Double DQN, dueling networks, prioritized replay, multi-step returns, distributional value learning, and noisy networks for exploration. On the 57-game Atari benchmark the combination substantially outperforms any single component, and the ablations show that removing prioritized replay or multi-step returns hurts most — evidence that the gains are largely complementary rather than redundant.5 Rainbow is the practical answer to which DQN variant should I run: most of them, together.

Two of its components go beyond anything above. Multi-step returns replace the one-step target with an -step one, , trading a little off-policy bias (the intermediate actions came from an older policy) for faster reward propagation — the same bias-variance dial that reappears in GAE. Noisy networks (Fortunato et al., 2018) replace -greedy with learned parametric noise on the weights, so exploration is state-dependent and annealed by gradient descent rather than a hand-set schedule.

The deepest departure is distributional RL (Bellemare, Dabney, and Munos, 2017, ICML). DQN predicts the expected return ; the distributional view predicts the full distribution of returns, of which is only the mean. Their C51 agent represents as a categorical distribution over 51 fixed atoms and trains it with a distributional Bellman update, minimizing a cross-entropy to the projected target distribution. Learning the whole distribution turns out to be a better auxiliary signal for the shared representation, not merely a richer output, and C51 beat the prior state of the art on Atari. A later refinement, quantile regression DQN (Dabney et al., 2018, AAAI), predicts the distribution's quantiles instead of fixed-position probabilities, removing C51's need to guess the return range in advance.6 These are developed in the distributional and Rainbow lesson; here the point is that the value function DQN learns is itself a modeling choice, and predicting more than its mean improves performance.

Expected versus distributional value. DQN predicts a single number , the mean return (left). Distributional agents such as C51 predict the whole return distribution over a set of atoms (right), of which is only the average; the extra structure sharpens the learned representation.

Where this leaves us

Deep Q-networks are the value-based branch of deep reinforcement learning: approximate with a neural network, train it by bootstrapped semi-gradient regression, and counter the deadly triad with two stabilizers — a replay buffer that makes correlated online data look IID, and a frozen target network that turns a moving target into a sequence of stationary regressions. The three refinements each improve a different part: Double DQN fixes the maximization bias in the target, dueling networks restructure the network around and , and prioritized replay improves which data is learned from. Together they are the standard modern value-based agent.

DQN learns a value function and reads a policy off it by . The complementary branch parameterizes and optimizes the policy directly, which handles continuous actions and stochastic policies that a value-based cannot — actor-critic and PPO. Both branches, and the search-and-model methods that extend them, come together in the case studies that carried deep RL from Atari to Go and beyond.

Footnotes

  1. Morales, Ch. 9, Double DQN — Q-learning's overestimation from taking the max of noisy estimates; unwrapping the max into an argmax (selection) and an evaluation; and the DDQN target using online weights to select and target weights to evaluate (van Hasselt, 2015). 2
  2. van Hasselt, Guez, and Silver (2016), Deep Reinforcement Learning with Double Q-learning, AAAI — shows single-network DQN systematically overestimates action values on Atari, gives the maximization-bias argument (the max of noisy unbiased estimates is positively biased), and demonstrates that the online-select / target-evaluate decoupling reduces both the value error and the resulting suboptimality. The dueling architecture is Wang, Schaul, Hessel, van Hasselt, Lanctot, and de Freitas (2016), Dueling Network Architectures for Deep Reinforcement Learning, ICML.
  3. Morales, Ch. 10, Dueling DDQN — the dueling architecture's shared layers splitting into a state-value stream and an advantage stream , the aggregation subtracting the mean advantage for identifiability, and the more efficient, lower-variance learning of (Wang et al., 2015).
  4. Morales, Ch. 10, PER: Prioritizing the replay of meaningful experiences — the absolute TD error as priority , stochastic prioritization interpolating uniform and greedy replay, and the weighted importance-sampling correction normalized by its max with annealed to 1 (Schaul et al., 2015). The canonical paper is Schaul, Quan, Antonoglou, and Silver (2016), Prioritized Experience Replay, ICLR.
  5. Hessel, Modayil, van Hasselt, Schaul, Ostrovski, Dabney, Horgan, Piot, Azar, and Silver (2018), Rainbow: Combining Improvements in Deep Reinforcement Learning, AAAI — integrates Double DQN, dueling, prioritized replay, multi-step returns, distributional value learning, and noisy networks into one agent and ablates each on the 57-game Atari suite, finding the combination outperforms every individual component and that prioritized replay and multi-step returns contribute the most.
  6. Bellemare, Dabney, and Munos (2017), A Distributional Perspective on Reinforcement Learning, ICML — the C51 agent, modeling the return distribution as a categorical over 51 fixed atoms trained by a projected distributional Bellman update; Dabney, Rowland, Bellemare, and Munos (2018), Distributional Reinforcement Learning with Quantile Regression, AAAI — QR-DQN, predicting quantiles instead of fixed-atom probabilities. Noisy exploration: Fortunato, Azar, Piot, et al. (2018), Noisy Networks for Exploration, ICLR.

╌╌ END ╌╌