Skip to content
— CH. 1 · INTRODUCTION —

Monte Carlo tree search

7 min listen · Ch. 1 of 6
6 sections
  • Monte Carlo tree search is the algorithm that, in October 2015, powered the first computer program to beat a professional human Go player without handicaps on a full-sized board. That program was AlphaGo, built by Google DeepMind, and its victory was not just a milestone for the game of Go. It was a milestone for machine learning itself. But AlphaGo did not emerge from nowhere. The technique underneath it had been quietly developing for decades, tracing its roots to randomized methods from the 1940s. How does a search algorithm built on random game simulations outthink some of the strongest minds in the world? That question opens onto a deeper one: what makes a decision genuinely hard, and how do you write software that handles it?

  • The Monte Carlo method dates back to the 1940s, when researchers first used random sampling to tackle deterministic problems that resisted conventional solution. The name is a reference to the famous casino in Monaco, evoking the role of chance in computation. Decades passed before anyone thought to apply this idea systematically to board games. In his 1987 PhD thesis, Bruce Abramson combined minimax search with what he called an expected-outcome model, replacing the usual static evaluation functions with random game playouts run all the way to the end. Abramson described his model as precise, accurate, easily estimable, efficiently calculable, and domain-independent. He tested it on tic-tac-toe, then on machine-generated evaluation functions for Othello and chess. Two years later, in 1989, W. Ertel, J. Schumann, and C. Suttner applied related methods to automated theorem proving, cutting through the exponential search times that had frustrated uninformed algorithms like breadth-first and depth-first search. Then in 1992, B. Brugmann used the approach for the first time in a Go-playing program, planting the technique in the game that would later become its most celebrated arena.

  • In 2002, Chang and colleagues proposed what they called Adaptive Multi-stage Sampling, or AMS, for Markov decision processes. AMS was the first algorithm to explore the idea of balancing exploration and exploitation when building simulated trees, and it became the direct seed for what would follow. Four years later, in 2006, three separate developments arrived almost simultaneously. Remi Coulom formally described applying the Monte Carlo method to game-tree search and coined the name Monte Carlo tree search. Levente Kocsis and Csaba Szepesvar developed the UCT algorithm, which stands for Upper Confidence bounds applied to Trees. And S. Gelly and colleagues implemented UCT in a Go-playing program called MoGo. UCT is built on a formula originally derived by Auer, Cesa-Bianchi, and Fischer, and it resolves a central tension in any search: exploit moves that have already proven strong, but keep exploring moves that have been tried only rarely. By 2008, MoGo had reached dan, or master level, in 9x9 Go. The Fuego program was winning against strong amateur players in the same format. The Zen program, in January 2012, won 3:1 against an amateur 2-dan player on the full 19x19 board.

  • Each cycle of Monte Carlo tree search follows four steps, repeating as long as time allows. Selection begins at the root of the game tree, which represents the current position, and descends by choosing child nodes until it reaches a leaf, meaning a position from which no simulation has yet been run. Expansion then creates one or more child nodes from that leaf, representing legal moves from that position. Simulation runs a complete random playout from the chosen child, playing moves at random until the game ends in a win, loss, or draw. Backpropagation carries the result back up the tree, updating every node along the path. Each node tracks the ratio of wins to total playouts for the player it represents. If white loses a simulation, every node along the selection path increments its simulation count, but only the black nodes are credited with wins. Draws split the credit, adding 0.5 to the win tally for both sides. After all available time is used, the algorithm selects whichever move has accumulated the most simulations, not necessarily the highest win rate, as its final answer.

  • One of MCTS's most practical advantages over older algorithms like alpha-beta pruning is that it requires no explicit evaluation function. A program only needs to know the rules of the game: the legal moves from any position and the conditions that end it. This makes MCTS useful for games without a well-developed theory, and for general game-playing systems. The game tree it builds is asymmetric, concentrating growth on the most promising branches and achieving strong results in games with a high branching factor, where classical algorithms bog down. The weakness is the flip side of this selectivity. Moves that look superficially strong can lead to a subtle loss many steps later, and MCTS may never explore that line deeply enough to catch it. These positions are sometimes called trap states. It is believed that this vulnerability played a role in AlphaGo's loss in its fourth game against Lee Sedol during the March 2016 five-game match, a match AlphaGo ultimately won 4-1 and after which it was awarded an honorary 9-dan ranking in 19x19 Go.

  • Researchers have layered many refinements onto the basic algorithm. Playouts can be light, using purely random moves, or heavy, guided by heuristics drawn from previous playouts or expert knowledge. In Go programs, for instance, certain patterns of stones on the board influence the probability of moving into a particular area. One counterintuitive finding is that playing suboptimally during simulations sometimes makes the overall program stronger. A technique called RAVE, for Rapid Action Value Estimation, accelerates learning in games where the same position can be reached through different move orderings, such as placement games where a stone put down early has the same value regardless of what happened before it. D. Silver proposed one formula for RAVE that defines the balance between RAVE-derived and standard win statistics. MCTS also runs well in parallel: playouts can be distributed across multiple threads or processes, either by running many playouts simultaneously from a single leaf, building separate game trees in parallel and combining their root-level conclusions, or sharing a single tree with careful synchronization. This scalability made MCTS a natural fit when DeepMind combined it with deep neural networks to build AlphaGo, and when its successor AlphaZero replaced the simulation step entirely with a neural-network evaluation, extending the approach to Chess and Shogi.

Common questions

What is Monte Carlo tree search and how does it work?

Monte Carlo tree search (MCTS) is a heuristic search algorithm that evaluates game positions by running large numbers of random simulations, called playouts, to the end of the game. Each cycle consists of four steps: selection, expansion, simulation, and backpropagation. The algorithm repeats these cycles until time runs out, then selects the move with the most simulations as its answer.

When was Monte Carlo tree search invented?

The name and formal description were established in 2006, when Remi Coulom coined the term and Kocsis and Szepesvar developed the UCT algorithm. The underlying Monte Carlo method dates to the 1940s, and B. Brugmann first applied it to a Go-playing program in 1992.

What game did AlphaGo use Monte Carlo tree search to master?

AlphaGo used Monte Carlo tree search combined with deep neural networks to master the board game Go. In October 2015 it became the first computer program to beat a professional human Go player without handicaps on a full 19x19 board. In March 2016, it defeated Lee Sedol 4-1 and was awarded an honorary 9-dan ranking.

What is the UCT algorithm in Monte Carlo tree search?

UCT, or Upper Confidence bounds applied to Trees, is a formula introduced by Levente Kocsis and Csaba Szepesvar in 2006 for balancing exploitation of strong moves with exploration of rarely-tried moves. It traces back to the UCB1 formula by Auer, Cesa-Bianchi, and Fischer, and to the AMS algorithm by Chang and colleagues from 2002.

What are the disadvantages of Monte Carlo tree search?

MCTS can fail to detect "trap states": moves that appear strong but lead to a loss through a subtle sequence of play. Because the algorithm concentrates on promising branches and prunes less-explored lines, it can overlook specific but critical sequences. It is believed this contributed to AlphaGo's loss in its fourth game against Lee Sedol.

What games use Monte Carlo tree search beyond Go?

MCTS has been applied to Chess, Shogi, Checkers, Backgammon, Contract Bridge, Scrabble, Clobber, Hex, Havannah, Game of the Amazons, Arimaa, and nondeterministic games such as poker, Magic: The Gathering, and Settlers of Catan. It has also been used in real-time video games including Ms. Pac-Man and Fable Legends, and in the campaign AI for Total War: Rome II.

All sources

52 references cited across the entry

  1. 1JournalMastering the game of Go with deep neural networks and tree searchDavid Silver et al. — 28 January 2016
  2. 2Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning AlgorithmDavid Silver — 2017
  3. 6JournalThe monte carlo methodMetropolis Nicholas et al. — 1949
  4. 7BookThe Expected-Outcome Model of Two-Player GamesBruce Abramson — Technical report, Department of Computer Science, Columbia University — 1987
  5. 8Book5. Österreichische Artificial-Intelligence-Tagung. Informatik-Fachberichte 208, pp. 87-95.Wolfgang Ertel et al. — Springer — 1989
  6. 9BookCADE90, 10th Int. Conf. on Automated Deduction.pp. 470-484. LNAI 449.Christian Suttner et al. — Springer — 1990
  7. 12BookJapanese-French Frontiers of Science SymposiumRémi Coulom — 2008
  8. 13BookComputers and Games, 5th International Conference, CG 2006, Turin, Italy, May 29–31, 2006. Revised PapersRémi Coulom — Springer — 2007
  9. 15BookFuego – An Open-Source Framework for Board Games and Go Engine Based on Monte Carlo Tree SearchMarkus Enzenberger et al. — Technical report, University of Alberta — 2008
  10. 21JournalMoHex Wins Hex TournamentBroderick Arneson et al. — June 2009
  11. 22BookPlaying and Solving HavannahTimo Ewalds — Master's thesis, University of Alberta — 2011
  12. 23BookComputers and Games, 6th International Conference, CG 2008, Beijing, China, September 29 – October 1, 2008. ProceedingsRichard J. Lorentz — Springer — 2008
  13. 24BookMethods of MCTS and the game ArimaaTomáš Kozelek — Master's thesis, Charles University in Prague — 2009
  14. 25JournalReal-Time Search Method in Nondeterministic Game – Ms. Pac-ManXiaocong Gan et al. — December 2011
  15. 26JournalReal-Time Monte Carlo Tree Search in Ms Pac-ManTom Pepels et al. — September 2014
  16. 28BookIJCAI 2009, Proceedings of the 21st International Joint Conference on Artificial Intelligence, Pasadena, California, USA, July 11–17, 2009Michael Buro et al. — 2009
  17. 29JournalComputer poker: A reviewJonathan Rubin et al. — April 2011
  18. 30BookCIG'09 Proceedings of the 5th international conference on Computational Intelligence and GamesC.D. Ward et al. — IEEE Press — 2009
  19. 31BookAdvances in Computer Games, 12th International Conference, ACG 2009, Pamplona, Spain, May 11–13, 2009. Revised PapersIstván Szita et al. — Springer — 2010
  20. 32BookMonte Carlo GoBernd Brügmann — Technical report, Department of Physics, Syracuse University — 1993
  21. 33JournalProgressive Strategies for Monte-Carlo Tree SearchG.M.J.B. Chaslot et al. — 2008
  22. 34Introduction to Monte Carlo Tree SearchJeff Bradberry — 2015-09-07
  23. 35Random-Turn Hex and other selection gamesYuval Peres et al. — 2006
  24. 36Bandit based Monte-Carlo PlanningLevente Kocsis et al. — Springer — 2006
  25. 37JournalFinite-time Analysis of the Multiarmed Bandit ProblemPeter Auer et al. — 2002
  26. 40JournalA Survey of Monte Carlo Tree Search MethodsCameron B. Browne et al. — 2012
  27. 41BookAdvances in Computer GamesIngo Althöfer — 2012
  28. 42JournalOn adversarial search spaces and sampling-based planningRaghuram Ramanujan et al. — May 2010
  29. 43JournalTrade-Offs in Sampling-Based Adversarial PlanningRaghuram Ramanujan et al. — March 2011
  30. 45JournalThe Last-Good-Reply Policy for Monte-Carlo GoPeter Drake — December 2009
  31. 46BookModification of UCT with Patterns in Monte-Carlo GoSylvain Gelly et al. — Technical report, INRIA — November 2006
  32. 47BookProceedings of the 2010 International Conference on Artificial Intelligence, ICAI 2010, July 12–15, 2010, Las Vegas Nevada, USASeth Pellegrino et al. — CSREA Press — 2010
  33. 48BookMachine Learning, Proceedings of the Twenty-Fourth International Conference (ICML 2007), Corvallis, Oregon, USA, June 20–24, 2007Sylvain Gelly et al. — ACM — 2007
  34. 49BookReinforcement Learning and Simulation-Based Search in Computer GoDavid Silver — PhD thesis, University of Alberta — 2009
  35. 50BookACG 2011: Advances in Computer Games 13 Conference, Tilburg, the Netherlands, November 20–22Rémi Coulom
  36. 51BookComputers and Games, 6th International Conference, CG 2008, Beijing, China, September 29 – October 1, 2008. ProceedingsGuillaume M.J-B. Chaslot, Mark H.M. Winands, Jaap van den Herik — Springer — 2008