Recently, on the ChessGym Discord, we had a long discussion about engine sparring — which engine is the best, which plays in the most human-like manner, and what the potential use cases for engine sparring are. By "engine sparring", I mean playing against chess engines for training or fun.
The discussion proved useful, and I learnt many interesting facts about engines and their applications that I wanted to share.
Engine sparring uses
Playing out endgames
It's one thing to know that a certain theoretical rook endgame is drawn, and another to try defending it against an engine that keeps trying various tricks on you (some not even covered in the book you are reading!). I found this very instructive. Practicing a won endgame is more difficult, though, because it's hard to persuade the engine not to give up. Since it's a loss anyway, the engine might just give up its queen or do something silly.
On this topic, see the great post by FM Andy Lee. He found himself in a "Groundhog Day" scenario when he tried to defend a tricky endgame against the engine, day after day, trying various approaches.
Several resources offer this type of training with predefined practice positions:
Chess.com has Endgame Drills and Learn Endgames.
Lichess features an Endgame section in their Practice area.
Specialized websites like Endgame trainer focus on various endgames split by material balance.
LiStudy also includes a dedicated Endgames section.
For the ultimate challenge in won endgames, it's better to practice against an Endgame Database rather than an engine. Your "opponent" will then play moves leading to the longest possible checkmate sequence, ensuring they won't prematurely sacrifice material in lost positions. You can do this on the Syzygy tables database website (use the space bar to force the table to make a move, use the lock icon to automatically change the side to move):
Discovering how to react to typical opponent moves after the opening
The idea here is to start with the last opening move where a book or Chessable course claims you have a clear advantage — even if you're a pawn down! Sometimes this seems hard to believe, and you might worry about the material deficit (I do!). To alleviate your fears and learn more about the position, you can start playing against your side. Just make natural-looking moves and observe how the engine capitalizes on the advantage. The engine will usually destroy you quickly, but you can try different moves and freely use takebacks. Eventually, the engine's play will reveal the strategy, which moves are essential in most variations, and which positions are the best for certain pieces. It's a very illuminating process, albeit time-consuming.
This training is easy to do on the Lichess Analysis board. You can first play opening moves and then select "Practice against computer". Even better, you can enable computer analysis, hide the engine lines in order not to get spoilers (by clicking the "burger" button in the bottom-right corner), make your move, and press the spacebar when you want the engine to move.
Practicing conversion of material advantage
If you struggle to win a winning position, this can be excellent practice! Simply take a position from one of your games where you had a significant advantage but still lost or drew. Then, practice converting it to a win, potentially multiple times.
Playing a long classical game
As part of preparation for a classical OTB tournament, you might want to play some long games without the hassle of scheduling with a human opponent. Typically, it's not easy to arrange a long online game: who would risk to play with a stranger who may disconnect and leave you waiting for hours before their clock runs out? And even with reliable sparring partners, setting up a 2-4 hour match requires some serious coordination. The engine, however, is always available! You can even make your moves on a physical board, for more OTB immersion, entering them into your phone or laptop. This approach does have limitations: there's no psychological element (you can't expect the engine to crack under pressure), and time management is peculiar (the engine moves instantly while you don't!). So it can't (yet?) fully replace classical sparring. Nevertheless, it also offers clear benefits, and these slow games can be as engaging and instructive as games vs human opponents.
Which engine to play?
When using an engine as a sparring partner, my main criteria are:
Playing at an appropriate strength
Playing realistic, human-like moves
Avoiding inexplicable blunders that ruin the game
So far, I've experimented with several engines: Maia, (Fairy) Stockfish, Leela Zero, Komodo, and Noctie.ai
Maia
Maia is described as "a neural network chess engine with a more human-like style, trained from online human games" — seemingly ideal for our purposes. However, even the strongest Maia bot (maia9) was trained on games of 1900-rated Lichess players and has a Lichess rating of around 1600. This means it's unfortunately (or fortunately?) too weak for players rated over 2000 on Lichess.
Stockfish
Stockfish is currently the strongest chess engine — nowadays, when people say "the engine", they're typically referring to Stockfish. You can play against it on Lichess at eight different strength levels:
A closer look at the picture above reveals that it's actually "Fairy-Stockfish". This variant of Stockfish can play not only regular chess but also chess variants like Crazyhouse, Losing Chess, Racing Kings, and Atomic Chess.
In my games, Level 6 sometimes made artificial-feeling blunders, while Level 8 was too challenging. Level 7 seems to be the sweet spot for me. It's worth noting that these are Lichess levels — the actual Fairy Stockfish engine offers around 40 different levels, ranging from -20 to 20.
Leela Zero - lc0
Leela Zero is a neural network engine inspired by Google's AlphaZero. Unlike traditional engines, Leela Zero has two distinct components: an "intuition part" (the neural network with its weights) and a "calculation part". By limiting the calculation component, you can make the engine behave more like a human player who has developed a strong chess intuition but has limited tactical skills. This approach, known as "playing Leela with 1-node search", is recommended by GM Matthew Sadler in his book "The Silicon Road to Chess Improvement" as a useful training method. However, even with this limitation, Leela Zero remains very strong — Sadler estimates it plays at a 2100+ FIDE level, which is too strong for me. GM Sadler himself found it challenging: he played a 100-game match against "Leela 1-node search" and won, but not as decisively as he had anticipated.
A great program for interacting with Leela Zero locally is Nibbler. I like how it displays various probability-based metrics from Leela. For instance, you can configure it to show the probability that a given move is the best, or to display a metric called "winrate" for each move:
Komodo
Finally, we come to one of my favorites: Komodo. It's an engine that has personalities! From the documentation:
Additionally, Komodo has several other parameters useful for sparring with humans.
"Contempt" controls how much the engine dislikes exchanges, blocked pawn structures, repetitions, and other drawing devices. Setting this parameter high leads to sharper games.
"Variety" introduces some randomness in the engine's play, allowing it to choose slightly different moves each time.
Finally, there's "Skill" (ranging from 1 to 25), which determines the overall strength of play. According to the documentation, level 24 with a 15+10 time control should be a good match for a World Champion, while level 1 is suitable for a virtual beginner.
I played a couple of games with Komodo and thoroughly enjoyed the experience so far. There were no unexplained blunders, and the games were sharp and interesting. However, once there was an unexpected triple repetition from the engine, resulting in a draw from a position that looked lost to me. Interestingly, Komodo is the engine used on Chess.com for their vanilla bots. It appears Chess.com acquired Komodo at some point and developed a commercial Dragon engine from it:
To play Komodo, you have two options: play against a bot on Chess.com (where some "personality" bots likely use Komodo/Dragon's "Personality" parameter) or download it from the official site and play locally using any chess UI of your choice (such as HIARCS Chess Explorer or EnCroissant).
Out of curiosity and to improve my "engine handling" skills, I organized a tournament between different Komodo personalities. This 100-round round-robin involved 8 Komodo personalities playing at level 20. Each personality faced every other 100 times: 2,800 games in total! Every opening position was played twice by each player — once as White and once as Black. Here are the results:
It seems like poor Aggressive is just too aggressive (and its aggression probably has no power against the nerveless engines!), so it lost all the matches, even to the Beginner (who “does not understand principles of chess”). And “Default” is the strongest, just as advertised in the documentation.
I used `c-chess-cli` to run the tournament and a custom script to generate a nicely formatted tournament table. This tool allows running many engine games in parallel, tuning engine parameters, providing opening books and logging all the played games for further inspection.
Noctie.ai
Noctie.ai is a comprehensive website designed to be your "chess buddy". It automatically adjusts to your skill level and aims to play in a human-like manner. You earn rating points for making strong moves and defeating the engine at its current level. As far as I understand, its neural network was also trained on amateur games like Maia.
Additionally, it provides several other nice features: it automatically generates flashcards from your mistakes (and then you can log in daily to review them) and it also provides an instant feedback about your moves. The author believes that it’s better to receive feedback instantly than in after-the-game analysis. I don’t necessarily agree, but it’s debatable.
As you can see, Noctie's UI looks great and offers several attractive features. I played many games against the engine while practicing the Grünfeld Defense and other openings. At times it still felt a bit like a work in progress (which it probably is!), but I believe it definitely has potential and is already quite useful for those who enjoy playing against engines.
There are also some interesting articles on Noctie's blog, such as "Why you should play chess against the computer", which is very relevant to this post of mine. Sam, the creator of Noctie.ai, gifted me a free subscription so I could try it fully and share my unbiased thoughts on the project (if I wanted to). So, here we go — thank you, Sam!
Outro
That's it for today! I hope you enjoyed this (maybe not so) quick tour into engine sparring. If you have any other ideas for chess sparring, I'd love to hear them.
Don't forget to subscribe to receive my next post directly in your inbox. Stay tuned for more chess insights!
Didn't know about a few of these resources, thanks Ivan!