Monte-Carlo tree search, and especially a version based on the UCT formula [Kocsis and Szepesvári2006] appears in numerous search applications, such as [Gelly and Wang2006, Eyerich, Keller, and Helmert2010]. Although these methods are shown to be successful empirically, most authors appear to be using the UCT formula “because it has been shown to be successful in the past”, and “because it does a good job of trading off exploration and exploitation”. While the latter statement may be correct for the multi-armed bandit and for the UCB method [Auer, Cesa-Bianchi, and Fischer2002], we argue that it is inappropriate for search. The problem is not that UCT does not work; rather, a simple reconsideration from basic principles can result in schemes that outperform UCT.
The core issue is that in adversarial search and search in “games against nature” — optimizing behavior under uncertainty, the goal is typically to either find a good (or optimal) strategy, or even just to find the best first action of such a policy. Once such an action is discovered, it is usually not beneficial to further sample that action, “exploitation” is thus meaningless for search problems. Finding a good first action is closer to the pure exploration variant, as seen in the selection problem [Bubeck, Munos, and Stoltz2011, Tolpin and Shimony2012]. In the selection problem, it is much better to minimize the simple regret. However, the simple and the cumulative regret cannot be minimized simultaneously; moreover, [Bubeck, Munos, and Stoltz2011] shows that in many cases the smaller the cumulative regret, the greater the simple regret.
We begin with background definitions and related work. Some sampling schemes are introduced, and shown to have better bounds for the simple regret on sets than UCB, the first contribution of this paper. The results are applied to sampling in trees by combining the proposed sampling schemes on the first step of a rollout with UCT for the rest of the rollout. An additional sampling scheme based on metareasoning principles is also suggested, another contribution of this paper. Finally, the performance of the proposed sampling schemes is evaluated on sets of Bernoulli arms, in randomly generated 2-level trees, and on the sailing domain, showing where the proposed schemes have improved performance.
Background and Related Work
Monte-Carlo tree search was initially suggested as a scheme for finding approximately optimal policies for Markov Decision Processes (MDP). An MDP is defined by the set of states , the set of actions (also called moves in this paper), the transition distribution , the reward function , the initial state and an optional goal state : [Russell and Norvig2003]. Several MCTS schemes explore an MDP by performing rollouts—trajectories from the current state to a state in which a termination condition is satisfied (either the goal state, or a cutoff state for which the reward is evaluated approximately).
Multi-armed bandits and UCT
In the Multi-armed Bandit problem [Vermorel and Mohri2005] we have a set of arms (see Figure 1.a). Each arm can be pulled multiple times. Sometimes a cost is associated with each pulling action. When the th arm is pulled, a random reward from an unknown stationary distribution is encountered. The reward is usually bounded between 0 and 1. In the cumulative setting (the focus of much of the research literature on Multi-armed bandits), all encountered rewards are collected by the agent. The UCB scheme was shown to be near-optimal in this respect [Auer, Cesa-Bianchi, and Fischer2002]:
Scheme pulls arm that maximizes upper confidence bound on the reward:
where is the average sample reward obtained from arm , is the number of times arm was pulled, and is the total number of pulls so far.
The UCT algorithm, an extension of UCB to Monte-Carlo Tree Search is described in [Kocsis and Szepesvári2006], and shown to outperform many state of the art search algorithms in both MDP and adversarial games [Eyerich, Keller, and Helmert2010, Gelly and Wang2006].
In the simple regret (selection) setting, the agent gets to collect only the reward of the last pull.
The simple regret of a sampling policy for the Multi-armed Bandit Problem is the expected difference between the best true expected reward and the true expected reward of the arm with the greatest sample mean, :
Strategies that minimize the simple regret are called pure exploration strategies [Bubeck, Munos, and Stoltz2011]. An upper bound on the simple regret of uniform sampling is exponentially decreasing in the number of samples (see [Bubeck, Munos, and Stoltz2011], Proposition 1). For UCB() the best known respective upper bound on the simple regret of UCB() is only polynomially decreasing in the number of samples (see [Bubeck, Munos, and Stoltz2011], Theorems 2,3). However, empirically UCB() appears to yield a lower simple regret than uniform sampling.
A completely different scheme for control of sampling can use the principles of bounded rationality [Horvitz1987] and metareasoning — [Russell and Wefald1991] provided a formal description of rational metareasoning and case studies of applications in several problem domains. In search, under myopic and sub-tree independence assumptions, one maintains a current best move at the root, and finds the expected gain from finding another move to be better than the current best [Russell and Wefald1991]. The “cost” of search actions can also be factored in. Ideally, an “optimal” sampling scheme, to be used for selecting what to sample, both at the root node [Hay and Russell2011] and elsewhere, can be developed using metareasoning. However, this task is daunting for the following reasons:
The method is in general intractable, necessitating simplifying assumptions. However, using the standard metareasoning myopic assumption, where samples would be selected as though at most one sample can be taken before an action is chosen, we run into serious problems. Even the basic selection problem [Tolpin and Shimony2012] exhibits a non-concave utility function and results in premature stopping of the standard myopic algorithms. This is due to the fact that the value of information of a single measurement (analogous to a sample in MCTS) is frequently less than its time-cost, even though this is not true for multiple measurements.
When applying the selection problem to MCTS, the situation is exacerbated. The utility of an action is usually bounded, and thus in many cases a single sample may be insufficient to change the current best action, regardless of its outcome. As a result, we frequently get a zero “myopic” value of information for a single sample.
Rational metareasoning requires a known distribution model, which may be difficult to obtain.
Defining the time-cost of a sample is not trivial.
As the above ultimate goal is extremely difficult to achieve, we introduce in this paper simple schemes more amenable to analysis, loosely based on the metareasoning concept of value of information, and compare them to UCB (on sets) and UCT (in trees).
Sampling Based on Simple Regret
Analysis of Sampling on Sets
We examine two sampling schemes with super-polynomially decreasing upper bounds on the simple regret. The bounds suggest that these schemes achieve a lower simple regret than uniform sampling; indeed, this is confirmed by experiments.
We first consider -greedy sampling as a straightforward generalization of uniform sampling:
The -greedy sampling scheme
pulls the arm that currently has the greatst sample mean, with probability
sampling scheme pulls the arm that currently has the greatst sample mean, with probability, and any other arm with probability .
This sampling scheme exhibits an exponentially decreasing simple regret:
For every and there exists such that for any number of samples the simple regret of the -greedy sampling scheme is bounded from above as
with probability at least .
Bound the probability that a non-optimal arm is selected. Split the interval at . Apply the Chernoff-Hoeffding bound to get:
Observe that, in probability, as , therefore , as . Conclude that for every , there exists such that for every and all non-optimal arms :
In particular, as the number of arms grows, the bound for -greedy sampling () becomes considerably tighter than for uniform random sampling ():
For uniform random sampling,
For -greedy sampling,
-greedy is based solely on sampling the arm that has the greatest sample mean (henceforth called the “current best” arm) with a higher probability then the rest of the arms, and ignores information about sample means of other arms. On the other hand, UCB distributes samples in accordance with sample means, but, in order to minimize cumulative regret, chooses the current best arm too often. Intuitively, a better scheme for simple regret minimization would distribute samples in a way similar to UCB, but would sample the current best arm less often. This can be achieved by replacing in Equation 1 with a faster growing sublinear function, for example, .
Scheme pulls arm that maximizes , where:
where, as before, is the average reward obtained from arm , is the number of times arm was pulled, and is the total number of pulls so far.
This scheme also exhibits a super-polynomially decreasing simple regret:
For every and there exists such that for any number of samples the simple regret of the UCB() sampling scheme is bounded from above as
with probability at least .
Sampling in Trees
As mentioned above, UCT [Kocsis and Szepesvári2006] is an extension of UCB for MCTS, that applies UCB() at each step of a rollout. At the root node, the sampling in MCTS is usually aimed at finding the first move to perform. Search is re-started, either from scratch or using some previously collected information, after observing the actual outcome (in MDPs) or the opponent’s move (in adversarial games). Once one move is shown to be the best choice with high confidence, the value of information of additional samples of the best move (or, in fact, of any other samples) is low. Therefore, one should be able to do better than UCT by optimizing simple regret, rather than cumulative regret, at the root node.
Nodes deeper in the search tree are a different matter. In order to support an optimal move choice at the root, it is beneficial in many cases to find a more precise estimate of thevalue of the state in these search tree nodes. For these internal nodes, optimizing simple regret is not the answer, and cumulative regret optimization is not so far off the mark. Lacking a complete metareasoning for sampling, which would indicate the optimal way to sample both root nodes and internal nodes, our suggested improvement to UCT thus combines different sampling schemes on the first step and during the rest of each rollout:
The SR+CR MCTS sampling scheme selects an action at the current root node according to a scheme suitable for minimizing the simple regret (SR), such as -greedy or UCB, and (at non-root nodes) then selects actions according to UCB, which approximately minimizes the cumulative regret (CR).
The pseudocode of this two-stage rollout for an undiscounted MDP is in Algorithm 1: FirstAction selects the first step of a rollout (line 5), and NextAction (line 6) selects steps during the rest of the rollout (usually using UCB). The reward statistic for the selected action is updated (line 10), and the sample reward is back-propagated (line 11) towards the current root.
We denote such two-step realizations of SR+CR as Alg+UCT, where Alg is the sampling scheme employed at the first step of a rollout (e.g. -greedy+UCT).
We expect such two-stage sampling schemes to outperform UCT and be significantly less sensitive to the tuning of the exploration factor of UCB(). That is since the contradiction between the need for a larger value of on the first step (simple regret) and a smaller value for the rest of the rollout (cumulative regret) [Bubeck, Munos, and Stoltz2011] is resolved. In fact, a sampling scheme that uses UCB() at all steps but a larger value of for the first step than for the rest of the steps, should also outperform UCT.
Further improvement can be achieved by computing or estimating the value of information (VOI) of the rollouts and choosing rollouts that maximize the VOI. However, as indicated above, actually computing the VOI is infeasible. Instead we suggest the following scheme based on the following features of value of information:
An estimate of the probability that one or more rollouts will make another action appear better than the current best .
An estimate of the gain that may be incurred if such a change occurs.
If the distribution of results generated by the rollouts were known, the above features could be easily computed. However, this is not the case for most MCTS applications. Therefore, we estimate bounds on the feature values from the current set of samples, based on the myopic assumption that the algorithm will only sample one of the actions, and use these bounds as the feature values, to get:
with being the (approximate) value for sampling the current best action, and is the (approximate) value for sampling some other action .
These equations were derived as follows. The gain from switching from the current best action to another action can be bounded: by the current expectation of the value the current second-best action for the case where we sample only , and by 1 (the maximum reward) minus the current expectation of when sampling any other action. The probability that another action be found best can be bounded by an exponential function of the difference in expectations when the true value of the actions becomes known. But the effect of each individual sample on the sample mean is inversely proportional to the current number of samples, hence the current number of samples (plus one in order to handle the initial case of no previous samples) in the denominator.
These VOI estimates are used in the “VOI-aware” sampling scheme as follows: sample the action that has maximum estimated VOI. We judged these estimates to be too crude to be used as “stopping criteria” that can be used to cut off sampling, leaving this issue for future research. Although this scheme appears too complicated to be amenable to a formal analysis, early experiments (Section Empirical Evaluation) with this approach demonstrate a significantly lower simple regret.
The results were empirically verified on Multi-armed Bandit instances, on search trees, and on the sailing domain, as defined in [Kocsis and Szepesvári2006]. In most cases, the experiments showed a lower average simple regret for -greedy an UCB than for UCB on sets, and for the SR+CR scheme than for UCT in trees.
Simple regret in multi-armed bandits
.a shows the search tree corresponding to a problem instance. Each arm returns a random reward drawn from a Bernoulli distribution. The search selects an arm and compares the expected reward, unknown to the algorithm during the sampling, to the expected reward of the best arm.
Figure 1.b shows the regret vs. the number of samples, averaged over experiments for randomly generated instances of 32 arms. Either -greedy or UCB dominate UCB over the whole range. For larger number of samples, the advantage of UCB over -greedy becomes more significant.
Monte Carlo tree search
The second set of experiments was performed on randomly generated 2-level max-max trees crafted so as to deliberately deceive uniform sampling (Figure 2.a), necessitating an adaptive sampling scheme, such as UCT. That is due to the switch nodes, each with 2 children with anti-symmetric values, which would cause a uniform sampling scheme to incorrectly give them all a value of 0.5.
Simple regret vs. the number of samples are shown for trees with root degree 16 (Figure 2.b) and 64 (Figure 2.c). The exploration factor is set to , the default value for rewards in the range . The algorithms exhibit a similar relative performance: either -greedy+UCT or UCB+UCT result in the lowest regret, UCB+UCT dominates UCT everywhere except when the number of samples is small. The advantage of both -greedy+UCT and UCB+UCT grows with the number of arms.
The sailing domain
Figures 3–5 show results of experiments on the sailing domain. Figure 3 shows the regret vs. the number of samples, computed for a range of values of . Figure 3.a shows the median cost, and Figure 3.b — the minimum costs. UCT is always worse than either -greedy+UCT or UCB+UCT, and is sensitive to the value of : the median cost is much higher than the minimum cost for UCT. For both -greedy+UCT and UCB+UCT, the difference is significantly less prominent.
Figure 4 shows the regret vs. the exploration factor for different numbers of samples. UCB+UCT is always better than UCT, and -greedy+UCT is better than UCT expect for a small range of values of the exploration factor.
Figure 5 shows the cost vs. the exploration factor for lakes of different sizes. The relative difference between the sampling schemes becomes more prominent when the lake size increases.
Finally, the VOI-aware sampling scheme was empirically compared to other sampling schemes (UCT, -greedy+UCT, UCT+UCT). Again, the experiments were performed on randomly generated trees with structure shown in Figure 2.a. Figure 6 shows the results for 32 arms. VOI+UCT, the scheme based on a VOI estimate, outperforms all other sampling schemes in this example. Similar performance improvements (not shown) also occur for the sailing domain.
Conclusion and Future Work
UCT-based Monte-Carlo tree search has been shown to be very effective for finding good actions in both MDPs and adversarial games. Further improvement of the sampling scheme is thus of interest in numerous search applications. We argue that although UCT is already very efficient, one can do better if the sampling scheme is considered from a metareasoning perspective of value of information (VOI).
The MCTS SR+CR scheme presented in the paper differs from UCT mainly in the first step of the rollout, when we attempt to minimize the ‘simple’ selection regret rather than the cumulative regret. Both the theoretical analysis and the empirical evaluation provide evidence for better general performance of the proposed scheme.
Although SR+CR is inspired by the notion of VOI, the VOI is used there implicitly in the analysis of the algorithm, rather than computed or learned explicitly in order to plan the rollouts. Ideally, using VOI to control sampling ab-initio should do even better, but the theory for doing that is still not up to speed. Instead we suggest a “VOI-aware” sampling scheme based on crude probability and value estimates, which despite its simplicity already shows a marked improvement in minimizing regret. However, application of the theory of rational metareasoning to Monte Carlo Tree Search is an open problem [Hay and Russell2011], and both a solid theoretical model and empirically efficient VOI estimates need to be developed.
Finding a better sampling scheme for non-root nodes, as well as the root node, should also be possible. Although cumulative regret does reasonably well there, it is far from optimal, as meta-reasoning principles imply that an optimal scheme for these nodes must be asymmetrical (e.g. it is not helpful to find out that the value of the current best action is even better than previously believed).
Finally, applying VOI methods in complex deployed applications that already use MCTS is a challenge that should be addressed in future work. In particular, UCT is extremely successful in Computer Go [Gelly and Wang2006, Braudiš and Loup Gailly2011, Enzenberger and Müller2009], and the proposed scheme should be evaluated on this domain. This is non-trivial, since Go programs typically use “non-pure” versions of UCT, extended with domain-specific knowledge. For example, Pachi [Braudiš and Loup Gailly2011] typically re-uses information from rollouts generated for earlier moves, thereby violating our underlying assumption that information is only used for selecting the current move. In early experiments not shown here (disallowing re-use of samples, admittedly not really a fair comparison) the VOI-aware scheme apears to dominate UCT. Nevertheless, it should also be possible to adapt the VOI-aware schemes to take into account expected re-use of samples, another topic for future research.
The research is partially supported by Israel Science Foundation grant 305/09, by the Lynne and William Frankel Center for Computer Sciences, and by the Paul Ivanier Center for Robotics Research and Production Management.
- [Auer, Cesa-Bianchi, and Fischer2002] Auer, P.; Cesa-Bianchi, N.; and Fischer, P. 2002. Finite-time analysis of the multiarmed bandit problem. Mach. Learn. 47:235–256.
- [Braudiš and Loup Gailly2011] Braudiš, P., and Loup Gailly, J. 2011. Pachi: State of the art open source Go program. In ACG 13.
- [Bubeck, Munos, and Stoltz2011] Bubeck, S.; Munos, R.; and Stoltz, G. 2011. Pure exploration in finitely-armed and continuous-armed bandits. Theor. Comput. Sci. 412(19):1832–1852.
- [Enzenberger and Müller2009] Enzenberger, M., and Müller, M. 2009. Fuego - An Open-source Framework for Board Games and Go Engine Based on Monte-Carlo Tree Search. Technical report, University of Alberta, Dept. of Computing Science, TR09-08.
- [Eyerich, Keller, and Helmert2010] Eyerich, P.; Keller, T.; and Helmert, M. 2010. High-quality policies for the Canadian traveler’s problem. In In Proc. AAAI 2010, 51–58.
- [Gelly and Wang2006] Gelly, S., and Wang, Y. 2006. Exploration exploitation in Go: UCT for Monte-Carlo Go. Computer.
- [Hay and Russell2011] Hay, N., and Russell, S. J. 2011. Metareasoning for Monte Carlo Tree Search. Technical Report UCB/EECS-2011-119, EECS Department, University of California, Berkeley.
Horvitz, E. J.
Reasoning about beliefs and actions under computational resource
Proceedings of the 1987 Workshop on Uncertainty in Artificial Intelligence, 429–444.
- [Kocsis and Szepesvári2006] Kocsis, L., and Szepesvári, C. 2006. Bandit based Monte-Carlo planning. In ECML, 282–293.
- [Russell and Norvig2003] Russell, S. J., and Norvig, P. 2003. Artificial Intelligence: A Modern Approach. Pearson Education.
- [Russell and Wefald1991] Russell, S., and Wefald, E. 1991. Do the right thing: studies in limited rationality. Cambridge, MA, USA: MIT Press.
- [Tolpin and Shimony2012] Tolpin, D., and Shimony, S. E. 2012. Semimyopic measurement selection for optimization under uncertainty. IEEE Transactions on Systems, Man, and Cybernetics, Part B 42(2):565–579.
- [Vermorel and Mohri2005] Vermorel, J., and Mohri, M. 2005. Multi-armed bandit algorithms and empirical evaluation. In ECML, 437–448.