This is the AlphaGo Zero paper that gave out detail on how the reinforcement learning is done.

The predecessor AlphaGo Fan was a success on Oct 2015, so as AlphaGo Lee. It was implemented as two deep neural networks, a policy network (that give out move probabilities) and a value network (that outputs position evaluation). The policy network was trained initially by supervised learning to predict human expert moves, and then refined by policy gradient reinforcement learning. The value network was trained to predict the winner of the game, by playing with the policy network against itself. After the two neural networks are trained, they are combined with Monte Carlo tree search to provide a lookahead search.

AlphaGo zero skipped the supervised learning part. It was trained solely by self-play reinforcement learning, started from random play. The result will be a single neural network instead of separated policy and value network. And it uses only black and white stones on the board as input features. When it is used, it will only be simple tree search without Monte Carlo rollouts. The reinforcement learning is performed as follows:

Let be a deep neural network with parameters and it takes the raw board representation of the position as input. The neural network outputs move probabilities and a value , where:

  • : vector of move probabilities, which prob of selecting each move is
  • : scalar value, estimating the prob of current player winning from position

At each position , an MCTS is guided by the neural network to find probabilities of playing each move and value (game winner) . usually select much stronger moves than the raw move probabilities . The MCTS is a policy improvement operator and a policy evaluation. Then we update the parameters of the neural network to make more closely match

The MCTS always start from root state and select to move to maximize the upper confidence bound , where , until leaf node is reached. Here,

  • edge of the game tree is denoted by , with the board state and the action
  • = prior probability
  • = visit count
  • = action value

At , we then evaluate the prior probabilities and evaluate . We then update each edge traversed to increment its visit count and to update its action value

which the summation above is over all simulations that start from position taking move eventually reached .

The neural network is trained as follows:

The initial weights are random. In each subsequent iteration , games of self-play, where each move is identified by subscript , are generated. At time , MCTS outputs using neural network and moves by sampling the search probabilities . The game terminates only it exceeds a maximum length, or when both players pass. A player pass when the search value below a resignation threshold. Therefore, at each time step, we collected data , which is the game winner from the perspective of the current player at step . The a new is trained from sampled uniformly among all time steps of iteration .

The neural network is adjusted to minimize the error between the predicted value and the self-play winner , and to maximize the similarity between vectors of move probabilities and search probabilities . It is done using gradient on loss function

for some parameter of regularization to prevent overfitting. The above loss function is summing over mean-squared error and cross-entropy loss.

Training of AlphaGo Zero: 4.9M games of self-play generated, using 1600 simulations for each MCTS, which corresponds to 0.4s thinking time per move.

Bibliographic data

@article{
   title = "Mastering the game of Go without human knowledge",
   author = "David Silver and Julian Schrittwieser and Karen Simonyan and Ioannis Antonoglou and Aja Huang and Arthur Guez and Thomas Hubert and Lucas Baker and Matthew Lai and Adrian Bolton and Yutian Chen and Timothy Lillicrap and Fan Hui and Laurent Sifre and George van den Driessche and Thore Graepel and Demis Hassabis",
   journal = "Nature",
   volume = "550",
   pages = "354--359",
   month = "Oct",
   year = "2017",
   url = "http://dx.doi.org/10.1038/nature24270",
}