artificial-intelligence-chess-inteligencia-artificial-ajedrez-1

Machine’s gambit: Artificial Intelligence and chess

Published on August 9, 2022

Can an Artificial Intelligence learn to play chess? Yes, and it can beat world champions everytime without breaking a sweat.

Leer en español

Pablo A. Ruz Salmones, CEO – X eleva Group

Just a few months ago The Queen’s Gambit, the incredibly successful Netflix series, took chess to a whole new level in terms of popularity. It was the first time chess had been followed by so many people since the times of Fischer and Spassky.

Just a few days ago, in July, the Candidates Tournament took place in Madrid, to define who was going to challenge current reigning champion Magnus Carlsen for the throne in 2023. Carlsen later on resigned his championship, having said that he would only play if “the Persian Genius”, Alierza Firouzja won the match against the other contenders, which he didn’t. The challenger, the Russian Ian Nepomniachtchi (last year’s challenger against Carlsen) is therefore facing runner-up Ding Liren in 2023 for the championship.

What is very interesting about the coverage of the event though, is that all commentators have computers that help them analyze in real time how good or how bad each players’ moves are, in advance and once they’ve made them. In fact, most of the contenders if not all, aside from their professional coches, train with the help of computers. Magnus Carlsen, for example, trains with Alpha Zero, the all powerful Google AI.

The first time we came to know computers were going to beat everyone at chess was in 1997, when IBM’s Deep Blue beat then world reigning champion Garry Kasparov. Although there are some who say that Kasparov lost, rather than that Deep Blue won, the reality is that at the beginning of the 21st century, we had no doubt over computers’ superiority over all humans -grandmasters included- in chess.

Also, and just for the sake of knowledge, legend has it that the term Grandmaster was given by Russian Tsar Nicholass II in 1914 to the five finalists of that year’s tournament in St. Petersburg: Emanuel Lasker, José Raúl Capablanca, Alexander Alekhine, Segbert Tarrash, and Frank Marshall.

But have you ever wondered how chess engines play and work, and why they are capable of beating us all the time?

Here is where it gets interesting. Most chess engines calculate millions and millions of moves in advance, in a brute force fashion to beat players. That is, they calculate as many moves as possible in a given time, and then decide which move to make based on that analysis. Besides, they also use databases containing chess openings that have been studied for the past hundreds of years, to have a better “idea” of what the game may look like (by the way, Queen’s Gambit is the name of one chess opening, characterized by the sacrifice of the white pawn in the “c” column).

The very best of these computers is Stockfish. However, Google’s Alpha Zero uses no opening databases whatsoever, and completely vaporized Stockfish in a match to 1000 games. Stockish was beaten without question. So how can Alpha Zero do that?

Well, the main difference is that Alpha Zero “learns” which are the best moves, by training with thousands and thousands of previous matches. By assigning either a positive or a negative weight to each move based on the result of the next move and the overall result of the game, it has learned which moves it should calculate during a real match, saving tons of time, and allowing it to go deeper with moves it knows may give a positive result in the end.

So now you know it. Next time that you are playing chess against a computer (be it your phone, or a PC), remember that you are competing against an inhuman being capable of beating the very best at chess. So don’t feel bad if you lose. I wonder what Nicholas II would’ve called these computers if he had come to learn of their existance?

At X eleva, we design Artificial Intelligence based on the very best standards of the industry, and always taking business objectives and ethics as our main guidelines.

Do you want to know how much your Artificial Intelligence project costs?

Leave a Reply

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