algorithm reinforcement learning self-play with a general mastering chess...
TRANSCRIPT
Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm
Tony Allen and Gavin Glenn
Chess, Shogi, and GoChess
● Pieces have varying movement abilities, goal is to capture opponent’s king
Shogi ● Similar to chess, but larger board and action space
Go● Much larger board, but all pieces have same placement rules
Board positions: 1050 10120 10170 Wikipedia.com
Properties of Chess, Shogi, Go
2017 NIPS Keynote by DeepMind's David Silver
Rules Go Chess and Shogi
Translational Invariance Yes Partial (e.g. pawn moves, promotion)
Local Yes (based on adjacency) No (e.g. queen moves)
Symmetry Yes (dihedral) No (e.g. pawn moves, castling)
Action Space Simple Compound (move from/to)
Game Outcomes Binary (look at prob. of winning)
Win / lose / draw(look at expected value)
Go seems more amenable to CNNs
Computer Chess and Shogi: Prior Approaches
Computer chess is the most studied domain in AI● Highly specialized approaches have been successful● Deep Blue defeated World Champion G. Kasparov in 1997● Before AlphaGo, state-of-the-art was Stockfish
Shogi only recently achieved human world champion level● Previous state-of-the-art was Elmo
Engines like Stockfish and Elmo are based on alpha beta search● Domain specific evaluation functions tuned by grandmasters
AlphaZero, starting from first principles
AlphaZero assumes no domain specific knowledge other than rules of the game● Compare with Stockfish and Elmo’s evaluation functions ● Previous version AlphaGo started by training against human
games○ It also exploited natural symmetries in Go both to augment
data and regularize MCTS
Instead, AlphaZero relies solely on reinforcement learning● Discovers tactics on its own
Reinforcement Learning
Agent receives information about its environment and learns to choose actions that will maximize some reward1
Compare with supervised learning, but instead of learning from a label, we learn from a time delayed label called reward● Learn good actions by trial and error
1. Deep Learning with Python, F. Cholletrail.eecs.berkeley.edu
Reinforcement Learning
This framework is better suited to games like GOIn theory a network could learn to play using supervised learning, taking recorded human Go games as input● Large suitable datasets may not exist● More importantly, the network will only learn to perform like a
human expert, instead of learning true optimal strategy
RL can be done through self play● Using current weights, play out an entire match against self● Update weights according to results
AlphaZeroDeep Neural Network f𝜽 with parameters 𝜽
Input:● Raw board representation, s
Output:● Policy vector, p● Expected value of board position, v
Loss:Loss = (z - v)2 - 𝝅 Tlog(p) + c||𝜽||2
Where 𝝅, z come from tree search and self-play
AlphaZeroArchitecture?● Not stated explicitly (implied
to be same as AlphaGo Zero)
● 20 (or 40) residual blocks of convolutions
Input
256 conv. filters (3x3)
Batch norm
ReLu
256 conv. filters (3x3)
Batch Norm
ReLu
Ski
p C
onne
ctio
n
AlphaZero
Monte Carlo Tree SearchGoal: Reduce depth and breadth of search● Move distribution p helps reduce breadth● Value v helps reduce depth
Not exactly what happens
It’s best to see a picture!
2017 NIPS Keynote by DeepMind's David Silver
Monte Carlo Tree Search In a Picture
D Silver et al. Nature 550, 354–359 (2017) doi:10.1038/nature24270
TrainingAlgorithm PseudocodeInitialize f𝜽
Repeat: Play Game: While game not over: MCTS from state s Compute 𝝅
Pick new s from 𝝅 Update 𝜽:
For each (s, 𝝅, z) Back propagate
D Silver et al. Nature 550, 354–359 (2017) doi:10.1038/nature24270
Results
● Many game series versus previous state-of-the-art
● Convincingly beat Stockfish, Elmo
● Slight improvement over AG0
D Silver et al. Nature 550, 354–359 (2017) doi:10.1038/nature24270
https://deepmind.com/blog/alphazero-shedding-new-light-grand-games-chess-shogi-and-go/
Concluding Remarks
Public Criticism● Unfair advantages over competition● Hard to replicate
Future Work● Hybrid approach● AlphaStar (Starcraft 2 AI)
Thank You
Bonus SlidesD. Silver et al. Science 07 Dec 2018: Vol. 362, Issue 6419, pp. 1140-1144 DOI: 10.1126/science.aar6404