SUNRISE: A Simple Unified Framework for Ensemble Learning in Deep Reinforcement Learning
Kimin Lee, Michael Laskin, Aravind Srinivas, Pieter Abbeel
Introduction
Model-free reinforcement learning (RL), with high-capacity function approximators, such as deep neural networks (DNNs), has been used to solve a variety of sequential decision-making problems, including board games (Silver et al., 2017, 2018), video games (Mnih et al., 2015; Vinyals et al., 2019), and robotic manipulation (Kalashnikov et al., 2018). It has been well established that the above successes are highly sample inefficient (Kaiser et al., 2020). Recently, a lot of progress has been made in more sample-efficient model-free RL algorithms through improvements in off-policy learning both in discrete and continuous domains (Fujimoto et al., 2018; Haarnoja et al., 2018; Hessel et al., 2018; Amos et al., 2020). However, there are still substantial challenges when training off-policy RL algorithms. First, Q-learning often converges to sub-optimal solutions due to error propagation in the Bellman backup, i.e., the errors induced in the target value can lead to an increase in overall error in the Q-function (Kumar et al., 2019, 2020). Second, it is hard to balance exploration and exploitation, which is necessary for efficient RL (Chen et al., 2017; Osband et al., 2016a) (see Section 2 for further details).
One way to address the above issues with off-policy RL algorithms is to use ensemble methods, which combine multiple models of the value function and (or) policy (Chen et al., 2017; Lan et al., 2020; Osband et al., 2016a; Wiering & Van Hasselt, 2008). For example, double Q-learning (Hasselt, 2010; Van Hasselt et al., 2016) addressed the value overestimation by maintaining two independent estimators of the action values and later extended to continuous control tasks in TD3 (Fujimoto et al., 2018). Bootstrapped DQN (Osband et al., 2016a) leveraged an ensemble of Q-functions for more effective exploration, and Chen et al. (2017) further improved it by adapting upper-confidence bounds algorithms (Audibert et al., 2009; Auer et al., 2002) based on uncertainty estimates from ensembles. However, most prior works have studied the various axes of improvements from ensemble methods in isolation and have ignored the error propagation aspect.
In this paper, we present SUNRISE, a simple unified ensemble method that is compatible with most modern off-policy RL algorithms, such as Q-learning and actor-critic algorithms. Our main idea is to reweight sample transitions based on uncertainty estimates from a Q-ensemble. Because prediction errors can be characterized by uncertainty estimates from ensembles (i.e., variance of predictions) as shown in Figure 1(b), we find that the proposed method significantly improves the signal-to-noise in the Q-updates and stabilizes the learning process. Additionally, for efficient exploration, We define an upper-confidence bound (UCB) based on the mean and variance of Q-functions similar to Chen et al. (2017), and introduce an inference method, which selects actions with highest UCB for efficient exploration. This inference method can encourage exploration by providing a bonus for visiting unseen state-action pairs, where ensembles produce high uncertainty, i.e., high variance (see Figure 1(b)). By enforcing the diversity between agents using Bootstrap with random initialization (Osband et al., 2016a), we find that these different ideas can be fruitfully integrated, and they are largely complementary (see Figure 1(a)).
We demonstrate the effectiveness of the proposed method using Soft Actor-Critic (SAC; Haarnoja et al. 2018) for continuous control benchmarks (specifically, OpenAI Gym (Brockman et al., 2016) and DeepMind Control Suite (Tassa et al., 2018)) and Rainbow DQN (Hessel et al., 2018) for discrete control benchmarks (specifically, Atari games (Bellemare et al., 2013)). In our experiments, SUNRISE consistently improves the performance of existing off-policy RL methods. Furthermore, we find that the proposed weighted Bellman backups yield improvements in environments with noisy reward, which have a low signal-to-noise ratio.
Related work
Off-policy RL algorithms. Recently, various off-policy RL algorithms have provided large gains in sample-efficiency by reusing past experiences (Fujimoto et al., 2018; Haarnoja et al., 2018; Hessel et al., 2018). Rainbow DQN (Hessel et al., 2018) achieved state-of-the-art performance on the Atari games (Bellemare et al., 2013) by combining several techniques, such as double Q-learning (Van Hasselt et al., 2016) and distributional DQN (Bellemare et al., 2017). For continuous control tasks, SAC (Haarnoja et al., 2018) achieved state-of-the-art sample-efficiency results by incorporating the maximum entropy framework. Our ensemble method brings orthogonal benefits and is complementary and compatible with these existing state-of-the-art algorithms.
Stabilizing Q-learning. It has been empirically observed that instability in Q-learning can be caused by applying the Bellman backup on the learned value function (Hasselt, 2010; Van Hasselt et al., 2016; Fujimoto et al., 2018; Song et al., 2019; Kim et al., 2019; Kumar et al., 2019, 2020). By following the principle of double Q-learning (Hasselt, 2010; Van Hasselt et al., 2016), twin-Q trick (Fujimoto et al., 2018) was proposed to handle the overestimation of value functions for continuous control tasks. Song et al. (2019) and Kim et al. (2019) proposed to replace the max operator with Softmax and Mellowmax, respectively, to reduce the overestimation error. Recently, Kumar et al. (2020) handled the error propagation issue by reweighting the Bellman backup based on cumulative Bellman errors. However, our method is different in that we propose an alternative way that also utilizes ensembles to estimate uncertainty and provide more stable, higher-signal-to-noise backups.
Ensemble methods in RL. Ensemble methods have been studied for different purposes in RL (Wiering & Van Hasselt, 2008; Osband et al., 2016a; Anschel et al., 2017; Agarwal et al., 2020; Lan et al., 2020). Chua et al. (2018) showed that modeling errors in model-based RL can be reduced using an ensemble of dynamics models, and Kurutach et al. (2018) accelerated policy learning by generating imagined experiences from the ensemble of dynamics models. For efficient exploration, Osband et al. (2016a) and Chen et al. (2017) also leveraged the ensemble of Q-functions. However, most prior works have studied the various axes of improvements from ensemble methods in isolation, while we propose a unified framework that handles various issues in off-policy RL algorithms.
Exploration in RL. To balance exploration and exploitation, several methods, such as the maximum entropy frameworks (Ziebart, 2010; Haarnoja et al., 2018), exploration bonus rewards (Bellemare et al., 2016; Houthooft et al., 2016; Pathak et al., 2017; Choi et al., 2019) and randomization (Osband et al., 2016a, b), have been proposed. Despite the success of these exploration methods, a potential drawback is that agents can focus on irrelevant aspects of the environment because these methods do not depend on the rewards. To handle this issue, Chen et al. (2017) proposed an exploration strategy that considers both best estimates (i.e., mean) and uncertainty (i.e., variance) of Q-functions for discrete control tasks. We further extend this strategy to continuous control tasks and show that it can be combined with other techniques.
Background
Reinforcement learning. We consider a standard RL framework where an agent interacts with an environment in discrete time. Formally, at each timestep , the agent receives a state from the environment and chooses an action based on its policy . The environment returns a reward and the agent transitions to the next state . The return is the total accumulated rewards from timestep with a discount factor . RL then maximizes the expected return.
Soft Actor-Critic. SAC (Haarnoja et al., 2018) is an off-policy actor-critic method based on the maximum entropy RL framework (Ziebart, 2010), which encourages the robustness to noise and exploration by maximizing a weighted objective of the reward and the policy entropy (see Appendix A for further details). To update the parameters, SAC alternates between a soft policy evaluation and a soft policy improvement. At the soft policy evaluation step, a soft Q-function, which is modeled as a neural network with parameters , is updated by minimizing the following soft Bellman residual:
where is a transition, is a replay buffer, are the delayed parameters, and is a temperature parameter. At the soft policy improvement step, the policy with its parameter is updated by minimizing the following objective:
Here, the policy is modeled as a Gaussian with mean and covariance given by neural networks to handle continuous action spaces.
SUNRISE
In this section, we propose the ensemble-based weighted Bellman backups, and then introduce SUNRISE: Simple UNified framework for ReInforcement learning using enSEmbles, which combines various ensemble methods. In principle, our method can be used in conjunction with most modern off-policy RL algorithms, such as SAC (Haarnoja et al., 2018) and Rainbow DQN (Hessel et al., 2018). For the exposition, we describe only the SAC version in the main body. The Rainbow DQN version follows the same principles and is fully described in Appendix B.
Formally, we consider an ensemble of SAC agents, i.e., , where and denote the parameters of the -th soft Q-function and policy.We remark that each Q-function has a unique target Q-function . Since conventional Q-learning is based on the Bellman backup in (2), it can be affected by error propagation. I.e., error in the target Q-function gets propagated into the Q-function at the current state. In other words, errors in the previous Q-function induce the “noise” to the learning “signal” (i.e., true Q-value) of the current Q-function. Recently, Kumar et al. (2020) showed that this error propagation can cause inconsistency and unstable convergence. To mitigate this issue, for each agent , we consider a weighted Bellman backup as follows:
where is a transition, , and is a confidence weight based on ensemble of target Q-functions:
where is a temperature, is the sigmoid function, and is the empirical standard deviation of all target Q-functions . Note that the confidence weight is bounded in because standard deviation is always positive.We find that it is empirically stable to set minimum value of weight as 0.5. The proposed objective down-weights the sample transitions with high variance across target Q-functions, resulting in a loss function for the Q-updates that has a better signal-to-noise ratio (see Section 6.1 for more detailed discussions).
2 Combination with additional techniques
We integrate the proposed weighted Bellman backup with UCB exploration into a single framework by utilizing the bootstrap with random initialization.
Bootstrap with random initialization. To train the ensemble of agents, we use the bootstrap with random initialization (Efron, 1982; Osband et al., 2016a), which enforces the diversity between agents through two simple ideas: First, we initialize the model parameters of all agents with random parameter values for inducing an initial diversity in the models. Second, we apply different samples to train each agent. Specifically, for each SAC agent in each timestep , we draw the binary masks from the Bernoulli distribution with parameter , and store them in the replay buffer. Then, when updating the model parameters of agents, we multiply the bootstrap mask to each objective function, such as: and in (4) and (5), respectively. We remark that Osband et al. (2016a) applied this simple technique to train an ensemble of DQN (Mnih et al., 2015) only for discrete control tasks, while we apply to SAC (Haarnoja et al., 2018) and Rainbow DQN (Hessel et al., 2018) for both continuous and discrete tasks with additional techniques.
UCB exploration. The ensemble can also be leveraged for efficient exploration (Chen et al., 2017; Osband et al., 2016a) because it can express higher uncertainty on unseen samples. Motivated by this, by following the idea of Chen et al. (2017), we consider an optimism-based exploration that chooses the action that maximizes
where and are the empirical mean and standard deviation of all Q-functions , and the is a hyperparameter. This inference method can encourage exploration by adding an exploration bonus (i.e., standard deviation ) for visiting unseen state-action pairs similar to the UCB algorithm (Auer et al., 2002). We remark that this inference method was originally proposed in Chen et al. (2017) for efficient exploration in discrete action spaces. However, in continuous action spaces, finding the action that maximizes the UCB is not straightforward. To handle this issue, we propose a simple approximation scheme, which first generates candidate action set from ensemble policies , and then chooses the action that maximizes the UCB (Line 4 in Algorithm 1). For evaluation, we approximate the maximum a posterior action by averaging the mean of Gaussian distributions modeled by each ensemble policy.
The full procedure of our unified framework, coined SUNRISE, is summarized in Algorithm 1.
Experimental results
We designed our experiments to answer the following questions:
Can SUNRISE improve off-policy RL algorithms, such as SAC (Haarnoja et al., 2018) and Rainbow DQN (Hessel et al., 2018), for both continuous (see Table 1 and Table 2) and discrete (see Table 3) control tasks?
How crucial is the proposed weighted Bellman backups in (5) for improving the signal-to-noise in Q-updates (see Figure 2)?
Can UCB exploration be useful for solving tasks with sparse rewards (see Figure 3(b))?
Is SUNRISE better than a single agent with more updates and parameters (see Figure 3(c))?
How does ensemble size affect the performance (see Figure 3(d))?
Continuous control tasks. We evaluate SUNRISE on several continuous control tasks using simulated robots from OpenAI Gym (Brockman et al., 2016) and DeepMind Control Suite (Tassa et al., 2018). For OpenAI Gym experiments with proprioceptive inputs (e.g., positions and velocities), we compare to PETS (Chua et al., 2018), a state-of-the-art model-based RL method based on ensembles of dynamics models; POPLIN-P (Wang & Ba, 2020), a state-of-the-art model-based RL method which uses a policy network to generate actions for planning; POPLIN-A (Wang & Ba, 2020), variant of POPLIN-P which adds noise in the action space; METRPO (Kurutach et al., 2018), a hybrid RL method which augments TRPO (Schulman et al., 2015) using ensembles of dynamics models; and two state-of-the-art model-free RL methods, TD3 (Fujimoto et al., 2018) and SAC (Haarnoja et al., 2018). For our method, we consider a combination of SAC and SUNRISE, as described in Algorithm 1. Following the setup in Wang & Ba (2020) and Wang et al. (2019), we report the mean and standard deviation across ten runs after 200K timesteps on five complex environments: Cheetah, Walker, Hopper, Ant and SlimHumanoid with early termination (ET). More experimental details and learning curves with 1M timesteps are in Appendix D.
For DeepMind Control Suite with image inputs, we compare to PlaNet (Hafner et al., 2019), a model-based RL method which learns a latent dynamics model and uses it for planning; Dreamer (Hafner et al., 2020), a hybrid RL method which utilizes the latent dynamics model to generate synthetic roll-outs; SLAC (Lee et al., 2020), a hybrid RL method which combines the latent dynamics model with SAC; and three state-of-the-art model-free RL methods which apply contrastive learning (CURL; Srinivas et al. 2020) or data augmentation (RAD (Laskin et al., 2020) and DrQ (Kostrikov et al., 2021)) to SAC. For our method, we consider a combination of RAD (i.e., SAC with random crop) and SUNRISE. Following the setup in RAD, we report the mean and standard deviation across five runs after 100k (i.e., low sample regime) and 500k (i.e., asymptotically optimal regime) environment steps on six environments: Finger-spin, Cartpole-swing, Reacher-easy, Cheetah-run, Walker-walk, and Cup-catch. More experimental details and learning curves are in Appendix F.
Discrete control benchmarks. For discrete control tasks, we demonstrate the effectiveness of SUNRISE on several Atari games (Bellemare et al., 2013). We compare to SimPLe (Kaiser et al., 2020), a hybrid RL method which updates the policy only using samples generated by learned dynamics model; Rainbow DQN (Hessel et al., 2018) with modified hyperparameters for sample-efficiency (van Hasselt et al., 2019); Random agent (Kaiser et al., 2020); two state-of-the-art model-free RL methods which apply the contrastive learning (CURL; Srinivas et al. 2020) and data augmentation (DrQ; Kostrikov et al. 2021) to Rainbow DQN; and Human performances reported in Kaiser et al. (2020) and van Hasselt et al. (2019). Following the setups in SimPLe, we report the mean across three runs after 100K interactions (i.e., 400K frames with action repeat of 4). For our method, we consider a combination of sample-efficient versions of Rainbow DQN and SUNRISE (see Algorithm 3 in Appendix B). More experimental details and learning curves are in Appendix G.
For our method, we do not alter any hyperparameters of the original RL algorithms and train five ensemble agents. There are only three additional hyperparameters , , and for bootstrap, weighted Bellman backup, and UCB exploration, where we provide details in Appendix D, F, and G.
2 Comparative evaluation
OpenAI Gym. Table 1 shows the average returns of evaluation roll-outs for all methods. SUNRISE consistently improves the performance of SAC across all environments and outperforms the model-based RL methods, such as POPLIN-P and PETS, on all environments except Ant and SlimHumanoid-ET. Even though we focus on performance after small samples because of the recent emphasis on making RL more sample efficient, we find that the gain from SUNRISE becomes even more significant when training longer (see Figure 3(c) and Appendix D). We remark that SUNRISE is more compute-efficient than modern model-based RL methods, such as POPLIN and PETS, because they also utilize ensembles (of dynamics models) and perform planning to select actions. Namely, SUNRISE is simple to implement, computationally efficient, and readily parallelizable.
DeepMind Control Suite. As shown in Table 2, SUNRISE also consistently improves the performance of RAD (i.e., SAC with random crop) on all environments from DeepMind Control Suite. This implies that the proposed method can be useful for high-dimensional and complex input observations. Moreover, our method outperforms existing pixel-based RL methods in almost all environments. We remark that SUNRISE can also be combined with DrQ, and expect that it can achieve better performances on Cartpole-swing and Cup-catch at 100K environment steps.
Atari games. We also evaluate SUNRISE on discrete control tasks from the Atari benchmark using Rainbow DQN. Table 3 shows that SUNRISE improves the performance of Rainbow in almost all environments, and outperforms the state-of-the-art CURL and SimPLe on 11 out of 26 Atari games. Here, we remark that SUNRISE is also compatible with CURL, which could enable even better performance. These results demonstrate that SUNRISE is a general approach.
3 Ablation study
Effects of weighted Bellman backups. To verify the effectiveness of the proposed weighted Bellman backup (5) in improving signal-to-noise in Q-updates, we evaluate on a modified OpenAI Gym environments with noisy rewards. Following Kumar et al. (2019), we add Gaussian noise to the reward function: where only during training, and report the deterministic ground-truth reward during evaluation. For our method, we also consider a variant of SUNRISE, which updates Q-functions without the proposed weighted Bellman backup to isolate its effect. We compare to DisCor (Kumar et al., 2020), which improves SAC by reweighting the Bellman backup based on estimated cumulative Bellman errors (see Appendix E for more details).
Figure 2 shows the learning curves of all methods on OpenAI Gym with noisy rewards. The proposed weighted Bellman backup significantly improves both sample-efficiency and asymptotic performance of SUNRISE, and outperforms baselines such as SAC and DisCor. One can note the performance gain due to our weighted Bellman backup becomes more significant in complex environments, such as SlimHumanoid-ET. We remark that DisCor still suffers from error propagation issues in complex environments like SlimHumanoid-ET and Ant because there are some approximation errors in estimating cumulative Bellman errors (see Section 6.1 for more detailed discussion). These results imply that errors in the target Q-function can be characterized by the proposed confident weight in (6) effectively.
We also consider another variant of SUNRISE, which updates Q-functions with random weights sampled from uniformly at random. In order to evaluate the performance of SUNRISE, we increase the noise rate by adding Gaussian noise with a large standard deviation to the reward function: where . Figure 3(a) shows the learning curves of all methods on the SlimHumanoid-ET environment over 10 random seeds. First, one can not that SUNRISE with random weights (red curve) is worse than SUNRISE with the proposed weighted Bellman backups (blue curve). Additionally, even without UCB exploration, SUNRISE with the proposed weighted Bellman backups (purple curve) outperforms all baselines. This implies that the proposed weighted Bellman backups can handle the error propagation effectively even though there is a large noise in reward function.
Effects of UCB exploration. To verify the advantage of UCB exploration in (7), we evaluate on Cartpole-swing with sparse-reward from DeepMind Control Suite. For our method, we consider a variant of SUNRISE, which selects action without UCB exploration. As shown in Fig 3(b), SUNRISE with UCB exploration (blue curve) significantly improves the sample-efficiency on the environment with sparse rewards.
Comparison with a single agent with more updates/parameters. One concern in utilizing the ensemble method is that its gains may come from more gradient updates and parameters. To clarify this concern, we compare SUNRISE (5 ensembles using 2-layer MLPs with 256 hidden units each) to a single agent, which consists of 2-layer MLPs with 1024 (and 256) hidden units with 5 updates using different random minibatches. Figure 3(c) shows that the learning curves on SlimHumanoid-ET, where SUNRISE outperforms all baselines. This implies that the gains from SUNRISE can not be achieved by simply increasing the number of updates/parameters. More experimental results on other environments are also available in Appendix D.
Effects of ensemble size. We analyze the effects of ensemble size on the Ant environment from OpenAI Gym. Figure 3(d) shows that the performance can be improved by increasing the ensemble size, but the improvement is saturated around . Thus, we use five ensemble agents for all experiments. More experimental results on other environments are also available in Appendix D, where the overall trend is similar.
Discussion
(Kumar et al., 2020) show that naive Bellman backups can suffer from slow learning in certain environments, requiring exponentially many updates. To handle this problem, they propose the weighted Bellman backups, which make steady learning progress by inducing some optimal data distribution (see (Kumar et al., 2020) for more details). Specifically, in addition to a standard Q-learning, DisCor trains an error model , which approximates the cumulative sum of discounted Bellman errors over the past iterations of training. Then, using the error model, DisCor reweights the Bellman backups based on a confidence weight defined as follows: where is a discount factor and is a temperature.
However, we remark that DisCor can still suffer from the error propagation issues because there is also an approximation error in estimating cumulative Bellman errors. Therefore, we consider an alternative approach that utilizes the uncertainty from ensembles. Because it has been observed that the ensemble can produce well-calibrated uncertainty estimates (i.e., variance) on unseen samples (Lakshminarayanan et al., 2017), we expect that the weighted Bellman backups based on ensembles can handle error propagation more effectively. Indeed, in our experiments, we find that ensemble-based weighted Bellman backups can give rise to more stable training and improve the data-efficiency of various off-policy RL algorithms.
2 Computation overhead
One can expect that there is an additional computation overhead by introducing ensembles. When we have ensemble agents, our method requires inferences for weighted Bellman backups and inferences ( for actors and for critics). However, we remark that our method can be more computationally efficient because it is parallelizable. Also, as shown in Figure 3(c), the gains from SUNRISE can not be achieved by simply increasing the number of updates/parameters.
Conclusion
In this paper, we introduce SUNRISE, a simple unified ensemble method, which integrates the proposed weighted Bellman backups with bootstrap with random initialization, and UCB exploration to handle various issues in off-policy RL algorithms. Especially, we present the ensemble-based weighted Bellman backups, which stabilizes and improves the learning process by re-weighting target Q-values based on uncertainty estimates Our experiments show that SUNRISE consistently improves the performances of existing off-policy RL algorithms, such as Soft Actor-Critic and Rainbow DQN, and outperforms state-of-the-art RL algorithms for both continuous and discrete control tasks on both low-dimensional and high-dimensional environments. We hope that SUNRISE could be useful to other relevant topics such as sim-to-real transfer (Tobin et al., 2017), imitation learning (Torabi et al., 2018), understanding the connection between on-policy and off-policy RL (Schulman et al., 2017), offline RL (Agarwal et al., 2020), and planning (Srinivas et al., 2018; Tamar et al., 2016).
Acknowledgements
This research is supported in part by ONR PECASE N000141612723, Open Philanthropy, Darpa LEARN project, Darpa LwLL project, NSF NRI #2024675, Tencent, and Berkeley Deep Drive. We would like to thank Hao Liu for improving the presentation and giving helpful feedback. We would also like to thank Aviral Kumar and Kai Arulkumaran for providing tips on implementation of DisCor and Rainbow.
References
Appendix A SUNRISE: Soft actor-critic
where is a transition, is a replay buffer, are the delayed parameters, and is a temperature parameter. At the soft policy improvement step, the policy with its parameter is updated by minimizing the following objective:
We remark that this corresponds to minimizing the Kullback-Leibler divergence between the policy and a Boltzmann distribution induced by the current soft Q-function.
SUNRISE without UCB exploration. For SUNRISE without UCB exploration, we use random inference proposed in Bootstrapped DQN (Osband et al., 2016a), which randomly selects an index of policy uniformly at random and generates the action from the selected actor for the duration of that episode (see Line 3 in Algorithm 2).
Appendix B Extension to Rainbow DQN
Background. DQN algorithm (Mnih et al., 2015) learns a Q-function, which is modeled as a neural network with parameters , by minimizing the following Bellman residual:
where is a transition, is a replay buffer, and are the delayed parameters. Even though Rainbow DQN integrates several techniques, such as double Q-learning (Van Hasselt et al., 2016) and distributional DQN (Bellemare et al., 2017), applying SUNRISE to Rainbow DQN can be described based on the standard DQN algorithm. For exposition, we refer the reader to Hessel et al. (2018) for more detailed explanations of Rainbow DQN.
B.2 SUNRISE: Rainbow DQN
Bootstrap with random initialization. Formally, we consider an ensemble of Q-functions, i.e., , where denotes the parameters of the -th Q-function.Here, we remark that each Q-function has a unique target Q-function. To train the ensemble of Q-functions, we use the bootstrap with random initialization (Efron, 1982; Osband et al., 2016a), which enforces the diversity between Q-functions through two simple ideas: First, we initialize the model parameters of all Q-functions with random parameter values for inducing an initial diversity in the models. Second, we apply different samples to train each Q-function. Specifically, for each Q-function in each timestep , we draw the binary masks from the Bernoulli distribution with parameter , and store them in the replay buffer. Then, when updating the model parameters of Q-functions, we multiply the bootstrap mask to each objective function.
Weighted Bellman backup. Since conventional Q-learning is based on the Bellman backup in (8), it can be affected by error propagation. I.e., error in the target Q-function gets propagated into the Q-function at the current state. Recently, Kumar et al. (2020) showed that this error propagation can cause inconsistency and unstable convergence. To mitigate this issue, for each Q-function , we consider a weighted Bellman backup as follows:
where is a transition, and is a confidence weight based on ensemble of target Q-functions:
where is a temperature, is the sigmoid function, and is the empirical standard deviation of all target Q-functions . Note that the confidence weight is bounded in because standard deviation is always positive.We find that it is empirically stable to set minimum value of weight as 0.5. The proposed objective down-weights the sample transitions with high variance across target Q-functions, resulting in a loss function for the Q-updates that has a better signal-to-noise ratio. Note that we combine the proposed weighted Bellman backup with prioritized replay (Schaul et al., 2016) by multiplying both weights to Bellman backups.
UCB exploration. The ensemble can also be leveraged for efficient exploration (Chen et al., 2017; Osband et al., 2016a) because it can express higher uncertainty on unseen samples. Motivated by this, by following the idea of Chen et al. (2017), we consider an optimism-based exploration that chooses the action that maximizes
where and are the empirical mean and standard deviation of all Q-functions , and the is a hyperparameter. This inference method can encourage exploration by adding an exploration bonus (i.e., standard deviation ) for visiting unseen state-action pairs similar to the UCB algorithm (Auer et al., 2002). This inference method was originally proposed in Chen et al. (2017) for efficient exploration in DQN, but we further extend it to Rainbow DQN. For evaluation, we approximate the maximum a posterior action by choosing the action maximizes the mean of Q-functions, i.e., . The full procedure is summarized in Algorithm 3.
Appendix C Implementation details for toy regression tasks
We evaluate the quality of uncertainty estimates from an ensemble of neural networks on a toy regression task. To this end, we generate twenty training samples drawn as , where , and train ten ensembles of regression networks using bootstrap with random initialization. The regression network is as fully-connected neural networks with 2 hidden layers and 50 rectified linear units in each layer. For bootstrap, we draw the binary masks from the Bernoulli distribution with mean . As uncertainty estimates, we measure the empirical variance of the networks’ predictions. As shown in Figure 1(b), the ensemble can produce well-calibrated uncertainty estimates (i.e., variance) on unseen samples.
Appendix D Experimental setups and results: OpenAI Gym
Environments. We evaluate the performance of SUNRISE on four complex environments based on the standard bench-marking environmentsWe used the reference implementation at https://github.com/WilsonWangTHU/mbbl (Wang et al., 2019). from OpenAI Gym (Brockman et al., 2016). Note that we do not use a modified Cheetah environments from PETS (Chua et al., 2018) (dented as Cheetah in POPLIN (Wang & Ba, 2020)) because it includes additional information in observations.
Training details. We consider a combination of SAC and SUNRISE using the publicly released implementation repository (https://github.com/vitchyr/rlkit) without any modifications on hyperparameters and architectures. For our method, the temperature for weighted Bellman backups is chosen from , the mean of the Bernoulli distribution is chosen from , the penalty parameter is chosen from , and we train five ensemble agents. The optimal parameters are chosen to achieve the best performance on training environments. Here, we remark that training ensemble agents using same training samples but with different initialization (i.e., ) usually achieves the best performance in most cases similar to Osband et al. (2016a) and Chen et al. (2017). We expect that this is because splitting samples can reduce the sample-efficiency. Also, initial diversity from random initialization can be enough because each Q-function has a unique target Q-function, i.e., target value is also different according to initialization.
Learning curves. Figure 4 shows the learning curves on all environments. One can note that SUNRISE consistently improves the performance of SAC by a large margin.
Effects of ensembles. Figure 5 shows the learning curves of SUNRISE with varying values of ensemble size on all environments. The performance can be improved by increasing the ensemble size, but the improvement is saturated around .
Appendix E Experimental setups and results: noisy reward
DisCor. DisCor (Kumar et al., 2020) was proposed to prevent the error propagation issue in Q-learning. In addition to a standard Q-learning, DisCor trains an error model , which approximates the cumulative sum of discounted Bellman errors over the past iterations of training. Then, using the error model, DisCor reweights the Bellman backups based on a confidence weight defined as follows:
where is a discount factor and is a temperature. By following the setups in Kumar et al. (2020), we take a network with 1 extra hidden layer than the corresponding Q-network as an error model, and chose for all experiments. We update the temperature via a moving average and use the learning rate of . We use the SAC algorithm as the RL objective coupled with DisCor and build on top of the publicly released implementation repository (https://github.com/vitchyr/rlkit).
Appendix F Experimental setups and results: DeepMind Control Suite
Training details. We consider a combination of RAD and SUNRISE using the publicly released implementation repository (https://github.com/MishaLaskin/rad) with a full list of hyperparameters in Table 4. Similar to Laskin et al. (2020), we use the same encoder architecture as in (Yarats et al., 2019), and the actor and critic share the same encoder to embed image observations.However, we remark that each agent does not share the encoders unlike Bootstrapped DQN (Osband et al., 2016a). For our method, the temperature for weighted Bellman backups is chosen from , the mean of the Bernoulli distribution is chosen from , the penalty parameter is chosen from , and we train five ensemble agents. The optimal parameters are chosen to achieve the best performance on training environments. Here, we remark that training ensemble agents using same training samples but with different initialization (i.e., ) usually achieves the best performance in most cases similar to Osband et al. (2016a) and Chen et al. (2017). We expect that this is because training samples can reduce the sample-efficiency. Also, initial diversity from random initialization can be enough because each Q-function has a unique target Q-function, i.e., target value is also different according to initialization.
Learning curves. Figure 6(g), 6(h), 6(i), 6(j), 6(k), and 6(l) show the learning curves on all environments. Since RAD already achieves the near optimal performances and the room for improvement is small, we can see a small but consistent gains from SUNRISE. To verify the effectiveness of SUNRISE more clearly, we consider a combination of SAC and SUNRISE in Figure 6(a), 6(b), 6(c), 6(d), 6(e), and 6(f), where the gain from SUNRISE is more significant.
Appendix G Experimental setups and results: Atari games
Training details. We consider a combination of sample-efficient versions of Rainbow DQN and SUNRISE using the publicly released implementation repository (https://github.com/Kaixhin/Rainbow) without any modifications on hyperparameters and architectures. For our method, the temperature for weighted Bellman backups is chosen from , the mean of the Bernoulli distribution is chosen from , the penalty parameter is chosen from , and we train five ensemble agents. The optimal parameters are chosen to achieve the best performance on training environments. Here, we remark that training ensemble agents using same training samples but with different initialization (i.e., ) usually achieves the best performance in most cases similar to Osband et al. (2016a) and Chen et al. (2017). We expect that this is because splitting samples can reduce the sample-efficiency. Also, initial diversity from random initialization can be enough because each Q-function has a unique target Q-function, i.e., target value is also different according to initialization.
Learning curves. Figure 7, Figure 8 and Figure 9 show the learning curves on all environments.