Blogs
Engines And AIs. The Revolution Of The Machines In The Chess World

Engines And AIs. The Revolution Of The Machines In The Chess World

VOB96
| 25

A few months ago, I wrote a detailed article about the reasons that I think lead someone to cheat at chess. As many of you know, one of the easiest and most common ways to do this is with the help of an engine that simply gives us the correct move in each position. Obviously, this kind of technology, although already very sophisticated, is still relatively new, at least in the way and with the strength it has nowadays. Therefore, in today's blog, I would like to discuss more and bring some reflections about the history, how it works, the benefits, and the harms that the introduction of strong engines and the revolution of artificial intelligence has brought to the chess world.

Like any technology or new knowledge developed by society, I would say that in principle it is a good thing, considering it helps us to increase our ability to understand a certain field and to broaden our horizons even further. Unfortunately, there is always the side effect that it can be used by unethical people for bad purposes. A clear and rather obvious example of this is our understanding of nuclear physics, which can be used either to generate clean and cheap energy or to create weapons of mass destruction.

Anyway, given this brief introduction, I invite you to come with me to explore more about the engines’ concept, advantages, disadvantages, what I think about them, and form your own opinion regarding their use in our beloved game.

⠀⠀⠀⠀⠀⠀⠀⠀⠀

1)      History

Most of you know that the earliest form of a chess engine was a machine called the Mechanical Turk, introduced in 1770. Created by Wolfgang von Kempelen, this life-size human model could play chess and beat many strong opponents. The Turk remained in operation from 1770 to 1854, when it was finally destroyed in a fire. However, years after its demise, it was discovered that a human was actually behind it all the time, playing hidden in a box with the help of mirrors to see the board.

In 1912 the first real instance of a chess computer was released by Leonardo Torres Quevedo, an automaton named “El Ajedrecista”. Unlike the Mechanical Turk, this was actually the first autonomous machine capable of playing chess. It could play an endgame with white, having a king and a rook, while black had only a king. The machine was able to checkmate the black king played by a human every time and could also detect illegal moves.

In the 1960s and 1970s, the rapid development of computers was the key to increasing the strength of chess engines, led by drastic software and hardware innovations. But it was not until 1995 that IBM's Deep Blue engine was released. In 1996, Deep Blue faced world champion Garry Kasparov for the first time. Kasparov won the match 4-2, but it was still the first time that a machine had won a game against the reigning chess champion in a regular match.

The robot was then upgraded and had its rematch a year later. In an event that would become iconic, Deep Blue became the first engine to beat the reigning chess champion in a full match. From that day on, it could be said that machines had finally overtaken mankind, and the idea of a human winning a game against a computer at its strongest level is simply impossible less than 30 years later.

Stockfish became the strongest chess engine in the early 2000s, until a new revolution appeared.  At the end of 2017, an advanced AI called AlphaZero shocked the chess computing world. It was fundamentally based on a different approach, something that had never really been seen before. While previous programs had relied on searching through trees and evaluating positions, AlphaZero relied on a deep neural network for its analysis. This essentially meant that it could learn chess by itself.

Since then, the presence of neural networks in the world's top chess engines has only grown. All of them today have added this feature in their codes. The most famous ones that can be mentioned are Komodo, Leela Chess Zero, and Stockfish, which often wins the Computer Chess Championships.

 

2)      How it works

In order to explain how modern chess engines with neural networks are developed, it is important first to understand how the classical ones work. My intention is not to give a full course about it, for that I would need a whole diploma or master thesis, but just a general idea.

In summary, they use some concepts derived from human chess theory studies, such as center control, king safety, pawn structure, and piece development. These programs analyze the positions of all the pieces on the board to mathematically determine what the best move is. An average engine will run an algorithm based on the total evaluation of each point mentioned above and simulate the rest of the game thousands of times to come up with the most optimal move.

The four main techniques used are:

  • A search algorithm: Usually the Monte Carlo Tree Search (MCTS), which is based on randomized explorations of the search space. Using the results of previous explorations, the algorithm gradually grows a game tree in memory and successively gets better at accurately estimating the values of the most promising positions and moves.
  • Evaluation functions: Evaluate the strength of a given position. They take into account the factors mentioned above to generate a mathematical answer as to which positions are better or worse. This evaluation function provides a numerical score for a given position, which the search algorithm then uses to determine the best move.
  • Endgame tablebases: Pre-calculated closed databases that allow chess engines to play perfect endgame positions with less than eight pieces on the board. Basically, there is no calculation required, as all positions are cataloged and displayed as win or draw.
  • Machine learning: Techniques used to improve the evaluation functions. They can learn from the results of previous games to improve their understanding of good and bad positions, and thus adjust the weight of the factors in the evaluation function.

Stockfish, for example, is trained by using large databases of Grandmaster games to guide its evaluation and decision-making through the aforementioned strategies.

The later introduction of neural networks has allowed engines to improve both their ability to examine positions and their search capabilities, working together with the MCTS algorithm. AlphaZero, the most famous, uses a deep neural network that is trained to predict the outcome of the game from a given position by recognizing patterns that are important for success.

These neural networks are trained through a process of self-play, where the engine plays against itself and adjusts its own parameters based on the results of those games. This allows them to improve and become stronger over time. The process of self-play and reinforcement learning is implemented using another variety of algorithms.

⠀⠀⠀⠀⠀⠀⠀⠀⠀

3)      Benefits

Well, since I am not a professional player, my main focus in this topic will not only be on how the use of engines has certainly changed the way grandmasters prepare for their matches. That will be better discussed in the fifth topic of this text. Here I want to talk about the new way that ordinary amateurs can experience chess.

One of them, and perhaps the most obvious, is the possibility to analyze our games after they are played and see exactly in which moments we made the worst mistakes, thus letting us know what aspects we still need to develop, recognize tactical patterns we were not aware of, get feedback on our ideas, preferably after analyzing the position ourselves, and finally increase our overall understanding of the game.

Besides, but still related, the engines give us the chance to learn on our own, if we know how to use them properly. While a coach is still something indispensable for people who want to reach a professional level, I believe that those who just want to play for fun now have the capacity to play much better than what was possible in the past, without having to spend huge amounts of money on courses or coaches. I am not saying that it is a replacement, but perhaps a more accessible tool for people who play chess just as a hobby.

But the best part, in my opinion, is the new horizons of entertainment it has brought. Even if the evaluation is not always completely accurate, we cannot deny that it is fun to check our accuracy at the end of what we think is a well-played game; to be happy when it is over 90% or frustrated when realizing that we played much worse than initially thought; to celebrate our brilliant moves, no matter if they are really brilliant or not; and to laugh a bit at the roller coaster of emotions that blitz games usually are.

In addition, there is the possibility of watching professional games and knowing in advance who is winning, what moves need to be made to maintain the advantage, and how hard it is to find them. I can say for myself that I love the anticipation created when my favorite players have only one winning move and the tension to see if they will find it or not, followed by the joy when they do or the sadness when they don't. This kind of emotion was almost impossible to have in the past, considering that if a strong GM cannot find a certain move, the spectators would also have no idea whether what he played was in fact the best choice.

⠀⠀⠀⠀⠀⠀⠀⠀⠀

4)      Harms

When it comes to the negative points that the introduction of strong engines has brought to the game, I think the first and most obvious one that comes to our minds is the issue of cheating, which is so normal especially online between amateurs, but can also have an impact on the professional level. As I wrote in my text specifically about this, chess is almost the only sport where "doping" can make someone who has never practiced it beat the world champion, so the rules and procedures to prevent cheating must be very strict and rigorous.

The fact that someone can cheat in a professional tournament has two main consequences. The first is that if it really happens, the trust of the general public and the excitement of watching high-level chess games might be greatly affected, so there is a need to make sure it doesn't happen and that those who are caught are severely punished. The second is almost the paranoia every time a player wins a great game with fantastic moves that are hard to find, but instead of being recognized and praised for his brilliance, the most common reaction is to suspect some kind of illegal help without any evidence. I would certainly hate it if I were the one who won.

However, there are also other points that I consider to be drawbacks of this technology, especially if the player does not know how to use it properly. For example, it can be detrimental to our development if we focus only on getting the computer's ideas right and stop thinking with our own minds, limiting our creativity, and frustrating us by not always finding the "best" move, although it's often not even the right one for a human being in a particular position.

The famous “engine lines” frequently lead to paths that are impossible to calculate, and a move that is only the third or fourth suggestion leads to a much simpler and still winning position. So, while feedback from the machine is important, we need to know when, how, and under what circumstances to take it into account.

Another thing that upsets me is that some people now seem to think that many of the top players are actually "not so good" because they cannot always find the best engine choice. To judge a master just by how often he gets the first suggestion is something very unfair and superficial. We must always remember that chess is much more than playing like a computer, and those who have reached the top are geniuses with such a deep understanding that in some cases can even outperform engines, especially in endgames.

 

5)      Revolution for the game

Please don’t take this picture seriously.

As promised, I would now like to go a bit further into the revolution that the implementation of engines, and in particular artificial intelligence evaluation, has brought to chess. I am sure that if a chess master from the 1960s or 1970s had to play against the best AI we have today, he would first think he was playing against an average club player, still lacking some notions of the most important strategic principles, until the moment he would be completely outplayed and crushed on the board, without even understanding where he made a mistake or how the game could suddenly become so complicated to play.

This happens because the AIs do not care about the history of years that mankind has taken to study opening principles or the best strategy approaches, nor are they worried if the move looks ugly or not harmonious. They are trained to win, and that is the only thing that matters, leading to new ideas that we are still struggling to understand, and showing us that the knowledge of chess is far from saturated. For those who think that the days of classical chess are numbered, computers are here to show us that there is still much to be discovered and that our limited human minds may never really be able to do it.

They prove that material is not always worth as much as we are used to think, especially some of the pawns that they so often sacrifice for the better activity of the other pieces; show some ideas that seem completely absurd at first glance until we take more time to understand everything behind them and realize they are actually brilliant; and open up new possibilities that in the long run will probably make us less afraid to take risks instead of just trying to hold that one pawn who gets our attention more than it deserves.

We can already see this trend changing the way the new generation of GMs play and prepare for their games. I am talking about names like Praggnanandhaa, Gukesh, Abdusattorov, and Arjun Erigaisi. Their style of play is much more focused on finding those kinds of ideas instead of just thinking: "Ah, this is an engine move, forget it". I think what will separate the best players from the average ones in the near future will be the ability to balance the understanding of classical knowledge with the revolution of the new era we are entering.

However, this is especially true in high-level chess, where any small detail can make the difference between a winning or losing position, so what I said earlier is still valid for us, mere lovers of the game.

 

6)      Conclusion

In general, I can say that the introduction of this new perspective from machines in a century game like chess is very good for bringing fresh ideas. In my opinion, new knowledge is always something positive, regardless of the possible bad consequences or the possibility of unethical use. In the end, we are the ones responsible for ensuring that our creations are used in the right way, either by raising awareness or by punitive measures. Stopping progress is not and will never be the answer to curbing possible misbehavior.

I hope that the chess engines will continue to evolve and make the strongest ones of today look like garbage in the future, maybe even reveal things about the game that we wouldn't dream of today. In addition, as they become more accessible and natural to everyone, the popularity of chess can also be increased, as the chance of development rises and has the potential to make more people interested in learning it, keeping them motivated to become stronger.

At the same time, it will be even more important to take anti-cheating measures seriously to ensure the integrity of the sport. Unfortunately, I think we're still a long way from where we should be in this regard, so there's a huge gap to close before it's too late. Maybe at some point, the level of a machine will be so superior and inconceivable to a human that a cheater will be easier to catch. Or, in a very optimistic scenario, the development of AIs that can detect trustworthy signs of illegal help in professional matches can help us further fight against such an important problem.

But above all, I hope that everyone involved, from the beginner with 600 ELO to the super grandmaster, understands the importance of the correct use of these tools in our favor so that chess can grow as a sport worldwide. If we are able to take advantage of them, everything can be experienced better than it is today, from studying alone at home, reading a chess book, playing online, participating in a tournament, or watching the best in the world play.

Although it is a profession for many, chess is still entertainment for the vast majority of people, which is actually what keeps the professionals able to make a living from it. Therefore, new "expansions" are always welcome to show how amazing this universe can be and how many possibilities we still have to discover.

If you read to the end, thank you for your patience and attention! Please let me know in the comments what you think about this topic, which aspects I forgot to mention, and what you expect for the future of chess.