Chess Piece

Last Thursday we were discussing AlphaZero, a program which was taught the moves of chess and, after four hours, relying on its self-learning algorithm, it managed to reach a superhuman level of chess ability and even defeated one of the top chess programs, Stockfish 8, in a 100-game match with a score of 64-36 (28 wins, 72 draws).

Stockfish is a specialized chess program and took many years to develop — it used brute-force technology (look at all the possibilities) with alpha-beta pruning (this considerably speeds up its task — I explained alpha-beta last Thursday) which enabled it to skip several sub-trees to concentrate on what it considers the main lines.

AlphaZero is a generic program (for example it can also play go and shogi and indeed any board game – just teach it the moves) which was just taught the moves of chess – it did not have the benefit of million-game databases to study and observe patterns.

On the Chessbase Web site Albert Silver wrote:

“It played a match against the latest and greatest version of Stockfish, an engine whose pedigree needs no introduction to readers, on a computer that was running nearly 900 times faster! Indeed, AlphaZero was calculating roughly 80 thousand positions per second, while Stockfish, running on a PC with 64 threads (likely a 32-core machine) was running at 70 million positions per second. In spite of this insane deficit, AlphaZero crushed Stockfish 64-36 with no losses at a time control of one minute per move. To better understand how big a deficit that is, if another version of Stockfish were to run 900 times slower, this would be equivalent to roughly 8 moves less deep. How is this possible?”

Last Thursday I showed you one game from the AlphaZero vs Stockfish match. Here is another.

AlphaZero — Stockfish 8 [C11]
AlphaZero vs. Stockfish (1.9), 04.12.2017

1.d4 e6 2.e4 d5

From the statistics presented by the AlphaZero team we can draw some conclusions on opening play:

AlphaZero won 25 games with White and three games with Black. This seems to indicate that White really does have an advantage.

AlphaZero tried out the French Defense with Black a few times in the early stage of the 100–game match and then refused to play it again. The French is a bad defense?

What do you think?

3.Nc3 Nf6 4.e5 Nfd7 5.f4 c5 6.Nf3 cxd4 7.Nb5

[7.Nxd4 Nc6 8.Be3 is the main line of the French Steinitz Variation]

7…Bb4+ 8.Bd2 Bc5 9.b4 Be7

[9…Bb6? 10.Nd6+ Ke7 11.Ng5 Rf8 12.Qg4! is already winning for White. The threat is Ndxf7 followed by Qxe6+]

10.Nbxd4 Nc6 11.c3 a5 12.b5 Nxd4 13.cxd4 Nb6 14.a4 Nc4 15.Bd3 Nxd2 16.Kxd2

Of course not 16.Qxd2?? Bb4; But I thought that White would play 16.Nxd2 followed by 0–0 and then perhaps Qg4.

16…Bd7

[16…Bb4+ 17.Ke3 is now completely pointless for Black, since the White king really wants to go to e3]

17.Ke3 b6 18.g4

Do you remember GM Roland Salvador? He came from a very poor family and his access to chess books was very limited. He made his debut in the World Youth Championships in the 90s with almost zero opening knowledge and just fought hard every game. I remember he was quite a sensation back then and even defeated the Russian and Ukrainian contenders who were booked to the teeth and ill-equipped to handle his caveman tactics. He is one of our players who I believe could have accomplished much more if he had more opportunities.

Anyway, while looking at this game I am reminded very strongly of Roland — this was the way he played the openings — nothing we have seen before, but it works!

18…h5 19.Qg1 hxg4 20.Qxg4 Bf8 21.h4 Qe7 22.Rhc1 g6 23.Rc2

White’s plan is clearl — he will double on the c-file and then play Ng5 and look for an opportunity to either sacrifice on f7 or g6.

23…Kd8 24.Rac1 Qe8 25.Rc7 Rc8 26.Rxc8+ Bxc8 27.Rc6 Bb7 28.Rc2

[28.Rxb6? Kc7 forces 29.Rd6]

28…Kd7 29.Ng5

The threat is 30.Bxg6 fxg6 31.Nxe6! Qxe6 32.Rc7+ winning the queen.

29…Be7 <

POSITION AFTER 29…BE7

So as to counter 31.Bxg6 with 31…Bxg5.

30.Bxg6!

Nevertheless!

30…Bxg5

[30…fxg6 31.Qxe6+ Kd8 32.Qxb6+ Kd7 33.Qc7#]

3 1.Qxg5 fxg6 32.f5!

A second heavy blow. Many chess engines do not understand this move at all, but what happens here is that while there is no immediate win White gets a strong grip on the position from which Black cannot break free.

32…Rg8

Let’s calculate:

32…gxf5?? 33.Qg7+ Qe7 34.Rc7+ Kxc7 35.Qxe7+ Kb8 36.Qxe6 winning easily;

32…exf5 33.Qf6 (threatening Qd6 checkmate) 33…Qf8 34.Qxb6 Qb8 35.Kf3! penetrating with the king. If Black plays 35…Rxh4 36.Qf6 Rxd4 (36…Rh7 37.e6+ Ke8 38.Qxg6+) 37.Qf7+ Kd8 38.Qf8+ Kd7 39.Qxb8. Wow.

33.Qh6

Threat is Qh7+ Qe7 Rc7+

33…Qf7 34.f6 Kd8

Has Black managed to cover all his weak spots and can now play to win with his extra material? No, actually he is bound hand and foot and White will leisurely go for the win.

35.Kd2 Kd7 36.Rc1 Kd8 37.Qe3 Qf8 38.Qc3 Qb4

Forcing the queen exchange, but it does not help him.

39.Qxb4 axb4 40.Rg1 b3 41.Kc3 Bc8 42.Kxb3 Bd7 43.Kb4 Be8 44.Ra1 Kc7 45.a5 Bd7 46.axb6+ Kxb6 47.Ra6+ Kb7 48.Kc5 Rd8 49.Ra2 Rc8+ 50.Kd6 Be8 51.Ke7 g5 52.hxg5 1–0

For chess players using computer chess programs as a tool, this breakthrough is unlikely to have a great impact, at least in the short term, because of the lack of suitable hardware for affordable prices. AlphaZero runs on a Tensor Processing Unit (TPU), rather than the commercially available CPU that all our personal computers run on. A TPU is an application-specific integrated circuit (ASIC) developed by Google specifically for machine learning. It is specifically designed for Google’s TensorFlow.

TPU units are used for Google Street View text processing. They are also used for google photos and process over 100 million photos a day.

What I am trying to say is that we are still many years away from having AlphaZero commercially available. The hardware resources required to run the program are quite huge. Perhaps we can have an open source project with a large distributed network of computers run by volunteers but I do not see that happening any time soon.

But we should look beyond chess the sport/game. As a training tool chess will never be replaced. Demis Hassabis himself, the Founder and CEO and DeepMind, the developer of AlphaZero, himself says that “Chess has been immensely formative for me in helping to develop important skills such as problem solving, planning, visualization, performing under pressure and the transfer of learning from one domain to another. At DeepMind we highly value these meta-skills and they are fundamental in our approach to business and to research. Indeed my journey into AI started with chess, because it challenged me to think about how we think.”

Also, the development of computer chess was not solely for entertainment — it was also research to provide insights into human cognition. Chess was considered an excellent domain for artificial intelligence because of the richness of the problem-solving environment and the ability to monitor and record progress accurately through competition and rating, because of its well-defined structure.

So too with the development of AlphaZero. As explained above it is not a specialized chess-playing application — it is a generic system that was just taught the moves and then it worked out everything else through self-play. If in 4 hours it could work out all the subtle nuances of chessplay and defeat the 2016 computer chess champion then imagine what it could do when applied to the field of health care, quantum physics or even military research with unlimited time and resources.

The mysteries of the world are now opening up to us. These are great times to be in.

 

Bobby Ang is a founding member of the National Chess Federation of the Philippines (NCFP) and its first Executive Director. A Certified Public Accountant (CPA), he taught accounting in the University of Santo Tomas (UST) for 25 years and is currently Chief Audit Executive of the Equicom Group of Companies.

bobby@cpamd.net