TL;DR
The dueling network is a change to the shape of a Q-network, not to the learning rule. Instead of one stream of layers that outputs a value for every action, it has two streams: one estimates how good the state is, and the other estimates how much better each action is than average. The two are added back together to give the usual action values, so any Q-learning algorithm can train it. On 57 Atari games it beat the single-stream networks of its time, with the largest gains when many actions have similar values.
Builds on: Deep Q-Network, Advantage Function, Value Function, Convolutional Neural Network · Leads to: Deep Reinforcement Learning with Double Q-Learning, Experience Replay
Why it mattered
The dueling architecture is one of the standard parts of strong value-based agents for games. Its benefit is simple to state: a network that can learn the value of a state without learning the value of every action separately learns faster, and it can share that learning across all the actions in that state.
The paper's Atari evaluation covers 57 games, including many where the agent's choice matters only at a few moments. In the paper's own example, the racing game Enduro, knowing whether to steer left or right matters only when a collision is near; in most frames every action leads to nearly the same future. A network that learns "this frame is good or bad" from every frame gets far more out of each update than one that must learn 18 separate numbers from scratch.
The architecture also combined cleanly with the other improvements of the time. The authors paired it with prioritized replay and gradient clipping, and the combination gave the strongest Atari numbers in the paper. Because the dueling network has the same input and output as an ordinary Q-network, it works with the same training methods, including the double Q-learning target from Double DQN.
How it came about
The deep Q-network of 2015 used one stream of fully connected layers after the convolutions. Dueling networks came from the observation that this design asks one number per action to carry both the state's worth and the action's relative worth. The paper was posted to arXiv in November 2015 and published at the ICML 2016 conference.
The problem
A Q-network outputs a separate number for each action. When the actions have similar values, the network still has to learn each of those numbers, and the learning signal for one action helps the others only indirectly. Learning becomes slow, and small errors in the differences between actions can change which action looks best.
The question the paper asks is whether the network can be built to represent what is common across actions separately from what is specific to each one. If it can, the common part can be learned from every update, and the specific part only where the choice matters.
How it works
The idea: the network computes a shared set of features from the image. Two streams then read those features. One gives a single value for the state. The other gives one advantage per action, which measures how much better that action is than the others. The output is the value plus each advantage, with the advantages centred so they average zero.
flowchart LR A["Frames in"] --> B["Shared convolutional layers"] B --> C["Value stream: one number for the state"] B --> D["Advantage stream: one number per action"] C --> E["Add value to each centred advantage"] D --> E E --> F["Q value for every action"]
Take one tiny instance: a state with two actions, where the value stream says V = 5 and the advantage stream says A = (+2, -1) for actions 1 and 2.
- Centre the advantages. The average of the advantages is (2 - 1) / 2 = 0.5. Subtract it from each: (1.5, -1.5). Check: the centred advantages now average to zero.
- Add the value. Action 1 gets 5 + 1.5 = 6.5, and action 2 gets 5 - 1.5 = 3.5. Check: the average of the two Q values is (6.5 + 3.5) / 2 = 5, which is exactly V.
- Choose. The greedy action is action 1, because 6.5 is larger than 3.5. The choice depends only on the advantages, since adding V to both actions changes nothing about which is larger.
- Train. The loss is the usual Q-learning loss on the output. The gradient flows back through both streams into the shared layers, and no separate value target is needed.
The centring is not optional. Without it, the value and the advantages can trade a constant between them and still produce the same Q values, so the streams would not mean what their names say.
Worked examples
Take value V = 5 and advantages (2, -1). Plain addition gives Q = (7, 4).
- Now take V = 6 and advantages (1, -2), which shift the same constant between the streams: 6 is 5 plus 1, and each advantage is 1 less.
- Add them: Q = (6 + 1, 6 - 2) = (7, 4).
- Interpretation: two different pairs of streams give exactly the same Q values. Nothing in the loss can tell them apart, so the value stream could hold any constant. Centring the advantages removes this freedom, because only one split has advantages that average to zero.
Take V = 2.0 and advantages (0.6, -0.2, 0.0, 0.4, -0.8) for five actions.
- Average the advantages: (0.6 - 0.2 + 0.0 + 0.4 - 0.8) / 5 = 0.0 / 5 = 0.
- Centring changes nothing here, because the mean is already zero.
- Add V to each: Q = (2.6, 1.8, 2.0, 2.4, 1.2).
- Greedy action: the largest Q is 2.6, at action 1.
- Interpretation: a choice that depends on the advantages alone, while V is shared across all five actions, so an update to V moves every action at once.
Take a state where the value is V = 10 and four actions have advantages (0.2, 0.1, 0.1, 0.0), so three actions are nearly tied.
- The mean advantage is (0.2 + 0.1 + 0.1 + 0.0) / 4 = 0.1.
- Centred advantages: (0.1, 0.0, 0.0, -0.1).
- Add V = 10: Q = (10.1, 10.0, 10.0, 9.9).
- Check: the mean of the Q values is 10.0, which is exactly V.
- Interpretation: the value stream has to get one number right, V, and the three tied actions share it. Only the small advantages separate them, which is the part the network can learn from every update.
Try it: V = 10 and advantages (0.3, -0.1, 0.0). What are the Q values, and which action is greedy? Answer: the mean advantage is 0.2 / 3, about 0.0667; the centred advantages are (0.2333, -0.1667, -0.0667); the Q values are about (10.23, 9.83, 9.93), so action 1 is greedy and the mean of the Q values is 10.
The math
Let V(s) be the value stream's output for state s, and A(s, a) the advantage stream's output for action a. The Q value is the value plus the advantage with its mean over actions removed. The mean-centred form is the one the paper uses in all its experiments.
Here θ are the parameters of the shared convolutional layers, α those of the advantage stream and β those of the value stream. The paper also gives a version that subtracts the maximum advantage instead of the mean, which makes the best action's advantage exactly zero. It reports that the mean version is more stable, because the advantages then only need to track the average rather than the best action.
Step 1 in symbols
The advantage of an action is defined as A(s, a) = Q(s, a) - V(s). Its average over the actions, weighted by the policy, is zero. Subtracting the mean advantage in the network enforces the same property on the outputs, so the split between V and A is fixed by the architecture.
Step 2 in symbols
Choosing an action uses only the advantages, because the value term is the same for every action:
The mean term is the same for every action too, so the argmax is the same as the argmax of the raw advantages. The paper points out that this is why acting needs only the advantage stream.
Step 3 in symbols
Training is the ordinary Q-learning update. The network is trained with the same loss as a standard Q-network, so the gradients of the Q value reach both streams and the shared layers:
The first derivative means that every update to the value stream moves all the action values at once. The second shows that an advantage update for one action also nudges the others in the opposite direction, which is the mechanism behind the sharing.
Results
- Policy evaluation with many similar actions. The paper's controlled experiment compares the two heads on a task where the exact Q values are known, and the dueling head's advantage grows as the number of similar actions grows. This is the setting the mechanism predicts.
- Atari, 57 games (Table 1). The paper reports mean and median scores, as percent of human performance, under the 30-no-op test, and the dueling head with clipping beats the single-stream head with clipping on both. Read the exact figures from the table itself; this lesson does not restate them.
- Robustness to human starts. The paper also reports the human-starts test, where the gain is smaller. A reader should expect a single benchmark number to overstate the gain.
- Combined with prioritized replay. The paper reports that the dueling architecture with prioritized replay gives the strongest Atari numbers in its table.
Common mistakes and tradeoffs
It is tempting to think the dueling network learns a better value function on its own. In fact the gain comes from the shared structure: the state value is learned from every action's update, so similar actions help each other learn faster. Centring also makes V the average of the Q values over actions, which is what the value stream is meant to estimate.
It is tempting to think a dueling network always helps. In fact the advantage stream matters most where the action choice is rare or unimportant, which is where the architecture saves effort. In games where every action matters in every frame, the benefit is smaller. The human-starts results show that the gain can be a few points rather than tens.
It is tempting to think the architecture needs a special training algorithm. In fact it needs none. The paper trains it with the same loss, optimiser and targets as a standard Q-network, which is why it combines so easily with the double target and with prioritized replay.
Use a dueling head when the action space is moderately large, when many actions share similar values in many states, or when you can afford a slightly bigger head. Use a plain Q-head when the action space is tiny and every action has a very different value. Alternatives include distributional value learning and different value-decomposition schemes, which change what the network predicts rather than how it splits it.
Reading guide
Read the paper in its order, with these prerequisites at hand. The background uses the Bellman Equation for the Q-learning target and recalls the Deep Q-Network and the double target of Double DQN. The architecture section assumes Advantage Function, Value Function and Convolutional Neural Network for the shared layers, and its aggregation step is the mean-centring explained above. The Atari results use Gradient Norm Clipping and prioritized replay, which samples transitions with large errors more often.
The chain of ideas: a Q-value is a value plus an advantage, the split is ambiguous unless the advantages are centred, the shared value stream learns faster when actions are similar, and the same training rule then works unchanged.
Check yourself
QuestionWhat does the value stream of a dueling network output, and what does the advantage stream output?Show answer
The value stream outputs one number for the state, an estimate of its worth. The advantage stream outputs one number per action, how much better that action is than the average action in that state. The Q value for each action is the value plus its centred advantage.
QuestionA state has V = 4 and advantages (+3, -1, 0) for three actions. What are the Q values after centring, and which action is greedy?Show answer
The mean advantage is (3 - 1 + 0) / 3 = 2/3. The centred advantages are (7/3, -5/3, -2/3). Adding V = 4 gives Q = (19/3, 7/3, 10/3), approximately (6.33, 2.33, 3.33). The greedy action is the first one, with about 6.33.
QuestionWhy does the dueling network need the advantages to be centred?Show answer
Without centring, adding a constant to V and subtracting it from every advantage gives identical Q values, so the split between the streams is not determined by the loss. Centring fixes the split, so the value stream really estimates the state's value.
QuestionYou are training an agent in an environment with 30 actions, where most states have several actions of nearly equal value. What would you expect from a dueling head, and what would you check?Show answer
You would expect the dueling head to learn the shared state value faster, which the corridor experiment suggests grows with the number of actions. You would check that the gain holds under a harder evaluation, such as the human-starts test, because the Atari gains shrink there.