Skip to content
DARC
■ Change #48 · wiki.edited

Monte Carlo tree search and AlphaZero: Normalize Markdown to canonical form

by DARC wiki2026-10-22 20:31:02 UTCOpen the page →
body
## Monte Carlo tree search
− MCTS builds a game tree incrementally. Each iteration (a *simulation*) selects a path from the root using statistics stored in the tree, expands a leaf, evaluates it, and backs the result up the path. Kocsis and Szepesvári (2006) introduced UCT, which treats each node's choice as a bandit problem and picks children by an upper confidence bound, and Coulom (2006) introduced the term Monte Carlo tree search. Before neural networks, MCTS with random rollouts was the strongest approach to Go, though still below top professionals.
+ MCTS builds a game tree incrementally. Each iteration (a _simulation_) selects a path from the root using statistics stored in the tree, expands a leaf, evaluates it, and backs the result up the path. Kocsis and Szepesvári (2006) introduced UCT, which treats each node's choice as a bandit problem and picks children by an upper confidence bound, and Coulom (2006) introduced the term Monte Carlo tree search. Before neural networks, MCTS with random rollouts was the strongest approach to Go, though still below top professionals.
## AlphaGo, AlphaGo Zero and AlphaZero
− AlphaGo (Silver et al., Nature 2016) combined MCTS with a policy network trained on human games and a value network, and beat a professional player. AlphaGo Zero (Nature 2017) removed human data: a single network outputs move probabilities $p$ and a value $v$, MCTS using them produces improved move distributions, and the network is trained to match the search's visit-count distribution and the game outcome. Search therefore acts as a *policy improvement operator* and the network distils its result, repeated in a self-play loop. AlphaZero (Silver et al., 2017; Science 2018) applied the same algorithm unchanged to chess and shogi.
+ AlphaGo (Silver et al., Nature 2016) combined MCTS with a policy network trained on human games and a value network, and beat a professional player. AlphaGo Zero (Nature 2017) removed human data: a single network outputs move probabilities $p$ and a value $v$, MCTS using them produces improved move distributions, and the network is trained to match the search's visit-count distribution and the game outcome. Search therefore acts as a _policy improvement operator_ and the network distils its result, repeated in a self-play loop. AlphaZero (Silver et al., 2017; Science 2018) applied the same algorithm unchanged to chess and shogi.
Selection uses a PUCT rule, roughly
− $$a^*=\arg\max_a\left[Q(s,a)+c\,P(s,a)\frac{\sqrt{\sum_b N(s,b)}}{1+N(s,a)}\right],$$
+ $a^*=\arg\max_a\left[Q(s,a)+c\,P(s,a)\frac{\sqrt{\sum_b N(s,b)}}{1+N(s,a)}\right],$
where $Q$ is the mean backed-up value, $P$ the network prior and $N$ visit counts.
## Efficiency work
AlphaZero used thousands of TPUs. KataGo (Wu, 2019) reports a 50-fold computation reduction over comparable methods and surpassing the final ELF OpenGo model after 19 days on fewer than 30 GPUs, using non-domain-specific changes such as auxiliary targets and playout-cap randomisation. Gumbel AlphaZero/MuZero (Danihelka, Guez, Schrittwieser and Silver, ICLR 2022) replaces the root selection with sampling without replacement via the Gumbel-top-$k$ trick, which gives a policy-improvement guarantee even with few simulations; it is implemented in DeepMind's mctx library.
## Limits
Search needs a simulator (or a learned model; see model-based RL) and a clear terminal reward. Branching factor and stochasticity raise cost. Using the same machinery for open-ended language reasoning is an active but unsettled area.
## Practice
Reference code: DeepMind's JAX library mctx for batched search, OpenSpiel for game environments, and KataGo, the strongest open Go engine.
explainer.student
**What it is for.** In board games an agent can think ahead: imagine its moves, the opponent's replies, and so on. Go has about 250 legal moves in a typical position, so the full tree of possible games is far too large to search. Monte Carlo tree search (MCTS) searches only the promising parts, and AlphaZero adds a neural network that tells the search where to look.
**MCTS.** The search grows a tree from the current position. Each simulation (1) walks down the tree choosing moves by stored statistics, (2) adds a new position at the bottom, (3) evaluates it, and (4) sends the result back up, updating the average value $Q$ and the visit count $N$ of every move on the path. After many simulations the most-visited move is played. Early versions evaluated a position by playing random moves to the end of the game, a Monte Carlo estimate (an average over random trials).
**Choosing where to look.** Selection must balance exploiting moves that look good with exploring moves tried rarely. AlphaZero's PUCT rule picks
− $$a^*=\arg\max_a\Big[Q(s,a)+c\,P(s,a)\frac{\sqrt{\sum_b N(s,b)}}{1+N(s,a)}\Big].$$
+ $a^*=\arg\max_a\Big[Q(s,a)+c\,P(s,a)\frac{\sqrt{\sum_b N(s,b)}}{1+N(s,a)}\Big].$
The first term is the move's average result so far. The second is a bonus that is large when the network's prior $P$ favours the move and the move has few visits $N$, and that shrinks as visits accumulate; $c$ sets the balance. It is the upper-confidence-bound idea from slot-machine (bandit) problems.
**The self-play loop.** One network takes a position and outputs move probabilities $p$ and a value $v$, its estimate of who will win. The program plays itself; at each move MCTS guided by the network produces a sharper move distribution than the network alone. The network is then trained by gradient descent to predict the search's move distribution and the final result. Search acts as a teacher, the network learns to imitate it, and the improved network makes the next search stronger. AlphaGo Zero (2017) learned Go this way with no human games, and AlphaZero applied the same algorithm to chess and shogi.
**Cost and efficiency.** AlphaZero used thousands of TPUs. KataGo (Wu, 2019) reported a 50-fold reduction in computation, surpassing ELF OpenGo's final model after 19 days on about 27 V100 GPUs, mainly through general changes such as extra prediction targets. Gumbel AlphaZero (ICLR 2022) changes how moves are chosen at the root so that search still improves the policy with very few simulations; it is implemented in DeepMind's mctx library.
**Limits.** The method needs a simulator with known rules (or a learned model, see world models) and a clear win-or-loss signal.
hash 576d30e3ed3d7465016c1ad2ff0a5eefbe7a290344bf801946f7453dddb7c593
previous 759a5f0d7e4a9d1099e36940c92c9666d7f9ca492a1c46709355e3fb7e808b20