Machine learning in chess + History of neural networks!

The creation of Alphazero and its successor, Leela Chess Zero marks the time where neural networks become popular.

Machine learning is something that fascinates a lot of people. The idea that a man-made creation can come so close to a thinking being is amazing, even godly. 

Some have wondered if this is the same mechanism that makes chess computers so powerful? They after all are entities that have surpassed humans in terms of our chess ability, nobody could come even close.

Some chess engines today implement a neural network (machine learning) in their algorithm, but the majority of chess engines still do not have neural networks.

Personally I am very aware of the machine learning development in chess engines since I have witnessed it all. I have been involved in the chess community for several years now after all. 

I want to impart my knowledge on this topic to you, my readers, with the use of this article. Without wasting too much time, let’s get going. 

Machine learning or Neural Network in chess

Traditional chess engines are programmed to follow sets of instructions (which have been formed to be its algorithm) that would allow the engine to find the best moves in the position.

Some of the instructions these computers use are the creation of a search tree, alpha-beta pruning, or a quiescence search.

But essentially these are all instructions that help the chess computer evaluate the position and concoct its recommendations, it is a set of guides. 

The computer will follow this program without a sense of improvement, that is how the artificial intelligence will behave. However there is a new set of chess engines that doesn’t follow the same system, the neural networks.

These neural networks actually fall in the machine learning category, they don’t just follow a set of instructions and instead will improve over time.

Because of this, chess engines that use machine learning are significantly weak in the beginning but will improve overtime as it gets more experience. Traditional chess engines are usually already strong from their conception.

Chess computers that implement machine learning are dynamic in strength, their ability to play chess changes over time. With the introduction of neural networks, the evolution of chess computers is starting to be upheld.

Alpha zero and Leela Chess Zero

The primary game-changer for chess engines in the machine learning aspect comes in the form of Alphazero and Leela Chess Zero with their modern and outstanding neural network.

Back in the day, all chess computers only followed their sets of instructions (traditional algorithm) and cannot learn over time. 

Google Deepmind decided to craft a chess engine that would incorporate the popular machine learning technology at the time, and the creation is a system that is called a neural network. 

The product of this pursuit is the very first chess engine that implements machine learning, Alpha zero. They quickly pitted Alphazero against the universally accepted chess engine at the time, Stockfish.

That battle is legendary but also controversial, Alphazero managed to completely crush Stockfish but some argue that this is because Stockfish is not in its strongest version.

Since then Alpha has participated in other games such as go, creating its new form Alpha go. The artificial intelligence also played Starcraft and even began folding proteins for science.

Alpha zero has been inactive from chess for the most part and its successor, Leela Chess Zero, continued the mission to introduce machine learning in the chess engine community.

Leela Chess Zero: Successor of the machine learning story

Leela Chess Zero is actually the reason why some chess engines today implement the neural network system and why the population is growing.  With Alpha Zero inactive, the hype on machine learning kinda slowed down.

However, there is a group of individuals that decided to create the second neural network chess engine Leela Chess Zero, and they asked the world for help in its training.

I can still remember the campaign for Leela chess zero’s machine learning improvement. Chess players all around the world are invited to download Leela Chess Zero in order for it to be strong enough to compete against other strong chess engines.

There was even a time where even I could beat Leela, and a lot of chess streamers at the time (titled players) could destroy the said neural network since it is still learning.

One of my favorite games where Leela Chess Zero has been destroyed is that of this legendary bullet player (also a grandmaster), Andrew Tang. Though Leela is actually already strong in that matchup.

This match marks the time where the neural network chess engines could still be easily beaten, however, they have become stronger and multiplied in numbers over time.

Other machine-learning chess engines besides Alpha and Leela

With the passing of time, people realize the potential of machine learning in chess computers and a lot of people created a new wave of chess engines that implements a neural network.

A lot of these chess engines have only copied Leela’s system in one form or another (though not entirely), which is why I said Leela really bridged the gap between chess engines and machine learning.

Some of the chess engines that copied Leela Chess Zero’s algorithm (which also implemented machine learning) were the following:

  1. Fat Fritz (Leela’s engine but a different neural network).
  2. Leelenstein (Leela’s engine but a different neural network)
  3. Allie (Original engine + leelenstein’s neural network)
  4. Stooves (Original engine + different neural network)
  5. Scorpio (Own engine + leela’s neural network)
  6. Antifish (Leela’s engine + different neural network)
  7. Beta one (Leela’s engine + different neural network)
  8. Darkqueen (Leela engine + different neural network)

This wave of chess engines proves the popularity of this concept, machine learning is starting to be accepted in the chess engine community.

However this raises the question, are chess engines who implement machine learning better than those who implement traditional algorithms?

There are more traditional chess engines than neural networks

As of today there are still more chess computers that implement the traditional algorithm over those that use machine learning. 

There are still those that have machine learning in their system (as I have listed above) but the majority still aren’t implementing the same strategy.

Not all chess engines use the concept of machine learning, in fact, the majority of live chess supercomputers are not formatted to run a neural network.

This includes very strong chess engines such as Stockfish who has beaten Leela Chess Zero in their multiple legendary standoffs, proving that traditional algorithms can compete with these new machine learning neural networks.

Stockfish, Houdini, and Komodo do not implement machine learning

There’s a lot of very strong traditional chess computers at the pinnacle of the rankings as can be seen from the engine-only chess tournaments (the TCEC for example).

I am talking about Stockfish, Houdini, and Komodo, the big three chess engines that have been at the top of the world for a really long time now. None of these top chess engines implement machine learning.

Update: Stockfish 12 recently added a neural network to its system! This is an incredible development.

The traditional engine algorithms (namely with Stockfish, Houdini, Komodo, etc.) are not considered within the realms of machine learning. These conventional algorithms only follow instructions from their code.

It may seem simple since the traditional engine doesn’t learn over time, but it has proven to be effective. Leela Chess Zero is still a top chess engine but is nowhere close in beating the three convincingly over a series of matches.

Leela Chess Zero today is definitely strong, it has even almost beaten the latest stronger version of Stockfish in one TCEC superfinal but has come short in the end.

We are still very far from that saying neural networks will replace traditional chess engines since it’s not even proven yet to be stronger than the latter.

Traditional chess engines might be stronger than neural networks

I think there is a growing misconception in those who follow that trajectory rate of the machine learning technology, a lot of people view this format as the undisputed setup that will soon replace traditional algorithms.

Now this may be true in some fields, but if we are talking about chess specifically, traditional algorithms seem to work just as good if not better than neural networks.

It is still not settled whether the traditional algorithm or the machine learning algorithm is better for chess engines. It may in fact be that the traditional chess engine’s algorithm is the best after all.

In Alphazero’s case we need to consider that the neural network didn’t really face Stockfish in its strongest form, plus the games are not properly officiated by a regulated committee.

It is made by the creators of Alphazero themselves and they eventually published the games, which is why there is a question of validity.

If we are looking at its successor Leela Chess Zero, it seems that it still cannot break the strongest traditional chess engines.

The reason why there are still a lot of chess computers implementing traditional algorithms is that it just gets the job done, probably even better than the new neural networks unless there is proven evidence to the contrary.

Best chess engines do not adhere to machine learning

The best chess computers in the world right now are those who do not have machine learning (neural network) apart from Leela Chess Zero (Alpha Zero is currently inactive).

In fact, almost all strong chess engines right now do not run a neural network in their system.

Chess engines do follow a certain tier (ranking) by which they are categorized by strength. The group of chess engines that received the highest tier is almost exclusively run by traditional algorithms (except Leela).

This really tells a lot, that machine learning in chess is not as big as it is hyped to be (at least for now). 

I personally think that even in the case of Alphazero there is a popular bias to side with the neural network which is why the question to validity is not brought up often. 

People want to conform to their beliefs, that machine learning is this incredible thing that would change the future. Well at least in chess, engines that implement machine learning are almost all not on the top side of things.

Machine learning vs. Traditional algorithms in chess

Chess engines that are programmed with machine learning algorithms are unlikely to replace the chess engines that are on the traditional algorithm. It seems that neural networks are still relatively new and need some improvements to keep up.

Do not lose hope though if you are a fan of machine learning, the introduction of neural networks is still in the process of evolution and can still improve in the future. 

We can’t truly judge the neural network’s full viability since change in the modern world is constant, it could be that machine learning just needs momentum in order to completely knockout the traditional algorithms.

Or it could be the opposite, where the current neural networks and machine learning will completely fade with the passing of time without any chance of beating the established chess engines.

We really can’t tell since machine learning in general is still new to chess (it still isn’t even fully commercialized yet) and there can be changes in the future.

The current and the future of machine learning in chess

The future of neural networks in chess is still questionable, it seems that the traditional algorithms are starting to make a point with their current strength.

This is to inform the masses that complication doesn’t necessarily make everything better, sometimes the simple things get the job done much efficiently.

If we are looking at things now the traditional algorithms are definitely still better than the machine learning neural networks, and it could take some decades for this to change.

Update: Stockfish 12 did recently include a neural network, but Houdini and Komodo still use traditional algorithms!

Final thoughts

This machine learning versus traditional algorithm war is a must see. I am excited for the future development that will be the product of this race. 

Ultimately, I am neither in either side of both formats and just want to see major improvements on chess engines in general. 

I really want to indulge in our technology in order to perfect the game of chess. I want to be still alive when the strongest chess entity is created. 

I doubt that chess will be solved in the future even with all of our technological advancements (which pretty much makes it a dead game) so it is still in the clear.

I just want to see what the perfect game is like in chess, and machine learning might be the key to that. Just a thought, sleep well and play chess.