What is AlphaZero?

Introduction

Project introduction

What is AlphaZero?

A game-playing program has to decide which move to make. It can look ahead by trying a move, imagining the reply, imagining its own answer, and so on. Looking at every possible future works for tiny games, but chess and Go have far too many positions, so a program must decide which futures are worth looking at.

AlphaZero (DeepMind, 2017 to 2018) does this with two parts that teach each other. A neural network looks at a position and outputs a policy, a probability for each move, and a value, a guess of who will win. A tree search uses those two outputs to decide which lines to explore, and its results are better than the network alone.

How they improve each other

The program plays games against itself, running a search before every move. After each game, the network is trained to predict two things, the moves the search preferred and the final result. A better network makes the next searches better, which makes better training data. Nothing but the rules is given to it, with no human games and no hand-written strategy.

You will build every part for tic-tac-toe, a game small enough to solve exactly on a slow CPU. That gives a perfect player to measure against, so every claim about strength is a number you can check.

Search, guided by a network

simulation 1 of 25

X to move. Each number is how many simulations explored that cell.

1. select2. expand3. evaluate4. back up

The first simulation only expands the root.

Rulesmoves and winner
Searchtree of simulations
Networkpolicy and value
Self-playlearn from search

What you will build

01

Search

Minimax, then Monte Carlo tree search with UCB, then PUCT guided by a prior.

02

Policy-value network

A small PyTorch network that scores moves and positions, trained on what the search found.

03

Self-play

Visit counts become policy targets, game results become value targets, and the player improves.

Start with the rules

Return the legal moves and the winner of a k-in-a-row position.

Continue to Problem 1