TL;DR
Rainbow is one reinforcement-learning agent that combines six separate improvements to the deep Q-network (DQN) method. The six are: double Q-learning, prioritized replay, a dueling network, multi-step returns, distributional value learning, and noisy networks for exploration. The authors also removed each part in turn to measure what it adds. On 57 Atari games, the full agent reached a median score of 223 percent of human level, far above any single-improvement agent of the time.
Builds on: Deep Q-Network, Double Q-Learning, dueling networks, Prioritized Experience Replay, Distributional Reinforcement Learning, noisy networks · Leads to: the later agents that combine several replay and learning improvements, with Noisy Networks and Prioritized Experience Replay as the two pieces most often read alongside it.
Why it mattered
Rainbow became a common reference point for value-based agents on the Atari benchmark. It showed that improvements which fix different problems in DQN can be stacked, instead of competing. The paper has been cited more than 2,700 times on Semantic Scholar. Its ablation method, which removes one component at a time from a combined agent, became a standard way to ask whether a new piece of a learning system is really needed.
The paper also gave a concrete recipe. It listed the hyperparameters, the network shape, and the training budget, so later groups could reproduce the agent and compare against it.
History in brief. By 2017, DQN had been published in 2015 and had reached human-level play on many Atari games. Several groups then proposed separate improvements. Double Q-learning fixed overestimation. Prioritized replay and the dueling network improved how data and the network were used. Multi-step returns and distributional learning changed the target, and noisy networks changed exploration. Each had been tested alone, usually against plain DQN. Rainbow, from a DeepMind team, tested them together on the same 57-game suite with the same training setup. It was presented at AAAI in 2018, and it caught on because it turned a list of separate papers into one reproducible agent with clear evidence for each part.
The problem
DQN, from Deep Q-Network, learns an action-value function with a neural network. It works from raw pixels, but it has several known weaknesses:
- It overestimates action values, because the same noisy estimate is used both to pick and to score the best next action.
- It samples its replay memory uniformly, so it spends as much time on transitions it has already learned from as on surprising ones.
- Its single-step target carries reward information slowly backwards through time.
- It explores with a fixed [[epsilon-greedy-policy|-greedy rule]], which does not adapt to what the network is unsure about.
- It estimates only the average return, which throws away information about spread.
Each of these had a published fix. The open question was whether the fixes were complementary, and whether their gains would add up. Rainbow is the paper that tested this directly.
How it works
Rainbow changes the usual DQN loop in six places. Here is the path of one transition, from the moment the agent acts to the moment the network learns from it.
- Act. The agent sees a stack of recent frames, passes it through a Convolutional Neural Network, and gets a return distribution for each action. It does not add an term, because its noisy layers already make it explore.
- Store. The transition (state, action, reward, next state) goes into a replay buffer, tagged with the highest priority seen so far. New transitions get extra priority so they are reviewed soon.
- Sample. Transitions are drawn at random, but with probability that grows with their priority. Each one also gets an importance weight that corrects for the non-uniform sampling.
- Build a multi-step target. Instead of one reward, the target sums three rewards and then bootstraps from the state three steps later.
- Choose and score. The online network picks the best next action. The slower target network scores that action. Together they give a distribution to aim at.
- Learn and reprioritise. The loss is the distance between the predicted distribution and the target. That loss is also used as the new priority for this transition.
A tiny instance of step 4, with three rewards of 1, 0 and 2 and a discount of 0.9 per step (chosen for illustration; the paper uses 0.99 in its experiments):
- Rewards are , , .
- The weights are , and .
- Multiply each reward by its weight: , , .
- Add them: . Check: the third reward is multiplied by 0.9 twice, so 0.81 is right.
- The bootstrap value is then multiplied by , not by 0.9.
- Interpretation: the reward two steps ahead still counts, but less than a reward now.
A tiny network, to show how the two streams make action values. Here the return distribution sits on fixed support points called atoms, each with a probability, and its mean is the action value. Suppose there are two atoms, and , and two actions. For one state the value stream gives , and the advantage stream gives and .
- The mean advantage over the two actions is for each atom, because and .
- For left, the logits are . Softmax gives .
- Its expected value is .
- For right, the logits are , which gives and .
- Interpretation: right is the greedy action. The advantage stream encoded the difference, and the softmax turned the atom scores into a distribution whose mean is the Q value.
The pipeline in one picture:
flowchart LR A[Stack of frames] --> B[Conv encoder] B --> C[Dueling streams<br/>value and advantage] C --> D[Softmax over atoms<br/>per action] D --> E[Expected Q for each action] E --> F[Act greedily, noisy layers explore] F --> G[Replay buffer<br/>priority by loss] G --> H[3-step target<br/>online net picks, target net scores] H --> I[KL loss between distributions] I --> G
The math
Write the discounted return as in Discounted Return. The three-step return used by Rainbow is
where is the reward steps after time and is the discount factor.
Step 4 in symbols: the multi-step target
The bootstrap uses the state and the discount . The paper writes the target as a distribution. Let be fixed support points ("atoms") spread evenly between and , with . The predicted return distribution for state and action puts probability on atom , and its expected value is
The target distribution is the bootstrap distribution shifted by the truncated return and squeezed by the discount:
where are the target-network weights, and is the greedy action.
Step 5 in symbols: choose with one network, score with another
The double-Q part chooses the bootstrap action with the online weights and scores it with the target weights :
Using a single set of weights for both steps would reward whichever action happened to get an overestimate. Splitting the two roles removes that upward bias. This is the same idea as in Double Q-Learning, applied to the distribution.
Step 6 in symbols: the loss and the priority
Let project the shifted target back onto the fixed atoms , so the two distributions have the same support. The loss is the KL divergence from Kullback–Leibler Divergence:
Transitions are then sampled with priority
The paper uses the loss, not the absolute TD error, as the priority, because the KL loss can keep falling in stochastic environments even when the true return is not fixed.
The network in symbols
The shared trunk feeds a value stream with outputs and an advantage stream with outputs. For each atom , the two streams are combined as in the dueling network and passed through a Softmax over atoms:
where and is the mean of the advantage over actions. Subtracting that mean is what makes the split between value and advantage unique, as explained in Advantage Function.
Results
The main numbers are median human-normalised scores over the 57 games. Human-normalised means each game's score is scaled so that random play is 0 and the human baseline is 100.
- Rainbow, no-op starts: 223 percent. Human starts: 153 percent.
- DQN (from the dueling paper's numbers): 79 and 68 percent.
- Dueling DDQN: 151 and 117 percent. Prioritised DDQN: 140 and 128 percent. Distributional DQN: 164 and 125 percent. Noisy DQN: 118 and 102 percent. A3C: 116 percent with human starts.
- Learning speed: Rainbow matches DQN's final score after 7 million frames, far earlier in training than DQN needs.
Try it: Rainbow reaches 223 percent with no-op starts, and DQN reaches 79. What is the gap in percentage points, and what is the ratio? Answer: the gap is points, and the ratio is . With human starts the gap is points.
The ablation results change the picture:
- Removing prioritised replay or multi-step learning causes the largest drops in median score.
- Removing the distributional part or the noisy networks causes smaller drops.
- Removing the dueling network makes little difference in aggregate.
It is tempting to think Rainbow is a new algorithm. In fact it is six existing ideas, each with its own paper, and its contribution is the test of how well they fit together. The paper shows that they are largely complementary, because they fix different problems.
It is also tempting to think that more components always help. The ablations show that the components differ a lot in value. Stacking more parts costs compute and tuning time, because each one brings its own hyperparameters. The authors tuned only by a limited manual search, starting from each component's original paper, so the reported numbers are one careful setting, not the best possible one.
Limits: the results are on Atari games with a fixed frame budget. They say nothing about continuous control, partial observation, or real-world robots. The median hides large differences between games, which is why the paper also shows per-game gains. The tradeoff to keep in mind: the combined recipe is a strong value-based baseline with a discrete action set and a large data budget. For continuous actions, scarce data, or a budget where a single extension is enough, a plain DQN or a policy-gradient method is simpler.
Reading guide
The lesson's chain of ideas: DQN has several separate weaknesses, six fixes address different ones, Rainbow wires all six into one loss and one network that outputs a distribution over atoms for each action, and the ablations show that prioritised replay and multi-step learning matter most. Read the paper in its order, with these prerequisites at hand.
- Introduction and Background. The MDP setup, the discounted return, and value-based control. Needs Markov Decision Process, Discounted Return, Value Function, Epsilon-Greedy Policy and Q-Learning.
- Extensions to DQN. One subsection per component. Double Q-learning needs Double Q-Learning. Prioritised replay needs Prioritized Experience Replay and Importance Sampling. The dueling network needs Dueling Network Architectures for Deep Reinforcement Learning. Multi-step learning needs Temporal-Difference Learning and Bellman Equation. Distributional RL needs Kullback–Leibler Divergence and Softmax. Noisy Nets needs Noisy Networks and Gaussian (Normal) Distribution.
- The Integrated Agent. Combines the pieces. Needs everything above, and Target Network for the online and target split.
- Experimental Methods. Atari setup and hyperparameters (Table 1). Needs Adam Optimizer and RMSProp for the optimisers.
- Analysis. Comparisons to baselines (Table 2 and Figures 1 to 3), then the ablations (Figure 4). Read these with the Results section above.
Check yourself
QuestionName the six components that Rainbow combines.Show answer
Double Q-learning, prioritised replay, the dueling network architecture, multi-step learning, distributional value learning, and noisy networks for exploration.
QuestionWith rewards 2, 1, 0, a discount of 0.5, and n = 3, what is the three-step return?Show answer
The sum is . Each later reward is multiplied by one more factor of 0.5, and the third reward is zero, so it adds nothing.
QuestionWhy does Rainbow use the online network to pick the bootstrap action and the target network to score it?Show answer
If one network both chose and scored the action, the action with the highest noisy estimate would also get the highest score, which biases the target upward. Splitting the roles, as in double Q-learning, removes most of that bias.
QuestionIn an ablation, removing a component drops Rainbow's median score a lot but barely changes its per-game scores in most games. What would you conclude, and what would you check before trusting it?Show answer
The component matters for the median, which is driven by many mid-level games, but it may help a few games a lot and not others. Check the per-game breakdown and the learning curves over time, because the median can hide changes in individual games and the timing of the gain.
Sources
- Hessel et al., "Rainbow: Combining Improvements in Deep Reinforcement Learning," arXiv:1710.02298. https://arxiv.org/abs/1710.02298
- Mnih et al., "Human-level control through deep reinforcement learning," Nature, 2015. https://www.nature.com/articles/nature14236