What is a chess neural network?

Photo from www.datascientia.files.com

If you don’t know that don’t worry! Most people don’t either. Today we’ll talk about the differences in chess strength between humans, chess engines and chess neural networks. The game of chess has been around for thousands of years and yet, this game seems to not have a resolve. As Grand Master Garry Kasparov said: “Chess is a game of unlimited beauty!”.

In order to understand what a chess neural network is, you first need to understand what a chess engine is.

What is a chess engine?

Photo from www.hiarcs.com

“A chess engine is a computer program that determines the best moves in a chess game. Of course, not all chess engines are the same, some will give you different move sets or move orders, but for the most part chess engines which are similar in strength will agree on similar moves.”, sais National Master Michael Charles.

One popular misconception about chess engines amongst people is that chess engines calculate every single move from a given position and then play the move that is more likely to win the game – and repeat all that process again and again till victory. The problem with such an approach is that this would mean that the chess engine would have to calculate around 10^43 moves in order to decide what to play. But doing that would require immense computational and analytical power, which when combined with the factor of time of a typical classical chess match, which lasts around 4 hours, makes it impossible to do.

The simplest way to understand how a typical chess engine works is to understand how the chess engine looks at the game of chess. A typical chess engine when looking at a certain chess position, will look for „tells”. „Tells” can be interpreted as „double pawns”, „king safety”, „centralized rooks”, „development issues”, or „attacking potential”. It will do this in order to figure out if the position is better or worse for either side, whether it be black or white.

So basically, a chess engine is a program that converts a position into a move or series of moves using evaluation functions. Evaluation functions consist of hundreds of handcrafted lines of code designed to analyze and evaluate many different chess positions – because the code is usually crafted by human grandmasters, the code itself is limited to the play of a grandmaster. Evaluation functions are used to evaluate positions on a chessboard. It usually calculates the result of the sum of all of your advantages minus the sum of all of your opponent’s advantages. By giving pieces on a chess board values (a pawn is worth 1 point, a knight is worth 3 points, a bishop is worth 3.25 points, a rook is worth 5 points, and a queen is worth 9 points), these functions can be calculated (chess.com, 2020).

Now, let’s move on to neural networks. Keep in mind, we are not yet at chess neural networks, only neural networks. Neural networks are made up of layers of neurons (similar to the ones of a biological brain). These neurons are the core processing units of the network – and it consists of three different layers (the input layer, the hidden layers, and the output layer). The input layer is the receiver of information, whereas the output layer decides the final information. In between these two layers lie the hidden layers which do most of the calculations of the network. Let’s say „input layer” is A, „hidden layers” is B, and „output layer” is C. Simply put, information goes into A, is processed by B, and is presented by C in the form of a result. That’s how a neural network works for the most part.

CHESS NEURAL NETWORKS

Photo from www.erikbern.com

Besides the fact that they are composed out of different types of layers, as discussed in the previous paragraph, they (chess neural networks) are also equipped with two main components.

The first main component is deep neural networks. That basically means that a chess neural network has a multitude of hidden layers in order to improve the computational power of the network itself. Makes sense, the more hidden layers you have, the better the calculations of whatever it is you want to calculate will be. You can also interpret it as a way to process information which is inspired by biological systems such as the brain.

And the second component is a general reinforcement learning algorithm. Drastically oversimplified, that basically means that the network plays the game from scratch against itself and constantly improves and learns from its own mistakes from every single played game.

So, now we finally have a relatively good grasp on what chess engines and chess neural networks are. But other questions remain – such as, how good are they against humans? And more importantly, how good are they against one another?

HUMAN VS CHESS ENGINE

Photo from www.vox-cdn.com

Let’s go back in time for a little while. Let’s return to the year 1997, when IBM’s supercomputer chess engine defeated the reigning World Chess Champion at that time Garry Kasparov. Well, the match’s score was 4-2 in Kasparov’s favour, but what history remembers is the defeat that Garry Kasparov suffered – that is because in those times engines and computers weren’t very strong and would hardly even get a draw against a grandmaster, so the news that the actual World Champion lost a chess game to an engine was mindboggling, and it became international news very quickly.

What is important to note is that ever since Garry Kasparov lost that game against Deep Blue in 1997, more funding and investments were given to the development and improvement of chess engines. Because of those investments and improvements, nowadays there are hundreds of chess engines which are dramatically stronger than Deep Blue was. According to some grandmasters of that time and even Garry Kasparov, who was rated 2843, Deep Blue was rated anywhere between 2550 to 2700, which is definitely top grandmaster level amongst humans, but doesn’t even come close to the strength of the chess engines of today. In the year 2020, there are at least 57 chess engines with ratings over 3000 – and at the top spot stands Stockfish 2019-10-09 64-BIT 4CPU (or formally known as Stockfish 10), rated 3493 (CCRL, 2020).

Amongst humans, the highest rating ever was 2882, achieved by Magnus Carlsen on may, 2014.

Photo from www.ytimg.com

So the answer to the question “How good are chess engines against humans?”, the answer may very well be “We don’t stand a chance”, but don’t feel sad about that, because all-in-all, our human curiosity and drive towards making improvements is what created these strong chess engines in the first place.

To the question „Who do you think is stronger in chess, a human or a chess engine?”, Kais Khoury, an international chess player, responded: „A chess engine is a lot stronger. I mean I am constantly analyzing my games using stockfish and I am always amazed by how accurate that engine is.” – and NM Michael Charles had this to say: „Fortunately for us, the engines are better at chess. Otherwise, we wouldn’t have anything to show us a mate in 50 moves! I am obviously joking, but it’s obvious they are better than us at chess. It’s not even a discussion.”

CHESS ENGINE VS CHESS NEURAL NETWORK

Photo from www.ytimg.com

Who is stronger in chess, a chess engine or a chess neural network?

To this question, international chess player Kais Khoury had this to say: „I don’t really know. I mean, I know that google created some A.I. that was able to beat stockfish, but I don’t know enough about this to pronounce myself.”, and NM Michael Charles had this to say: „ I believe that the difference between a chess engine and a chess neural network is correspondent to the difference between a human and a sophisticated chess engine. If you look at it objectively, the strongest engines we have are rated like 3400-3500, and a single neural network can defeat them no problem.”

In 2017 the Deep Mind division at Google headquarters created a chess neural network called “Alpha Zero” and let it play chess for four4 hours against itself. What came next was beyond remarkable. What happened next is that Alpha Zero, after playing for four4 hours against itself with no opening theory, no middle-game or end-game table bases, went on to defeat the world’s nr. 1 chess engine Stockfish 8 in a 100-game match with an unprecedented result. The final tally after 100 games was 28 wins for Alpha Zero, 72 draws, and… well, you can figure out how many times Alpha Zero lost against stockfish by doing the arithmetic yourself. Just let this sink in for a moment. The best chess engine in the world in 2017 lost without winning a single game against a neural network that played the game for four4 hours. If you consider that the result would be different in 2020 because now the top engine is Stockfish 10, not Stockfish 8, you would be mistaken. You would be mistaken because the difference between Stockfish 8 and Stockfish 10 is only around 100-150 rating points. If anything, maybe Stockfish 10 would be able to lose less games against Alpha Zero, but even winning one1 single game seems very unlikely.

As of 2020, besides Alpha Zero, there exists another very powerful chess neural network called Leela. Leela is an upgraded version of Alpha Zero. As a reference, Alpha Zero was running on a 20×256 neural network architecture, whereas Leela is running on a 30×384 neural network architecture. These numbers basically show the number of neural connections present within the program, and you can notice the substantial difference between the two.

From these results we can extrapolate the reasonable conclusion that chess neural networks are better at chess than chess engines, and therefore are better at chess than humans.

Do you think that now, with the existence of chess neural networks, chess is a solved game?

To this question, Kais Khoury said: „ I mean… no. Like, you can’t really say that because I believe that the game of chess is unsolvable. There’s just too much variety in it. As far as I know, the game cannot be solved by stockfish, which calculates over 70 million positions per second, so I really doubt that these neural networks can solve it.”, and NM Michael Charles said: „I don’t think so. I think that the most important thing that the introduction of chess neural networks has done for chess is showcase the fact that the game can be played with much more precision and patience than anticipated by anyone and any chess engine of today’s time. This is not a bad thing; it just proves that even engines can improve their play.”

I‘ve also felt the need to ask these two international chess players two more important questions. To the question: “Do you think the game of chess is still fun to play even though you know you’ll never be better than an engine or a chess neural network?”, Kais Khoury replied with: “As long as I don’t have to play against them… yes! I mean… the thing is, I don’t play chess to compete against machines. I play chess to compete against people and I have a lot of fun doing so. That’s what’s important. That’s what matters. So yeah, I believe it’s still fun to play. It’s thrilling to know that this game is so much more than we will ever be able to understand and it’s kind of reassuring that there will always be someone better than you at something. That way, there’s always something to aim for, even if its unachievable.” – whereas NM Michael Charles said: „Of course, it’s still fun to play. This is how I look at it, the engines and neural networks are there to help people improve their chess. That’s great for chess. In the past if you wanted to get good at chess you needed a couch, but now you can simply download an engine that’s better than any person that has ever played this game for free and learn from it. I believe that this way more people will be drawn to chess and that can only help this beautiful game.”

Also, to the question: “Do you think grandmasters will now use chess neural networks to as part of their preparations before a tournament?”, Kais Khoury answered by saying: „I don’t think so. I mean, preparation can only get you to like the first 15 moves of a game, if you are lucky! After that it’s all on you, and the player with the better technique will prevail in the end. The thing about preparation is that you can only memorize a set number of moves and variations and if your opponent plays a move that wasn’t calculated by you in the home preparation then it’s on you from there on. I don’t think they will use networks for their preparations, I think they’ll continue using engines as they are good enough.” , and NM Michael Charles pointed out that: „It depends. If you consider Magnus Carlsen then he might switch to neural networks, but if you talk about your average grandmaster, I think a normal engine would suffice. Chess engines are still very, very good in the opening phase of the game and there isn’t much to improve on there. It’s not like a neural network will find a novelty that offers huge advantage in the first 10 moves of any chess game anyways. The only thing that a neural network will teach you is how to play the middle-game. But because you don’t know how a middle-game will look like in any chess game, its futile to try to prepare for that. It wouldn’t even make sense to try to prepare a middle-game position before you even know the position that will be on the board you’ll play.”

References:

“neuralnetworks.” www.datascientia.files.wordpress.com, Google LLC, datascientia.files.wordpress.com/2018/02/neuralnetworks.jpg?w=720, 2020. Accessed 8 May 2020.

“images.” www.hiarcs.com, WordPress, www.hiarcs.com/images/cebh13/75demo2.JPG, 2020. Accessed 13 May 2020.

“chess-architecture.” www.erikbern.com, Microsoft Publisher, erikbern.com/assets/2014/11/chess-architecture-1.png, 2014. Accessed 7 May 2020.

“deep blue kasparov 1997.” www.cdn0.vox-cdn.com, Microsoft Publisher, cdn0.vox-cdn.com/thumbor/83oCJk-sX-HJi6BHPY1B919KMbQ=/0x25:680×408/1600×900/cdn0.vox-cdn.com/uploads/chorus_image/image/42598430/deep-blue-kasparov.0.jpeg, 2016. Accessed 12 May 2020.

“Magnus Carlsen.” www.i.ytimg.com, Google LLC, i.ytimg.com/vi/fd-7dIg0Wzc/maxresdefault.jpg, 2020. Accessed 9 May 2020.

“Stockfish vs Leela.” www.i.ytimg.com, Google LLC, i.ytimg.com/vi/gI4V87WyOVI/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLD2D0mLgxhzfk_K4nlNQqJawxL6GQ, 2020. Accessed 14 May 2020.

hanngo. “Chess Pieces Values.” www.chess.com, Chess.com 2020, www.chess.com/article/view/chess-piece-value, 2020. Accessed 3 May 2020.

CCRL. “CCRL.” www.computerchess.org, CCRL team, www.computerchess.org.uk/ccrl/4040/, 2020. Accessed 1 May 2020.

Leave A Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.