Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

Batched MCTS with virtual loss

Also known as Virtual loss, Batched leaf evaluation

adversarial game-tree-search

Batched MCTS values new leaves several at a time, as a neural network on a GPU wants to, instead of one per simulation. A simulation stops at its new leaf and waits; until the batch is valued, selection counts every waiting simulation as a loss for the side that chose it (virtual loss), so the next simulations of the batch spread over other moves instead of piling onto the same leaf. Then one evaluator call values the batch, the values are backed up, the virtual losses are removed, and the priors it returns are set on the leaves' moves. A finished game is valued at once, and on a new tree the root goes to the evaluator first, for the priors of its moves. Use it when leaf evaluation is expensive and cheaper per leaf in batches; with a batch of one it is plain MCTS.

Pseudocode

algorithm Batched-MCTS(p₀, b, budget)input: root position p₀, batch size b, budget of simulationsoutput: as MCTS: the most visited root move, with each root move's statisticsif the tree is new thenset the root's move priors from evaluate-batch(⟨p₀⟩)   ▷ not a simulationwhile not exhausted(budget) doW ← ⟨⟩                                     ▷ leaves waiting for their valuewhile |W| < b and not exhausted(budget) dopath ← select from the root, as in MCTS  ▷ waiting simulations count as lossesif the game ends at the leaf of path thenback up reward(leaf) along pathelseadd a virtual loss along pathappend(W, path)V, P ← evaluate-batch(leaves of W)         ▷ one call for the whole batchfor each path in W, with its value v and priors π doremove the virtual loss along pathback up v along pathset π as the priors of the leaf's movesreturn the most visited root move, and every root move's visits and mean

In the crates

Lineage

Comes from

builds on Monte Carlo tree search

Led to

Tree-parallel MCTS combines it

Papers

  1. Parallel Monte-Carlo Tree Search Guillaume M. J.-B. Chaslot, Mark H. M. Winands, H. Jaap van den Herik · 2008· Computers and Games (CG 2008), Lecture Notes in Computer Science introduces doi 10.1007/978-3-540-87608-3_6
  2. Mastering the game of Go without human knowledge David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, Yutian Chen, Timothy Lillicrap, Fan Hui, Laurent Sifre, George van den Driessche, Thore Graepel, Demis Hassabis · 2017· Nature applies doi 10.1038/nature24270