MCTS in Depth: UCT, PUCT & What Search Optimizes
From UCT’s guarantees to the PUCT rule and MCTS as regularized policy optimization.
UCT has a convergence theorem, yet on some trees it needs a tower of exponentials worth of simulations; AlphaZero's PUCT rule has no regret theorem at all, yet its visit counts turn out to solve a regularized policy-optimization problem. This lesson pins down what search provably optimizes: UCT's guarantees and their limits, why the root should care about simple rather than cumulative regret, what PUCT's visit counts compute, and how Gumbel sampling guarantees policy improvement with only a handful of simulations.
What you’ll learn
- State UCT's consistency theorem with its conditions, and explain the drift problem, Coquelin and Munos's worst case and the later critique of the original analysis.
- Distinguish cumulative from simple regret, and explain why the root of a search is judged by the latter.
- Derive PUCT's exploration rate, and prove that its action selection makes the visit distribution track the solution of a KL-regularized policy optimization within .
- Prove the policy-improvement guarantee of Gumbel-based selection, and explain why AlphaZero's rule can fail to improve with few simulations.
What UCT guarantees, and what it does not
The proof climbs the tree from the leaves. At the deepest internal nodes the payoffs are i.i.d. and UCB1's analysis applies (The Regret of UCB, Proved). Higher up, a child's payoffs drift, because the search below it keeps improving; Kocsis and Szepesvári extended UCB1 to payoff sequences whose means converge and whose deviations obey suitable tail bounds, and applied it level by level. Three caveats matter in practice.
- The rate can be astronomical. Coquelin and Munos (2007) built trees of depth on which UCT needs at least simulations, a tower of exponentials, before it even reaches the optimal leaf: optimism applied to drifting averages can stay misled for a very long time.
- The logarithmic bonus is fragile. Shah, Xie and Xu (2020) argued that the original analysis needs the regret of the drifting bandits to concentrate exponentially fast, which is unlikely to hold. They proved non-asymptotic guarantees for a variant whose bonus grows polynomially rather than logarithmically in the visit count, and showed that this MCTS combined with nearest-neighbor regression needs samples for -accurate values in dimensions, close to a lower bound.
- The root plays a different game. Every node below the root needs accurate backed-up values, which is a cumulative-regret goal. The root only needs to recommend a good move at the end.
A bandit run for rounds is scored by cumulative regret if every pull costs, , and by simple regret if only a final recommendation counts. A search is the second case: simulations cost computation, not reward.
The two goals conflict. Bubeck, Munos and Stoltz (2009) proved a lower bound on a forecaster's simple regret in terms of its cumulative regret: the smaller the latter, the larger the former. Plain uniform allocation shows how cheap simple regret can be: with pulls per arm of rewards in , Hoeffding's inequality for the difference of two empirical means gives
Exponentially small in on any fixed instance, while UCB1 deliberately starves bad arms. Root rules that explore more than UCB, such as PUCT's rate below or the Sequential Halving used by Gumbel search, fit the root's objective.
PUCT: how much it explores
AlphaGo Zero's PUCT rule selects with . MuZero lets the coefficient grow slowly with the visits, with and , and normalizes to by the smallest and largest values seen in the tree, so that one constant works across games with very different reward scales.
The name points to Rosin's PUCB (2011), a bandit algorithm in which a predictor supplies a prior over arms and which comes with regret bounds. AlphaGo's rule borrows the idea of prior-weighted exploration but not the analysis; Grill et al. (2020) describe it as loosely inspired by bandits and adapted to accommodate the prior. What does it do instead?
Suppose the averages have settled: the best move has value , a rival has and prior , and is the parent's visit count. The best move receives almost all visits, so its bonus vanishes and its score tends to . The rival is selected whenever its score exceeds that:
So the rival's count rises until it meets this threshold and then tracks it:
PUCT keeps exploring rivals at rate , far more than UCB1's . That suits the root, but inside the tree it costs accuracy: a node's average is pulled below the best child's value by about , a bias of order , where UCT's is .
After simulations with , a rival move has prior and a settled gap in normalized value. About how many visits does PUCT give it?
Show the answer
17
. Quadrupling the budget to 3,200 simulations only doubles it, to about 34: PUCT keeps spending on rivals in proportion to their prior and to . MuZero's is barely above at this budget, since .
What the visit counts compute
The link is a one-line identity. Since , PUCT's score is exactly , and the gradient of the regularized objective at has coordinates . PUCT therefore picks the action with the largest gradient coordinate at the current visit distribution. Stationarity of is the statement that all these coordinates are equal there, for every .
(1) Since , the chain rule gives the gradient coordinate minus a weighted average that is the same for every , so the arg max over is PUCT's choice:
(2) Both and sum to 1, so some has , and for it . Every with has . The maximizer of is therefore never over-visited.
(3) Write for after visits, so , and claim , true at . An action not chosen at step keeps its count, so its share shrinks by the factor and the claim survives. The chosen action had by (2), so
For the other side, both distributions sum to 1, so a deficit at is a surplus elsewhere, at most at each of the other actions.
So AlphaZero's policy head, trained toward the visit counts, is trained toward a KL-regularized improvement of itself, whose regularization fades like : close to the prior after few simulations, close to greedy after many. The regularizer is , the reverse of the of MPO-style updates, whose solution is normalized (Control as Inference). UCT's counts, with a prior added, track a problem regularized instead by the Hellinger-type divergence , with a weight that also shrinks like .
The view suggests using itself, which can be computed exactly by a one-dimensional search for : to act (ACT), to choose actions inside the search (SEARCH) and as the training target (LEARN), together ALL. The counts are coarse when simulations are few, and Grill et al. found the gains largest at small simulation budgets, for example on the Cheetah Run control task.
Improvement with few simulations: Gumbel search
With fewer simulations than legal moves, PUCT visits only some actions, and the visit distribution can put no weight at all on the best one. Danihelka, Guez, Schrittwieser and Silver (2022) point out that AlphaZero can then fail to improve its policy network, and that its root Dirichlet noise does not ensure improvement. An obvious repair also fails: with , prior and a budget of , evaluating the two moves with the highest prior and playing the better one scores 0, while simply sampling from scores .
Let over all actions. It is the first action of the Gumbel-Top- sample, so it is among the candidates, and by the Gumbel-Max trick it is distributed as .
maximizes over the candidates, which include , while maximizes over everything:
Adding the two gives , hence for every draw of . Taking expectations, . Reusing the same is essential: fresh noise in the final step would count the prior twice.
Think first Back to , , . If is steep enough that a value difference of 1 always dominates, what is under Gumbel selection?
The third action is chosen exactly when it is among the two sampled without replacement: it is drawn first with probability , or second after the first action () or after the second (). So , more than double the prior's , where the top-two-by-prior heuristic scored .
Gumbel MuZero combines this with Sequential Halving at the root, which splits the simulation budget into phases over sampled actions and discards the worse half after each phase, a simple-regret strategy. Its policy target is , where visited actions use their search values, unvisited ones are assigned the value estimate , and with and (0.1 on Atari, with min–max normalized values). The authors report that it matched the state of the art in Go, chess and Atari and that, strikingly, it learned reliably on 9×9 Go even with 2 simulations per move.
Key takeaways
- UCT is consistent, with root bias (Kocsis & Szepesvári, 2006), but convergence can take a tower of exponentials (Coquelin & Munos, 2007), and the logarithmic bonus's analysis has been questioned in favor of polynomial bonuses (Shah, Xie & Xu, 2020).
- The root is judged by simple regret; low cumulative regret forces high simple regret, and uniform allocation already makes simple regret exponentially small.
- PUCT gives a rival with gap and prior about visits; its choice is the largest gradient coordinate of , so the visit distribution tracks the regularized solution within .
- With few simulations PUCT's counts can fail to improve on the prior; Gumbel-Top- sampling plus selection by provably improves, , for any budget.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Why is low cumulative regret the wrong goal for the action-selection rule at the root of a search?
- Because rewards at the root are not bounded
- Because the root has too many actions for any bandit algorithm
- Because simulations cost computation, not reward: only the final recommendation counts, and minimizing cumulative regret starves the rival moves that must be checked
- Because UCB1 is not consistent at the root
Show the answer
C. Because simulations cost computation, not reward: only the final recommendation counts, and minimizing cumulative regret starves the rival moves that must be checked
The quality of the root's recommendation is simple regret. Bubeck, Munos and Stoltz showed that small cumulative regret forces large simple regret, while uniform allocation already makes simple regret exponentially small on a fixed instance. Rules that explore more at the root, like PUCT or Sequential Halving, fit the goal better.
Grill et al. showed that the action PUCT selects next always satisfies . What does this mean?
- PUCT always picks the action with the highest value
- PUCT adds the next visit to an action whose share of visits is at or below its share in the regularized solution, so the visit distribution is steered toward
- The visit distribution equals exactly after every simulation
- PUCT never visits actions with a small prior
Show the answer
B. PUCT adds the next visit to an action whose share of visits is at or below its share in the regularized solution, so the visit distribution is steered toward
Over-visited actions have gradient coordinates below the common value at , so they are never the arg max. Each visit therefore goes to an under-visited action, and if stood still the gap would close at rate .
The Gumbel policy-improvement guarantee relies on which assumption?
- The sampled actions' values are exact, and the same Gumbel noise is used for sampling the candidates and for the final selection
- The number of simulations exceeds the number of actions
- The prior is uniform
- The transformation is linear
Show the answer
A. The sampled actions' values are exact, and the same Gumbel noise is used for sampling the candidates and for the final selection
The proof compares the selected action with , the prior's own Gumbel-Max sample, draw by draw; that needs exact values for the candidates and the shared . It holds for any budget , any prior and any strictly increasing .
Further reading
- L. Kocsis & C. Szepesvári, "Bandit based Monte-Carlo planning," ECML (2006).
- P.-A. Coquelin & R. Munos, "Bandit algorithms for tree search," UAI (2007).
- S. Bubeck, R. Munos & G. Stoltz, "Pure exploration in multi-armed bandits problems," ALT (2009).
- J.-B. Grill, F. Altché, Y. Tang, T. Hubert, M. Valko, I. Antonoglou & R. Munos, "Monte-Carlo tree search as regularized policy optimization," ICML (2020).
- I. Danihelka, A. Guez, J. Schrittwieser & D. Silver, "Policy improvement by planning with Gumbel," ICLR (2022).