Title: Uncertainty-sensitive Learning and Planning with Ensembles

Abstract: We propose a reinforcement learning framework for discrete environments in which an agent makes both strategic and tactical decisions. The former manifests itself through the use of value function, while the latter is powered by a tree search planner. These tools complement each other. The planning module performs a local what-if analysis, which allows to avoid tactical pitfalls and boost backups of the value function. The value function, being global in nature, compensates for inherent locality of the planner. In order to further solidify this synergy, we introduce an exploration mechanism with two distinctive components: uncertainty modelling and risk measurement.
To model the uncertainty we use value function ensembles, and to reflect risk we use propose several functionals that summarize the implied by the ensemble. We show that our method performs well on hard exploration environments: Deep-sea, toy Montezuma's Revenge, and Sokoban. In all the cases, we obtain speed-up in learning and boost in performance.

1. Introduction:

The model-free and model-based approaches to reinforcement learning (RL) have a complementary set of strengths and weaknesses. While the former offers good asymptotic performance, it suffers from poor sample complexity. In contrast, the latter usually needs significantly less training samples, but often fails to achieve state-of-the-art results on complex tasks (which is primarily attributed to models' imperfections). The interplay of model-based and model-free approaches in RL has received a lot of research attention. This led, for example, to strong AI systems like Silver et al. (2017; 2018) or more recently to Lowrey et al. (2018) , which is closely related to our work.

When dealing with challenging new RL domains it is helpful to develop tools for addressing strategic and tactical decision-making. These two perspectives complement each other: strategic perspective is global, static, and often imprecise, while tactical perspective is local, dynamic and exact. We argue that value function can be considered as an example of the former, while a planner as an example of the latter. Indeed, value function approximators provide noisy estimates (imprecise) of values (static) to every state (global). Conversely, planning provides optimal control, which starting from a given state (local) generates actions (dynamic) that are temporally coherent and result in a better-executed trajectories (exact). It is only reasonable to combine the two into one system. This is achieved by plugging the value function into the planner, to provide guided heuristics in the local search, shorten the search horizon, and make the search computationally efficient. For complex problems, the above setup has to be supplemented by an exploration strategy. Such a strategy might be based on modeling uncertainty of the value function approximation (e.g., using dropout sampling, variational inference, distributional RL, bootstrap ensemble, etc.). The uncertainty is quantified by a risk measure, which is then utilized by a planner to guide exploration.

Consider a situation of an agent with limited memory and computational resources, being dropped into a complex and diverse environment. This setup excludes any hope for brute force strategy and implies that a perfect planner is out of reach. In this paper, we consider Sokoban, a classic logical puzzle known for its combinatorial complexity and a recent benchmark for RL, ChainEnv, a seemingly impossible task also known as a 'hay in a needle-stack' problem (see Osband et al. (2018) ), and Toy Montezuma's Revenge, environment notoriously known for its exploration difficulty (see Guo et al. (2019) ). Importantly, we focus on sparse reward variants of the aforementioned environments (see Section 3). Since of our method involves planning, an agent has to have an access to the world model. In this paper we assume that it is the perfect model. The reason is that challenges presented by the selected environments are the dominating factor driving difficulty of the task (in fact, answering the question of whether a Sokoban level is solvable is NP-hard, see e.g. Dor & Zwick (1999) ). It is also in part due to this fact that a significant body of work dealing with difficult environments makes a similar assumption (see e.g. Silver et al. (2017; 2018) , Orseau et al. (2018b) ).

The main contribution of this work is showing how recent progress in AI can be brought together to improve planning, value function learning, and exploration, in a way that together they form robust algorithms for solving challenging reinforcement learning environments. In particular:

1. For uncertainty modeling, we assume the point of view Osband et al. (2018) , which uses ensembles to approximate posterior distribution. 2. In the spirit of Lowrey et al. (2018) , we incorporate risk measures to guide exploration. 3. For the planner, we base on AlphaZero Monte-Carlo Tree Search (see Silver et al. (2017) ), which we enhance with the possibility of exploiting the graph structure of environments and the properties of the optimal solutions. 4. In the value function training protocol, we introduce several improvements, including a version of self imitation learning mechanism (Oh et al. (2018a) ) and hindsight (Andrychowicz et al. (2017) ).

The rest of the paper is organized as follows. In the next subsection we provide an overview of related work. In Section 2 we present and discuss our method in details. This is followed by a section with experiments and passing to conclusions. We provide code to our work https://github.com/learningandplanningICLR/learningandplanning and a dedicated website https://sites.google.com/view/learn-and-plan-with-ensembles with more details and movies.

1.1. Related work:

The ideas of mixing model-based and model-free learning were perhaps first stated explicitly in Sutton (1990) . Many approaches followed. More recently, in the groundbreaking series of papers Silver et al. (2017) , Silver et al. (2018) culminating in AlphaZero, the authors have developed an elaborate system that plans and performs model-free training to master the game of Go (and others). Similar ideas were also studied in Anthony et al. (2017) .

Perhaps, the work which is closest to ours is Lowrey et al. (2018) . It is argued in the paper that an agent with limited computational resources in a complex environment needs both to plan and learn from the incoming stream of experience. Importantly, the value function in Lowrey et al. (2018) is modeled by an ensemble of value functions. The risk measure used to combine them is given by the 'log-sum-exp formula' (Lowrey et al., 2018, 6) . The authors show experimentally that this approach leads to improvements in various continuous tasks, including humanoid training. In our work, we deal with a discrete setting, which enforces a different planning module (here MCTS-based). Moreover, we treat more diverse class of risk measures (see Section 2).

Constructing neural network models that would incorporate uncertainty in a principled Bayesian way has proven to be challenging and remains and open problem. A promising new results using ensembles include Osband et al. (2018; 2017 ), Lakshminarayanan et al. (2017)) . Ensembles of models were also successfully used to improve model-based RL training, see Kurutach et al. (2018) , Chua et al. (2018) , and the references therein. We note that unprincipled ensemble methods are willingly used by RL practitioners. For example, in a recent competition Kidzinski et al. (2019) aimed to train an agent able to use a prosthetic leg, four top-ten solutions used some sort of ensembles.

Another work similar to ours is Guo et al. (2014) , in which the authors use MCTS in the role of an 'expert' from which a neural policy is learnt using the dagger algorithm, Ross & Bagnell (2014) . The basic difference is that Guo et al. (2014) Finally, our paper is related to research focusing on study of exploration. Fundamental results in this area concern the multi-arm bandits problem, see Lattimore & Szepesvári (2018) and the references therein. Methods developed in this area have been successfully applied in planning algorithms, see Kocsis et al. (2006) and Silver et al. (2017; 2018) . Furthermore, a measure with a loading on variance (defined in Section 2) is related to UCB-V algorithm developed in Audibert et al. (2007) . Another set of methods have been developed in an attempt to solve notoriously hard Montezuma's Revenge, see for example Ecoffet et al. (2019) or Guo et al. (2019) .

In our work we use also hindsight, see Andrychowicz et al. (2017) . Its primarily motivation is to enrich the learning signal and train generalized value function. However, in certain situation it can be considered as an exploration algorithm.

2. Method description:

In this section, we describe our method: the planning and exploration components, as well as the training protocol. Algorithm 1 shows how the components are brought together in the training loop. The pseudo-code for planner.run episode is listed in Algorithm 2, and the remainder of pseudo-code can be found in Appendix A. 

B ← replay_buffer.batch() B = {(s b , v b , m b )}, see Algorithm 10 10:

Update V θ by one step of gradient descent e.g. RMSProp

∇ θi   1 |B| (s,v,m)∈B m i V θi (s) -v 2 + ζθ 2 i   , for i ∈ {1, . . . , K} 11: until convergence

For the planer component we develop an MCTS-inspired algorithm. 1 It is novel in two aspects: it utilizes a risk-sensitive policy (for tree traversal and action choice) intended to guide exploration, and it includes methods exploiting the graph structure and enables avoiding cycles.2 

The loop avoidance is achieved in two ways: by backpropagation of some fixed negative value through the in-tree path ending with a leaf having no unvisited neightbours (see the pseudo-code in Appendix A related to dead ends), and during tree traversal, when the agent encouraged to avoid actions leading to previously visited states on the path (see pseudo-code related to penalty p in Appendix A). To reinforce this effect, the agent is also encouraged to avoid actions leading to previously visited states on the episode level (see Algorithm 2, where penalty e ).

These enhancements combined, make it possible to learn even in sparse rewards scenarios, which is experimentally demonstrated in Section 3 (all used environments have sparse rewards). We note that Algorithm 1 is not MCTS specific, other planners could be used as well.

The logic of our MCTS is laid out in Algorithm 2. We assume that each node of the search tree, say n, stores a visit count n.count, accumulated value n.value, accumulated reward n.reward(a), and its children are denoted by n.child(a) for each action a ∈ A. We define

Q θ (n, a) = n.reward(a) + γn.child(a).value,

where γ > 0 is a discount rate. 

A ← {a ∈ A(n) : n.child(a) / ∈ seen} 3: if A = ∅ then Terminal or dead-end 4:

return None 5: else

6::

A ← A(n) 7: Choose action according to equation 1

a * ← arg max a∈A E θ∼Θ φ a ( Q θ (n)) 8: return a *

Our proposed risk-sensitive exploration method is implemented at the level of MCTS traversal tree, see step 7 in Algorithm 3. Its key defining elements are uncertainty modeling and risk measurement. A risk-sensitive tree traversal policy is defined as follows:

EQUATION

)

where A is the action space, φ a : R |A| → R is a risk measure, and Q θ is an estimator of the Q-function. The posterior distribution Θ models uncertainty in the value estimation.

We implement the posterior Θ using ensembles, namely E θ∼Θ [f (θ)] is approximated by

1 K K i=1 f (θ i ),

where K is the size of an ensemble. This approximation stems from Osband et al. (2018, Lemma 3) , which shows that for Bayesian regression in a Gaussian linear model, generating samples from posterior distribution is equivalent to solving a suitable optimization problem, see Appendix C. In our case we use an ensemble of value functions. In some cases, we "sub-sample" from Θ, which is inspired by Osband et al. (2016) and the classical Thomson sampling (see Appendix C for details).

Using risk measure is inspired by Lowrey et al. (2018) , who used φ a (x) = e κxa for x ∈ R |A| and κ > 0. In this paper we consider the following choices of φ a :

• A measure with a loading on variance, φ a (x) = x a +κx 2 a , κ > 0. This includes second moments and can be easily generalized to include variance, standard deviation and exploration bonuses.

• A relative majority vote (also known as plurality vote) measure,

φ a (x) = 1 arg max a x a = a .

(2)

Contrary to the other cases, φ a defined in equation 2 depends not only on marginal values of its input, but the whole input (i.e. the estimator vector Q θ ). It leads to a rule resembling optimal Bayes classifier form, i.e. the one which chooses a minimizing P(a * θ (s) = a).

The intuitions behind the aforementioned choices of φ a 's are as follows. One can think of φ a (x) = e κxa used in Lowrey et al. (2018) as a measure capturing all moments of value ensemble. For small values of κ ≈ 0, it behaves like the measure with a loading on variance (via the Tylor expansion). The mean approximates the value of a given action, while the variance quantifies the epistemic uncertainty. Taking weighted sum of these terms (as we do in "mean+var" experiments, see Table 3 ) has the aim of balancing exploitation and exploration. It is also related to UCB-V algorithm, see Audibert et al. (2007) . Voting, on the other hand, is a well established approach when combining ensembles, see e.g. Breiman (1996) or Rokach (2010) . A relative majority vote, in particular, is simple and it can lead to good performance, see e.g. Osband et al. (2016) . In the context of planning and RL, it has several interesting properties. In particular, the distribution of votes across ensembles encodes the uncertainty related to the optimal action in a given state. High uncertainty may result in stochastic movement (caused by a uniform tie breaking), and consequently lead to higher exploration. On the other hand, low uncertainty may result in an exploitative behaviour of an agent and, as a result, lower exploration. Additionally, voting may improve decision making of an agent in the states, where some action can be dangerous (e.g. lead to irreversible states).

We conclude this section by describing the part of Algorithm 1 related to value functions update. The episodes are collected and stored in a replay buffer. The replay buffer performs some addition bookkeeping by storing, for each transition, information whether it comes from a solved episode or not (in the case of environments that provide such information, like Sokoban). This mechanism allows sampling batches with a fixed ratio of solved to unsolved transitions (see Algorithm 8 in Appendix A). Such a method resembles self-imitation techniques, see e.g. Oh et al. (2018b) . The value functions are trained to minimize l 2 distance from target values sampled from the buffer. The target values can be computed in two modes: bootstrap, which utilizes the values accumulated during the MCTS phase, and factual, corresponding to discounted rewards in an episode (see Algorithm 8 in Appendix A). Additionally, some experiments use masks which, analogously to Osband et al. (2018) , form a mechanism of assigning a transition to a value function (see Appendix C). Finally, we implement ensembles as a set of neural networks (we also experiment with multi-headed architectures sharing some lower layers). We use both architectures with or without random priors, for details see Appendix B and Osband et al. (2018) .

3. Experiments:

In this section, we provide experimental evidence to show that using ensembles and risk measures is useful. We chose three environments, Deep-sea, toy Montezuma's Revenge, and

Sokoban. In all the cases we work with single reward versions of the these environments i.e. the agent's is rewarded only upon success completion of its task.

We use an MCTS planner with the number of passes equal to 10 (see line 4 of Algorithm 2).

We consider this number to be rather small for MCTS-like planning methods. Interestingly, we observed that such a relatively weak planner is sufficient to obtain a well-preforming algorithm.

We utilize various neural network architectures, see Appendix B. We measure uncertainty using either variance or standard deviation except for the case of Sokoban with randomlygenerated boards, where voting was used, see equation 2.

Configuration of the experiments is summarized in Table 3 in Appendix C. increased, while x is controlled. The agent issues actions in {-1, 1}. These are translated to step left or step right (increasing x by -1 or +1, respectively, as long as x ≥ 0; otherwise x remains unchanged) according to a prescribed action mask (not to be confused with transition masks in Algorithm 1). For each step right the agent is punished with 0.01/N . After N steps, the game ends, and the agent receives reward +1 if and only if it reaches position (N, N ). The action mask mentioned above is randomized at each field at the beginning of training (and kept fixed).

Such a game is purposely constructed so that naive random exploration schemes fail already for small N 's. Indeed, a random agent has chance (1/2) N of reaching the goal even if we disregard misleading rewards for step right. In Figure 1 , one can observe how the exploration progresses of our method. In Figure 2 , one can see a comparison of non-ensemble models, ensemble models with Thomson sampling (see Appendix C) but without uncertainty bonus (κ = 0) and our final ensemble model with uncertainty bonus κ = 50. We conclude that both using sub-sampling and ensembles is essential to achieve good exploration (for details see also Appendix C).

3.2. Toy Montezuma's Revenge:

Toy Montezuma's Revenge is a navigation maze-like environment. It was introduced in Roderick et al. ( 2018) to evaluate ideas of using higher-level abstractions in long-horizon problems. While its visual layer is greatly reduced version of the actual Montezuma's Revenge Atari game, it retains much of the original's exploration problems. This makes it a useful test environment for exploration algorithms, see e.g. Guo et al. (2019) . In our experiments It is expected that any simple exploration technique would fail in this case (we provide some baselines in Table 1 ). Our method based on ensembles solves this exploration challenge even in a harder, sparse reward case. 4 The results are summarized in Table 1 . We have three setups: no-ensemble; ensemble, no std; ensemble, std. In the first case, we train using Algorithm 1 with a single neural-network. In the second case, for each episode we sub-sample 10 members of ensemble of 20 to be used and the MCTS is guided by their mean. In the final third case, we follow the same protocol but we add to the mean the standard deviation. In our experiments we observe that no-ensemble in 30 out of 43 cases does not leave behind the first room. The setup without explicit exploration bonus, ensemble, no std, perform only slightly better. Finally, we observe that ensemble, std behaves very well.

Further experimental details and the network architecture are presented in Appendix B and C.

3.3. Sokoban:

Sokoban is an environment known for its combinatorial complexity. The agent's goal is to push all boxes (marked as yellow, crossed squares) to the designed spots (marked a We report the number of successful runs and the number of seeds of network initialization. We also show the average number of visited rooms, which is a proxy for the learning progress.

square with red dot in the middle), see Figure 4 . Apart from the navigational factor, the difficulty of this game is greatly increased by the fact that some actions are irreversible. A canonical example of such an action is pushing a box into a corner, though there are multiple less obvious cases. Formally, this difficulty manifests itself in the fact that deciding whether a level of Sokoban is solvable or not, is NP-hard, see e.g. Dor & Zwick (1999) . Due to these challenges the game has been considered as a testbed for reinforcement learning and planning methods.

Operationally, to generate Sokoban levels we use an automated procedure proposed by Racanière et al. (2017) . Some RL approaches to solving Sokoban (e.g. Racanière et al. (2017) , Guez et al. ( 2019)) assume additional reward signal in the game, e.g. for pushing a box into a designed spot. In this work we use sparse setting, that is the agent is rewarded only when all the boxes are put into place.

It is interesting to note, that Sokoban offers two exploration problems: single-level-centric, where a level-specific exploration is needed, and multi-level-centric, where a 'metaexploration' strategy is required, which works in a levelagnostic manner or can quickly adapt. As a result, we conducted three lines of experiments using ensembles: a) learning to solve randomly generated boards(dubbed as multipleboards Sokoban), b) learning to solve a single board (dubbed as single-boards Sokoban) , c) transfer and learnable ensembles.

In our experiment we use Sokoban with board of size (10, 10) and 4 boxes. We use the limit of 200 steps in the experiment a) and 100 in the remaining ones. 

Multiple-board Sokoban, learning to solve randomly generated boards:

In this experiment we measure the ability of our approach to solve randomly generated Sokoban boards. We measure the performance of the agent by computing the win rate on last 1000 games. In this experiment we use an ensemble value function using relative majority voting as formalized in equation 2.

Relative majority voting takes into account the uncertainty of ensembles when it comes to the final outcome, not only the uncertainty in assessment of particular action. After 80000 games, our method reaches 85% win rate, compared to 76% of an agent not using ensembles, see Figure 5 . As a measure of exploration ) and transfer from ensembles of 2 and 3 value functions (Trans 2 and Trans 3). In the later two cases the aggregation of values is learned. The results are averaged over 20 seeds.

we also present the size of the game graph explored during episodes (red curve in Figure 5 ).

It shows an interesting effect, which can be interpreted as a transition from exploration to exploitation approximately at a 40% win-rate mark or, equivalently, 10000 games.

Single-board Sokoban. Learning to solve a single board In this experiment we measure the extent in which our methods can plan and learn on single boards. We note that this setting differs substantially from the one in the previous paragraph. In the multipleboards Sokoban there is a possibility of generalization from easier to harder scenarios (e.g. randomly initialized network solves 0.7% of boards). Such a transfer is obviously not possible in the single-board case studied here, however there are many attempts on the same board, which enables the agent to explore the board's state space.

For the single-board Sokoban we used experimental settings similar to the one in Section 3.2, see also details in Appendix C. We observe that the setup with ensembles solves 73% compared to 50% the standard training without ensembles. The latter might seem surprisingly good, taking into account the sparse reward. This follows by the loop avoidance described in Section 2. If during planning the agent finds itself in a situation from which it cannot find a novel state (i.e. encounters dead-end in Algorithm 6) a negative value, set to -2 in our experiments, is backpropagated in Algorithm 5 to already seen vertices. We speculate that this introduces a form of implicit exploration.

In the singe-board Sokoban case we performed also experiments on (8, 8) boards with 4 boxes obtaining success rate of 94% compared to 64% on the standard non-ensemble settings.

Transfer and learnable ensembles Generating any new board can be seen as a cost dimension along with sample complexity. This quite naturally happens in meta-learning problems. We tested how value functions learned on small number of boards perform on new previously unseen ones. We used the following protocol, we trained value function on fixed number of 10 games. To ease the training we used relabeling akin to Andrychowicz et al. (2017) 5 . We evaluate these models on other boards. It turns out that they are typically quite weak, arguably it is not very surprising as solving 10 boards does not give much chance to infer 'the general' solutions. In the second phase we use ensembles of the models. More precisely, we calculate the values of n = 2, 3 models and aggregate it using a small neural networks with one fully connected hidden layer. This network is learnable and trained using the standard setup. We observe that the quality of such ensemble increases with the number of components as summarized in Table 2 . We observed high variability of the results over seeds, this is to be expected as board in Sokoban significantly vary in difficulty. We also observe that maximal results for transfer increase with the number of value function, being approximately 10%, 11% and 12%. This further supports the claim that ensembling may lead to improved performance. In 5-layer experiment we use a network with 5 hidden cnn layers, see details in Appendix B, we compare this with an analogous 4 layers network. In the latter case, we obtain weaker result. We speculate this might be due to the fact that smaller architecture is easier to overfit.

A Algorithm:

In this section we detail the building blocks of Algorithm 1. As mentioned in Section 2, the key elements of MCTS (see Algorithm 2) are tree traversal, leaf expansion, and backpropagate, shown in Algorithm 4, Algorithm 6 and Algorithm 5, respectively. Algorithm 7 shows the update of a tree node. In particular, Algorithm 6 shows how the value function enters the picture, by evaluating all of the leaf's children (line 9). Algorithm 4 and Algorithm 5 both use variable penalty p . This is a penalty corresponding to entering the same states during tree traversal (hence is operates on the planner level) and the change is applied during traversal, and undone during backpropagation. The following blocks of code are related to the training setup. Algorithm 8 is responsible for computing an appropriated value for each element of the episode. There are two available modes: "bootstrap", which utilizes the values accumulated during the MCTS phase, and "factual", which represents the sum of discounted rewards in the episode. In the "bootstrap" mode we undo the penalty applied during the episode generation stage (line 4 in the Algorithm 2). The inner details of replay buffer, in particular Hindsight and self-imitation, is given in Algorithm 9 and Algorithm 10. Hindsight refers to any method that processes episode, and potentially overrides states values (see lines 1-2 in Algorithm 9). Algorithm 10 shows the way a batch is generated. First, for each transition it is determined whether it should be sampled from a solved or unsolved episode (according to a fixed ratio). Second, a game is sampled from a population determined in the previous step, with probability proportional to the game length. Finally, given a game a transition is chosen uniformly. 

B Architectures:

Deep-sea For Deep-see environment we encode state as one hot vector of size N 2 , and learn simple linear transformation for value estimation.

Toy Montezuma Revenge Observation is represented as tuple containing current room location, agent position within the room and status of all keys and doors on the board. To estimate value we use fully-connected neural networks with two hidden layers consisting 50 neurons each.

Single-board Sokoban Observation has a shape (10, 10, 7) where first two coordinates are spatial and the third coordinate one-hot encodes type of a state (e.g. box, target, agent, wall). To estimate value we flatten the observation and apply fully-connected neural networks with two hidden layers consisting 50 neurons each.

Multiple-boards Sokoban:

Here we use the same observation type as in the single-board problem. Each value function network is composed of five 3 × 3 convolutional layers with with stride 1, followed by two fully connected layers with 128 units and 1 unit, respectively. In Osband et al. (2018, Lemma 3) showed that for Bayesian linear regression setting with Gaussian prior and noise model, generating samples from posterior distribution is equivalent to solving an appropriate optimization problem. To be exact, suppose D = {(x i , y i )} is the dataset, f θ (x) = x T θ is the regression function, i is a Gaussian noise, θ comes from a Gaussian prior, and ỹi = y i + i . Then the solution of the following problem arg min

C Training details:



Randomized priors:

EQUATION

)

for some ζ > 0, is a sample from the posterior θ|D. Consequently, Osband et al. (2018) propose to use equation 3 as a training objective and include randomized prior in the value function approximator. This objective is matched with the one used in Algorithm 1, and some of our experiments include randomized priors.

Masks An important decision for training, is how to assign transitions to the particular elements of value functions ensemble. This is implemented using masks, see Algorithm 1. Suppose a batch B is considered in an update step (see lines 9-10 of Algorithm 1) a let t = (s, v, m) ∈ B be a transition. A mask m ∈ {0, 1} {1,...,K} has the following interpretation: m i = 1 if and only if the transition t is used to train V θi , i = 1, . . . , K.

We experimented with the following versions of masking:

• dynamic masks: masks are generated anew whenever transition is sampled from replay buffer,

• static masks: each transition is assigned a fixed mask generated when added to the replay buffer.

In the cases of dynamic masks, each batch was split equally among the elements of ensemble (for this we kept the batch size to be the multiplicity of the number of ensembles). The static masks were inspired by the Bootstrapped DQN, see (Osband et al., 2016, Appendix B) , where it is a core idea. We experimented with applying a different mask to each transition according to the Bernoulli distribution, or to assign the same masks for all transitions in the same trajectory.

We found it useful to use static masks in the Deep-sea, Toy Montezuma's Revenge and Singleboard Sokoban experiments, and dynamic masks in Multiple-board Sokoban experiments.

Ensembles sampling Recall that equation 1 involves calculating the expected value, E θ∼Θ , with respect to the posterior distribution Θ. In some experiments we instead subsample from Θ. Such an approach follows Osband et al. (2016) , which in turns is inspired by the classical Thomson sampling (see discussion (Osband et al., 2016, Section 4 ) and the original Thompson (1933) ). To be concrete, for a given a risk measure φ a equation 1 reduces to a * (n) := arg max

EQUATION

where E = {1, . . . , K}. Sub-sampling, with a fixed parameter , is equivalent to computing equation 4, with E taken as a random subset of {1, . . . , K} of cardinality . 

Hiperparameters:



:

MCTS is a family of algorithms that iteratively build a search tree, alternating between the following stages: tree traversal, leaf expansion and evaluation, and backpropagation, seeBrowne et al. (2012) for a survey on the topic.

This is useful for a broad class of environments (including the ones we used in the experimental part) for which the optimal trajectory does not have cycles.

We use a slightly modified code from https://github.com/chrisgrimm/deep_abstract_q_ network

DTSIL builds on the intermediate partial solutions, which are ranked according to their reward, thus we suspect it would fail in the sparse reward case.

More precisely, for a failing trajectory we choose a random time-step and shift the target spots so that they match the current location of boxes. We note that although this operation requires the knowledge of the game mechanics (i.e. its perfect model) it is used only in this phase

Figures and Tables:

Figure 1: The heatmaps of standard deviations of ensemble values in the Deep-sea environment. High values are marked in blue and low in white. At the beginning of training (left picture) the standard deviation is high for all states. Gradually it is decreased in the states that have been explored. Finally (the right) the reward state is found. Note that the upper-right part of the board is unreachable.

Figure 2: Comparison of number of episodes needed to solve the deep-sea environment with given grid size N . Orange dots marks trials which were unable to solve problem in 30000 episodes. Large problem instances (N > 20) are solved only when exploration bonus is used (right-most plot, κ = 50)

Figure 3: The biggest Montezuma's Revenge map, consisting of 24 room. The goal is to reach the room marked with G. The agent needs to avoid traps (marked in red) and pass through doors (marked in blue). Doors are open using keys (marked in yellow).

Figure 4: Example (10, 10) Sokoban board with 4 boxes. Boxes (yellow) are to be pushed by agent (green) to designed spots (red). The optimal solution in this level has 37 steps.

Figure 5: Learning curve (left axis) and the size of explored graph (right axis) of Sokoban states. The shape of the latter plot may show a gradual switch from exploration to exploitation.

← {d ∈ D : d.solved = select} 8: Sample d ∈ D with prob(d) ∝ len(d.episode) 9: Sample (s, v, m) uniformly from d 10: B ← B ∪ {(s, v, m)} 11: return B



Table content: <table><tr><td colspan="3">1: Initialize parameters of value function ensemble θ = (θ 1 , . . . , θ K ), V θ = (V θ1 , . . . , V θ K )</td></tr><tr><td colspan="2">2: Initialize replay_buffer</td><td/></tr><tr><td colspan="2">3: repeat</td><td/></tr><tr><td>4:</td><td>s ← env.reset()</td><td/></tr><tr><td>5:</td><td>episode, solved ← planner.run episode(s; model, V θ )</td><td>see Algorithm 2</td></tr><tr><td>6:</td><td>values ← evaluate episode(episode)</td><td>see Algorithm 8</td></tr><tr><td>7:</td><td>Optionally calculate a mask</td><td>see Appendix C</td></tr><tr><td>8:</td><td>replay buffer.add(episode, values, solved, mask)</td><td>see Algorithm 9</td></tr><tr><td>9:</td><td/><td/></tr></table>

Result for toy Montezuma's Revenge.

Table content: <table><tr><td>Setup</td><td colspan="2">win-ratio (no. seeds) av. visited rooms</td></tr><tr><td>no-ensemble</td><td>0 (43)</td><td>4.8</td></tr><tr><td>ensemble, no std</td><td>2 (40)</td><td>5.8</td></tr><tr><td>ensemble, std</td><td>35 (37)</td><td>17.1</td></tr></table>

Results of transfer experiments. We test transfers from one value function (Trans 1

Table content: <table><tr><td colspan="5">Architecture Random Trans. 1 Trans. 2 Trans. 3</td></tr><tr><td>5-layers</td><td>0.7%</td><td>4.9%</td><td>7.1%</td><td>8.5 %</td></tr><tr><td>4-layers</td><td>0.7%</td><td>4.3%</td><td>5.6%</td><td>7.3%</td></tr></table>

Table 3, below, summarizes the parameters of the training used in the Deep-see, Toy Montezuma's Revenge, Single-board Sokoban and Multiple-boards Sokoban experiments presented in Section 3.

Table content: <table/>

Peer review (iclr2020):
The paper proposes an approach blending model-based, model-free methods and utilizing risk-sensitivity information in ensembles as part of the value estimation and exploration process. The exploration is based on risk- sensitivity measures such as moments and relative majority vote. There is a lot of work currently trying to marry the model free with model based approaches for integrated planning and learning as the authors have mentioned in the related work section of the paper and also called out similar methods and techniques. The authors have provided evidence via experiments in three environments and shown good results of using this blended approach. Code is also provided for others to further carry out explorations in this research area.