AlphaZero: World Chess Champion in 4 Hours!
In 1996, the supercomputer DeepBlue defeated the reigning world chess champion, Garry Kasparov. Since then, computer chess has evolved rapidly, with chess engines reaching a level where they effortlessly beat the best human players today.
For comparison: the strongest chess engine, Stockfish, has a rating around 3400 elo points, while the highest human rating ever achieved in chess is 2872 elo points by the current world champion, Magnus Carlsen (as of February 2013). But what happens when Google enters the world of chess?
Google and DeepMind on the Chess Scene
In December 2017, Google and its division DeepMind made an indelible mark on the chess world by creating the AlphaZero algorithm based on artificial intelligence. In just 4 hours (!!!), it not only achieved superhuman chess prowess but even defeated the currently best chess engine, Stockfish, in a 100-game match with a score of 28 wins, 0 losses, and 72 draws.
For curiosity, scientists estimate that becoming a master in any activity requires 10,000 hours of training. Computers, of course, can achieve this much faster, but how to impart 15 centuries of chess knowledge to a machine within 4 hours (a beautiful legend also circulates about the origin of chess)?
Self-learning Algorithm
You may have heard of the AlphaGo program, which defeated the world champion in the Japanese game of Go. Go resisted computer pressure for much longer than chess, where computers have long been dominant. The new program, AlphaGoZero, even outperformed AlphaGo, learning to play go based solely on games it played against itself!
DeepMind co-founder Demis Hassabis, once a prodigious chess child, and his team were tempted to apply the same algorithm to chess. While chess engines have dominated humans for a long time, there was still a comforting feeling that chess engines were created by humans.
This changed on December 5, 2017, when the scientific paper "Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm" was released. The title could be translated as Achieving mastery in chess and shogi [Japanese chess] through self-play and a reinforcement learning algorithm.
The abstract of the paper loosely states:
Chess is one of the most studied games in the field of artificial intelligence. The strength of the strongest chess programs is achieved through a combination of sophisticated search techniques, computational power, and evaluation functions fine-tuned by chess experts and programmers for decades. In contrast, the AlphaGoZero program recently achieved superhuman performance in the game of Go using a learning algorithm based on games it played against itself. In this work, we have generalized this approach to the general AlphaZero algorithm, which, tabula rasa [literally, a scraped wax writing tablet from ancient Rome, metaphorically "an unwritten sheet of paper"], can achieve superhuman results in a wide range of activities. The only thing given to the program is the rules. The program starts playing randomly and learns from the results achieved. Within 24 hours, it reaches superhuman strength in chess, shogi, and go, convincingly defeating world champions in all these games.
You can download the entire paper here: https://cdn.chess24.com/GzFl-Z4-SVWO-mC9rL6XhQ/original/mastering-chess-and-shogi-by-self-play.pdf.
Neural Network and Monte Carlo Method
It is absolutely remarkable (as stated in the abstract of the paper) that the program only knows the rules from the beginning! The rest is taken care of by artificial intelligence based on a neural network using the Monte Carlo method, which is based on statistical methods and probability. The algorithm learns from previous decisions (moves) and the results they brought, constantly refining its approach.
The strongest "conventional" chess engine Stockfish – which, by the way, is open source and you can download it for free here https://stockfishchess.org/ (but you will need a chess application like Fritz or similar products from Chessbase) – can calculate many more variations, but AlphaZero is highly selective – it can choose a better move with less computational power.
Otherworldly Chess: AlphaZero vs. Stockfish Match
You can replay ten exemplary games from the AlphaZero vs. Stockfish match on a server like chessgames.com. For example, Game 9 (click the link to replay it directly) really looks like someone from space came to show people how to play chess. The move 16. Kxd2 and the maneuver 17. Ke3 are noteworthy – the program is not afraid to leave the king in the center, where it is usually vulnerable, and the far-reaching positional sacrifice of the piece 30. B×g6 and subsequent 32. f5, after which Stockfish considers the position to be absolutely even.
Game 10 is also great, where AlphaZero once again positionally sacrifices a piece.
For chess enthusiasts, it is also interesting that the program learned openings that humans honed for centuries and how the program's preferences in choosing openings evolved over time. For example, the program gradually moved away from the French Defense and Caro-Kann with the black pieces (probably because white has spatial advantage, which AlphaZero likes) and with the white pieces, it started favoring the Queen's Gambit (1. d4) or the English Opening (1. c4). The legendary world chess champion Bobby Fischer considered the best move to be 1. e4 with the king's pawn, which, according to him, was "best by test".
Another fantastic insight, although subject to revision over time, is that the "advantage of white pieces" has been confirmed. AlphaZero played with the white pieces absolutely uncompromisingly, achieving 25 wins and 25 draws (success rate of 75%), while with the black pieces, it only managed 3 wins and 47 draws. It seems that the opportunity to start the game has a really significant impact (especially for a stronger player). Perhaps more than previously thought and in contrast to the opinion that for every move by white, "black must have an equalizing reply" – on the other hand, this theory is supported by the fact that AlphaZero played with the black pieces practically impenetrably.
You Might Be Also Interested
- Chess for Money;
- Charming Legend on the Origin of Chess;
- Artificial Intelligence (AI) Explained;
- ChatGPT: Unleashing Conversational AI Power;
- Shell Game aka Thimblerig;
- Friday the 13th.
Based on the original Czech article: AlphaZero.