L EARNING TO S EARCH WITH MCTS NET
Anonymous authors
Paper under double-blind review
A BSTRACT
Planning problems are among the most important and well-studied problems in artiﬁcial intelligence.
They are most typically solved by tree search algorithms that simulate ahead into the future, evaluate future states, and back-up those evaluations to the root of a search tree.
Among these algorithms, Monte-Carlo tree search (MCTS) is one of the most general, powerful and widely used.
A typical implementation of MCTS uses cleverly designed rules, optimised to the particular characteristics of the domain.
These rules control where the simulation traverses, what to evaluate in the states that are reached, and how to back-up those evaluations.
In this paper we instead learn where, what and how to search.
Our architecture, which we call an MCTSnet , incorporates simulation-based search inside a neural network, by expanding, evaluating and backing-up a vector embedding.
The parameters of the network are trained end-to-end using gradient-based optimisation.
When applied to small searches in the well-known planning problem Sokoban, the learned search algorithm signiﬁcantly outperformed MCTS baselines.
I NTRODUCTION
Many success stories in artiﬁcial intelligence are based on the application of powerful tree search algorithms to challenging planning problems (Samuel, 1959; Knuth & Moore, 1975; Jünger et al., 2009).
It has been well documented that planning algorithms can be highly optimised by tailoring them to the domain (Schaeffer, 2000).
For example, the performance can often be dramatically improved by modifying the rules that select the trajectory to traverse, the states to expand, the evaluation function by which performance is measured, and the backup rule by which those evaluations are propagated up the search tree.
Our contribution is a new search algorithm in which all of these steps can be learned automatically and efﬁciently.
Our work ﬁts into a more general trend of learning differentiable versions of algorithms.
One particularly powerful and general method for planning is Monte-Carlo tree search (MCTS)
(Coulom, 2006; Kocsis & Szepesvári, 2006), as used in the recent AlphaGo program (Silver et al., 2016).
A typical MCTS algorithm consists of several phases.
First, it simulates trajectories into the future, starting from a root state.
Second, it evaluates the performance of leaf states - either using a random rollout, or using an evaluation function such as a ’value network’.
Third, it backs-up these evaluations to update internal values along the trajectory, for example by averaging over evaluations.
We present a neural network architecture that includes the same processing stages as a typical MCTS, but inside the neural network itself, as a dynamic computational graph.
The key idea is to represent the internal state of the search, at each node, by a memory vector.
The computation of the network proceeds forwards from the root state, just like a simulation of MCTS, using a simulation policy based on the memory vector to select the trajectory to traverse.
The leaf state is then processed by an embedding network to initialize the memory vector at the leaf.
The network proceeds backwards up the trajectory, updating the memory at each visited state according to a backup network that propagates from child to parent.
Finally, the root memory vector is used to compute an overall prediction of value or action.
The major beneﬁt of our planning architecture, compared to more traditional planning algorithms, is that it can be exposed to gradient-based optimisation.
This allows us to replace every component of
MCTS with a richer, learnable equivalent — while maintaining the desirable structural properties of MCTS such as the use of a model, iterative local computations, and structured memory.
We jointly train the parameters of the evaluation network, backup network and simulation policy so as to optimise the overall predictions of the MCTS network (MCTSnet).
The majority of the network is fully differentiable, allowing for efﬁcient training by gradient descent.
Still, internal action sequences directing the control ﬂow of the network cannot be differentiated, and learning this internal policy presents a challenging credit assignment problem.
To address this, we propose a novel, generallyapplicable approximate scheme for credit assignment that leverages the anytime property of our computational graph, allowing us to also effectively learn this part of the search network from data.
In the Sokoban domain, a classic planning task (Botea et al., 2003), we justify our network design choices and show that our learned search algorithm is able to outperform various model-free and model-based baselines.
R ELATED W ORK
There has been signiﬁcant previous work on learning evaluation functions, using supervised learning or reinforcement learning, that are subsequently combined with a search algorithm (Tesauro, 1994;
Baxter et al., 1998; Silver et al., 2016).
However, the learning process is typically decoupled from the search algorithm, and has no awareness of how the search algorithm will combine those evaluations into an overall decision.
Several previous search architectures have learned to tune the parameters of the evaluation function so as to achieve the most effective overall search results given a speciﬁed search algorithm.
The learning-to-search framework (Chang et al., 2015) learns an evaluation function that is effective in the context of beam search.
Samuel’s checkers player (Samuel, 1959), the TD(leaf) algorithm
(Baxter et al., 1998; Schaeffer et al., 2001), and the TreeStrap algorithm apply reinforcement learning to ﬁnd an evaluation function that combines with minimax search to produce an accurate root evaluation (Veness et al., 2009); while comparison training (Tesauro, 1988) applies supervised learning to the same problem; these methods have been successful in chess, checkers and shogi.
In all cases the evaluation function is scalar valued.
There have been a variety of previous efforts to frame the learning of internal search decisions as a meta-reasoning problem, one which can be optimized directly (Russell, 1995).
Kocsis et al.
(2005) apply black-box optimisation to learn the meta-parameters controlling an alpha-beta search, but do not learn ﬁne-grained control over the search decisions.
Considering action choices at tree nodes as a bandit problem led to the widely used UCT variant of MCTS (Kocsis & Szepesvári, 2006).
Hay &
Russell (2011) also studied the meta-problem in MCTS, but they only considered a myopic policy without function approximation.
Pascanu et al.
(2017) also investigate learning-to-plan using neural networks, but their approach is not differentiable, potentially limiting its scalability.
Other neural network architectures have also incorporated Monte-Carlo simulations.
The I2A architecture (Weber et al., 2017) aggregates the results of several simulations into its network computation.
MCTSnets both generalise and extend some ideas behind I2A: introducing a tree structured memory that stores node-speciﬁc statistics; and learning the simulation and tree expansion strategy, rather than rolling out each possible action from the root state with a ﬁxed policy.
Similar to I2A, the predictron architecture (Silver et al., 2017b) also aggregates over multiple simulations; however, in that case the simulations roll out an implicit transition model, rather than concrete steps from the actual environment.
MCTS NET
The MCTSnet architecture may be understood from two distinct but equivalent perspectives.
First, it may be understood as a search algorithm with a control ﬂow that closely mirrors the simulationbased tree traversals of MCTS.
Second, it may be understood as a neural network represented by a computation graph that processes input states, performs intermediate computations on hidden states, and outputs a ﬁnal decision.
We present each of these perspectives in turn, starting with the original, unmodiﬁed search algorithm.
3. MCTS A LGORITHM
The goal of planning is to ﬁnd the optimal strategy that maximises the total reward in an environment deﬁned by a deterministic transition model s (cid:48)
=
T ( s, a ) , mapping each state and action to a successor state s (cid:48) , and a reward model r ( s, a ) , describing the goodness of each transition.
MCTS is a simulation-based search algorithm that converges to a solution to the planning problem.
At a high level, the idea of MCTS is to maintain statistics at each node, such as the visit count and mean evaluation, and uses these statistics to decide which branches of the tree to visit.
MCTS proceeds by running a number of simulations.
Each simulation traverses the tree, selecting the most promising child according to the statistics, until a leaf node is reached.
The leaf node is then evaluated using a rollout or value-network (Silver et al., 2016).
This value is then propagated during a back-up phase that updates statistics of the tree along the traversed path, tracking the visit counts N ( s ) , N ( s, a ) and mean evaluation Q ( s, a ) following from each state s and action a .
Search proceeds in an anytime fashion: the statistics gradually become more accurate, and simulations focus on increasingly promising regions of the tree.
We now describe a value-network MCTS in more detail.
Each simulation from the root state s A is composed of four stages:
[Table]
When the search completes, it selects the action at the root with the most visit counts.
The simulation policy π is chosen to trade-off exploration and exploitation in the tree.
In the UCT variant of MCTS (Kocsis & Szepesvári, 2006), π is inspired by the UCB bandit algorithm (Auer, 2002).
3. MCTS NET : SEARCH ALGORITHM
We now present MCTSnet as a generalisation of MCTS in which the statistics being tracked by the search algorithm, the backup update, and the expansion policy, are all learned from data.
MCTSnet proceeds by executing simulations that start from the root state s A .
When a simulation reaches a leaf node, that node is expanded and evaluated to produce a value and/or other statistics.
The back-up phase then updates statistics in each node traversed during the simulation.
Speciﬁcally, the parent node statistics are updated to new values that depend on the child values and also on their previous values.
Finally, the selected action is chosen according to the statistics at the root of the search tree.
Different sub-networks are responsible for each of the components of the search described in the previous paragraph.
Internally, these sub-networks manipulate the memory statistics h at each node of the tree, which now have a vector representation, h ∈ R n .
An embedding network h ← (cid:15) ( s ; θ e ) evaluates the state s and computes initial ’raw’ statistics.
A simulation policy a ∼ π ( ·| h ; θ s ) is used to select actions during each simulation, based on statistics h .
A backup network h parent ← β ( h parent , h child ; θ b ) updates and propagates the statistics up the search tree.
Finally, an overall decision (or evaluation) is made by a readout network a ← ρ ( h s A ; θ r ) .
An algorithmic description of the search network follows in Algorithm 2:
Algorithm 2: MCTSnet
For m = 1 . . .
M , do simulation
3. MCTS NET : NEURAL NETWORK ARCHITECTURE
We now present MCTSnet as a neural network architecture.
The algorithm described above effectively deﬁnes a form of tree-structured memory: each node s k of the tree maintains its own corresponding statistics h k .
The statistics are initialized by the embedding network, but otherwise kept constant until the next time the node is visited.
They are then updated using the backup network.
For a ﬁxed tree expansion, this allows us to see MCTSnet as a deep residual network with numerous skip connections, as well as a large number of inputs - all corresponding to different potential future states of the environment (these inputs actually are images of the actual input s A through applications of the transition operator T).
We describe MCTSnet again following this different viewpoint in this section.
It is useful to introduce an index for the simulation count m , so that the tree memory after simulation m is the set of h ms for all tree nodes s .
Conditioned on a tree path p m +
= s 0 , a 0 , s 1 , a 1 , · · · , s L for simulation m
+ 1 , the MCTSnet memory gets updated as follows:
For t =
L :
[Equation]
For t <
L :
[Equation]
For all other s :
[Equation]
The tree path that gates this memory update is sampled as:
[Equation]
where L is a random stopping time for the tree path deﬁned by ( N m ( s L − 1 ) > 0 , N m ( s L ) = 0) .
An illustration of this update process is provided in Fig.
Note that the computation ﬂow of the
MCTS network is not deﬁned by the ﬁnal tree, but by the order in which nodes are visited (the tree expansion).
Furthermore, as deﬁned, MCTSnet is a feed-forward network with single input (the initial state) and single output (the action probabilities).
However, thanks to the tree-structured memory,
MCTSnet naturally allows for partial replanning, in a fashion similar to MCTS.
Assume that from root-state s A , the MCTS network chooses action a , and transitions (in the real environment) to new state s (cid:48)
A .
We can initialize the MCTS network for s (cid:48)
A as the subtree rooted in s (cid:48)
A , and initialize node statistics of the subtree to their previously computed values.
[Figure]
search
[Figure]
s A s A (cid:0) (cid:0) s
A (cid:0) (cid:0) (cid:30) (cid:30) s A (cid:0) (cid:0) (cid:30) (cid:30)
s B s B s C s B (cid:15) (cid:15)
s C
s D
y s A (cid:47) (cid:47) h A (cid:43) (cid:43) s A (cid:15) (cid:15)
h A (cid:43) (cid:43) s A (cid:15) (cid:15) h A (cid:43) (cid:43) s A (cid:15) (cid:15)
h A (cid:79) (cid:79)
[Figure]
(cid:47) (cid:47)
[Figure]
(cid:45) (cid:45) (cid:79) (cid:79) s
[Figure]
(cid:47) (cid:47) h C (cid:79) (cid:79) s
[Figure]
(cid:15) (cid:15)
h
[Figure]
(cid:79) (cid:79) s D (cid:47) (cid:47) h D (cid:79) (cid:79)
3. D ESIGN CHOICES
We now provide design details for each sub-network in MCTSnet.
Backup β
The backup network contains a gated residual connection, allowing it to selectively ignore information originating from a node’s subtree.
It updates h S as follows:
[Equation]
where φ = ( h s , h s (cid:48) , r, a ) and where g is a learned gating function with range [0 , 1] and f is the learned update function.
We justify this architecture in Sec.
4.2, by comparing it to a simpler MLP which maps φ to the updated value of h s .
Learned simulation policy π
In its basic, unstructured form, the simulation policy network is a simple MLP k mapping the statistics h s to the logits ψ ( s, a ) , which deﬁne π ( a | s ; θ s )
∝ exp( ψ ( s, a )) .
We consider adding structure by modulating each logit with side-information corresponding to each action.
One form of action-speciﬁc information is obtained from the child statistic h T ( s,a ) .
Another form of information comes from a learned policy prior µ over actions, with log-probabilities ψ ( s, a ; θ p ) = log µ ( s, a ; θ p ) ; as in PUCT (Rosin, 2011).
In our case, the policy prior comes from learning a small, model-free residual network on the same data.
Combined, we obtain the following modulated network version for the simulation policy logits:
[Equation] [Equation]
embedding (cid:15) and readout network
ρ The embedding network is a standard residual convolution network.
The readout network, ρ , is a simple MLP that transforms a memory vector at the root into the required output format, in this case an action distribution.
See appendix for details.
3. T RAINING MCTS NET
The readout network of MCTSnet ultimately outputs an overall decision or evaluation from the entire search.
This ﬁnal output may in principle be trained according to any loss function, such as by value-based or policy gradient reinforcement learning.
However, in order to focus on the novel aspects of our architecture, we choose to investigate the
MCTSnet architecture in a supervised learning setup in which labels are ﬁrst generated according to a standard, high-quality MCTS, and then an MCTSnet is trained to predict those labels, but using far fewer simulations.
Speciﬁcally, in our experiments, we ﬁrst use MCTS, using a value network but no policy prior (Silver et al., 2017a) to generate good quality trajectories.
For each real state s encountered in a trajectory, we record the action a ∗ the MCTS algorithm ended up taking, to create a dataset of state-action pairs ( s, a ∗ ) .
Our objective is to then train MCTSnet to predict the action a ∗ from state s .
We note that, if this process was iterated, it would be similar to prior policy iteration schemes (Silver et al., 2017a;
Anthony et al., 2017).
We denote z m the set of actions sampled stochastically during the m th simulation; z ≤ m the set of all stochastic actions taken up to simulation m , and z = z ≤ M the set of all stochastic actions.
The number of simulations M is either chosen to be ﬁxed, or taken from a stochastic distribution p M .
After performing the desired number of simulations, the network output is the action probability vector p θ ( a | s, z ) .
It is a random function of the state s due to the stochastic actions z .
We choose to optimize p θ ( a | s, z ) so that the prediction is on average correct, by minimizing the average cross entropy between the prediction and the correct label a ∗ .
For a pair ( s, a ∗ ) , the loss is:
[Equation]
This can also be interpreted as a lower-bound on the log-likelihood of the marginal distribution p θ ( [Equation] | [Equation]
( p [Equation] [Equation] |
[Equation] We minimize l ( s, a ∗ ) by computing a single sample estimate of its gradient (Schulman et al., 2015):
[Equation]
The ﬁrst term of the gradient corresponds to the differentiable path of the network as described in section.
The second term corresponds to the gradient with respect to the simulation distribution, and uses the REINFORCE or score-function method.
In this term, the ﬁnal log likelihood log p θ ( a ∗ | s, z ) plays the role of a ‘reward’ signal: in effect, the quality of the search is determined by the conﬁdence in the correct label (as measured by its log-likelihood); the higher that conﬁdence, the better the tree expansion, and the more the stochastic actions z that induced that tree expansion will be reinforced.
In addition, we follow the common method of adding a neg-entropy regularization term on π ( a | s ; θ s ) to the loss, to prevent premature convergence.
3. A CREDIT ASSIGNMENT TECHNIQUE FOR ANYTIME ALGORITHMS
Although it is unbiased, the REINFORCE gradient above has very high variance; this is due to the difﬁculty of credit assignment in this problem: the number of decisions that contribute to a single decision a ∗ is large (between O ( M log M ) and O ( M 2 ) for M simulations), and understanding how each decision contributed led to a low error through a better tree expansion structure is very intricate.
In order to address this issue, we design a novel credit assignment technique for anytime algorithms, by casting the loss minimization for a single example as a sequential decision problem, and using reinforcement learning technique to come up with a family of estimators, allowing us to manipulate the bias-variance trade-off.
Consider a general anytime algorithm which, given an initial state s , can run for an arbitrary number of internal steps M — in MCTSnet, these are simulations.
For each step m = 1 . . .
M , any number of stochastic decisions (collectively denoted z m ) may be taken, and at the end of each step, a candidate output distribution p θ ( a | s, z ≤ m ) may be evaluated against a loss function (cid:96) .
The value of the loss at the end of step m is denoted (cid:96) m ∆ = (cid:96) ( p θ ( a | s, z ≤ m )) .
We assume the objective is to maximize the terminal negative loss − (cid:96) M .
Letting (cid:96)
= 0 , we rewrite the terminal loss as a telescoping sum:
[Equation]
where we deﬁne the reward ¯ r m as the decrease in loss − ( (cid:96) m − (cid:96) m − 1 ) obtained during the m th step.
We then deﬁne the return R m =
(cid:80) m (cid:48) ≥ m ¯ r m (cid:48) as the sum of future rewards from step m ; by deﬁnition we have R 1 = − (cid:96) M .
The REINFORCE term of equation (8) can be rewritten:
[Equation]
Since stochastic variables in z m can only affect future rewards r (cid:48) m , m (cid:48) ≥ m , it follows from a classical policy gradient argument that (9) is, in expectation, also equal to:
[Equation]
In other words, the stochastic decisions from step m do not simply use the terminal loss as reinforcement signal, but rather the difference between the terminal loss, and the loss computed before step m started (the baseline).
This estimate is still unbiased, but has lower variance, especially for the later steps of algorithm.
Next, we trade off bias and variance by introducing a discount term γ .
In essence, for simulation choices z m , we choose to reward short term improvements more than later ones, since the relation between simulation m and later improvements is harder to ascertain and likely to mostly appear as noise.
Letting R γm = (cid:80) m (cid:48) ≥ m γ m
[Equation]
− m r m (cid:48) , our ﬁnal gradient estimate of the MCTSnet loss becomes:
[Equation]
R γm can be rewritten as the average of future baselined losses l m + t − l m − 1 , where t follows a truncated geometric distribution with parameter γ and maximum value M − m .
Letting γ = 0 leads to a greedy behavior, where actions of simulation m are only chosen as to maximize the immediate improvement in loss − ( (cid:96) m − (cid:96) m − 1 ) .
This myopic mode is linked to the single-step assumption proposed by Russell & Wefald (1989) in an analog context.
E XPERIMENTS
We investigate our architecture in the game of Sokoban, a classic, challenging puzzle game (Botea et al., 2003).
As described above, our results are obtained in a supervised training regime.
However, we continuously evaluate our network during training by running it as an agent in random
Sokoban levels and report its success ratio in solving the levels.
Throughout this experimental section, we keep the architecture and size of both embedding and readout network ﬁxed, as detailed in the appendix.
4. M AIN RESULTS
We ﬁrst compare our MCTSnet architecture with M = 25 simulations to a couple of model-free baselines.
To assess whether the MCTSnet leverages the information contained in the simulations (from transition model T and reward function r ), we consider a version of the network that uses a sham environment model where
T ( s, a )
=
s and r ( s, a ) = 0 , but otherwise has identical architecture.
For the case M = 2 , the baseline has the same number of parameters as MCTSnet, and uses each subnetwork exactly once.
We also test this architecture for the case M = 25 , in which case the model-free baseline has the same number of parameters and can perform the same amount of computation but does not have access to the environment model — it is effectively model-free.
We also evaluate a standard model-based method (without learning) in the same environment: MCTS with a pre-learned value function (see appendix for details).
When given access to 25 simulations per step, same as MCTSnet, we observe ≈ 30 % success ratio for MCTS in Sokoban.
It requires 20 more times simulations for this version of
MCTS to reach the level of performance of MCTSnet.
Overall, MCTSnet performs favorably against both model-based and model-free baselines, see Fig.
These comparisons validate two ingredients of our approach.
First, the comparison of MCTSnet to its model-free variant conﬁrms that it extracts information contained in states visited (and rewards obtained) during the search - in section 4.3 we show that it is also able to learn nontrivial search policies.
Second, at test time, MCTSnet and MCTS both use the same environment model, and therefore have in principle access to the same information.
The higher performance of MCTSnet demonstrates the beneﬁts of learning and propagating vector-valued statistics which are richer and more informative than those tracked by MCTS.
Using the architecture detailed in Sec.
3.4 and 25 simulations, MCTSnets reach 84 ± 1% of levels solved 3 — close to the 87% obtained in (Weber et al., 2017), although in a different setting (supervised vs reinforcement learning, 1 e 8 vs. 1 e 9 environment steps).
We now consider more detailed comparisons to justify and understand our different design choices for MCTSnet.
4. L EARNED STATISTICS AND HOW TO PERFORM BACKUPS
In this section, we justify the backup network choice made in Sec. 3.4, by comparing the simple MLP version to the gated residual architecture we suggested.
We ﬁnd the gated residual architecture for the backup network to be advantageous both in terms of stability and accuracy.
As Fig.
3 illustrates, with M = 10 simulations, the gated residual version systematically achieves better performance.
For larger number of simulations ( M > 25 ), we found the non-residual backup network to be simply numerically unstable.
[Figure]
Initially
This can be explained by a large number of updates being recurrently applied, which can cause divergence when the network has arbitrary form.
Instead, the gated network can quickly reduce the inﬂuence of the update coming from the subtree, and then slowly depart from the identity skipconnection; typical dynamics for the gate are displayed in Fig.
3-b, which showcases this behavior.
For all other experiments, we therefore employed the gated residual backup network in MCTSnet.
4. L EARNING THE SIMULATION POLICY
As previously mentioned, learning the simulation policy is challenging because of the noisy estimation of the pseudo-return for the selected sequence z .
We investigate the effectiveness of our proposed designs for π (see Sec. 3.4) and of our proposed approximate credit assignment scheme for learning its parameters (see Sec. 3.6)
Basic setting Despite the estimation issues, we veriﬁed that we can nevertheless lift π , in its simple form, above the performance of a MCTSnet using a uniform random simulation policy.
Note that
MCTSnet with a random simulation strategy already performs reasonably since it can still take advantage of the learned statistics, backups, and readout.
See blue and red curves in Fig.
4a for a comparison.
[Figure]
Improved credit assignment technique The vanilla gradient in Eq.
(8) is enough to learn a simulation policy π that performs better than a random search strategy, but it is still hampered by the noisy estimation process of the simulation policy gradient.
A more effective search strategy can be learned using our proposed credit assignment scheme in Sec.
3.6 and the modulated policy architecture in Sec. 3.4.
To show this, we train MCTSnets for different values of the discount γ using the modulated policy architecture.
The results in Fig.
4b demonstrate that the value of γ = 1 , for which the network is optimizing the true loss, is not the ideal choice in MCTSnet.
Lower values of γ perform better at different stages of training.
In late training, when the estimation problem is more stationary, the advantage of γ < 1 reduces but remains.
The best performing MCTSnet architecture is shown in comparison to others in Fig. 4a.
We also investigated whether simply providing the policy prior term in Eq.
6 (i.e., setting w 1 = 0 ) could match these results.
With the policy prior learned with the right entropy regularization, this is indeed a well-performing simulation policy for MCTSnet with 25 simulations, but it did not match our best performing learned policy.
4. S CALABILITY WITH NUMBER OF SIMULATIONS
Thanks to weight sharing, MCTSnets can in principle be run for an arbitrary number of simulations M ≥ 1 .
With larger number of simulations, the search has progressively more opportunities to query the environment model.
To check whether our search network could take advantage of this during training, we compare
MCTSnet for different number of simulations
M , applied during both training and evaluation.
In Fig.
5, we ﬁnd that our approach was able to query and extract relevant information with additional simulations, generally achieving better results with less training steps.
D ISCUSSION
We have shown that it is possible to learn successful search algorithms by framing them as a dynamic computational graph that can be optimized with gradient-based methods.
This may be viewed as a ﬁrst step towards a long-standing AI ambition: meta-reasoning about the internal processing of the agent.
In particular, we proposed a neural version of the MCTS algorithm.
The aim was to maintain the desirable properties of MCTS while allowing some ﬂexibility to improve on the choice of nodes to expand, the statistics to store in memory, and the way in which they are propagated, all using gradient-based learning.
A more pronounced departure from existing search algorithms could also be considered, although this may come at the expense of a harder optimization problem.
We have also assumed that the true environment is available as a simulator, but this could also be relaxed: a model of the environment could be learned separately (Weber et al., 2017), or even end-to-end (Silver et al., 2017b).
One advantage of this approach is that the search algorithm could learn how to make use of an imperfect model.
Although we have focused on a supervised learning setup, our approach could easily be extended to a reinforcement learning setup by leveraging policy iteration with MCTS (Silver et al., 2017a; Anthony et al., 2017).
We have focused on small searches, more similar in scale to the plans that are processed by the human brain (Arbib, 2003), than to the massive-scale searches in high-performance games or planning applications.
In fact, our learned search performed better than a standard MCTS with more than an order-of-magnitude more computation, suggesting that neural approaches to search may ultimately replace their handcrafted counterparts.
B A RCHITECTURAL CHOICES AND EXPERIMENTAL SETUP
For the Sokoban domain, we use 10 × 10 map layout with four boxes and targets.
For level generation, we gained access to the level generator described by Weber et al.
We directly provide a symbolic representation of the environment, coded as 10 × 10 × 4 feature map (with one feature map per type of object: wall, agent, box, target), see Fig.
7 for a visual representation.
The training dataset consists of 250000 trajectories of distinct levels; approximately 92% of those levels are solved by the agent; solved levels take on average 60 steps, while unsolved levels are interrupted after 100 steps.
We also create a testing set with 2500 trajectories.
Agent
Wall
Target
Box
For MCTS (UCT variant), we use a pre-trained value network for leaf evaluation, depth-wise transposition tables to deal with symmetries, and we reuse the relevant search subtree after each real step.
B. N ETWORK ARCHITECTURE DETAILS
Our embedding network (cid:15) is a convolution network with 3 residual blocks.
Each residual block is composed of two 64-channel convolution layers with 3x3 kernels applied with stride 1.
The residual blocks are preceded by a convolution layer with the same properties, and followed by a convolution layer of 1x1 kernel to 32 channels.
A linear layer maps the ﬁnal convolutional activations into a 1D vector of size 128.
The readout network is a simple MLP with a single hidden layer of size 128.
Non-linearities between all layers are ReLus.
The policy prior network has a similar architecture to the embedding network, but with 2 residual blocks and 32-channel convolutions.
B. T RAINING
We train MCTSnet using TensorFlow in an asynchronous distributed fashion.
We use a batch of size 1, 32 workers and SGD for optimization with a learning rate of 5e-4.