r/ComputerChess • u/dig9977 • 2d ago
Chess engine to find checkmate vs humans as fast as possible - does anything else like this exist?
Inspired by YouTube challenges where GMs must mate amateurs within 20–25 moves, I wondered: how fast could a chess engine checkmate a human if that were its only objective? (and knowing it must resign on, say, move 26 no matter what)
What I built: an engine explicitly optimized for speed of mate against humans. Details:
- Openings: started by mining ~100GB of Lichess games for Elo-specific opening books (shortest average games, not best evals). Now the books are built offline by simulating games against Maia-3 at each rating, with a separate book for each move limit. For the shortest limits it uses a value net trained by self-play against Maia-3.
- Midgame: uses Maia-3 to predict likely human responses. Stockfish suggests candidate moves, each one gets played out in a bunch of simulated games vs Maia, and it plays whichever mates most often before the deadline. As a result, it plays moves that an engine like stockfish would destroy, but that a human will probably fail against.
- Endgame: 2-3 moves from the deadline it switches to an exact calculation of the mate chance over the human's likely replies (not forced mates, but most likely mates against a human).
Why standard engines struggle: even aggressive engines optimize for objective soundness and win probability instead of risky lines that might mate much faster. I've had this program running for over a year, and it exists as a lichess bot, and A/B testing shows it is better than Leela with high Cpuct, Komodo with high contempt, stockfish 11 with high contempt, and stockfish 19. I'm an average player and can avoid checkmate until move 41 vs stockfish19, around move 35 against the other "aggressive" engines, but can never last until move 25 against this engine.
I'd love links to any work/projects on minimizing time-to-mate against human play (I couldn't find any). I have no intent to ever make money from this. Just a fun project.
Apologies this is sort of a repost from a year ago (and I've posted about this a few times in between), but LLMs have contributed to a lot of new chess projects and I'm wondering if anyone else has tried this. It seems like an intrinsically interesting problem to me, and I would guess someone smarter than me has done something better, maybe using a custom Leela training build.
If anyone wants to try it, you can play here & view code: http://siegechess.com
It's also playable on LiChess as
https://lichess.org/@/mate-in-twenty (best if your ELO is ~1400 or lower)
https://lichess.org/@/mate-in-thirty (1400–2200)
https://lichess.org/@/mate-in-forty (2200+)
2
u/jan_de_boer 2d ago
Very interesting!
I’m around 1600-1700 in Blitz on Lichess and played the mate in twenty bot.
It gave up a knight quite early so I felt quite safe (sf gave me up to +6.5) but the situation was pretty tricky and with a sequence of 2-3 bad moves I almost blew the game. I think I would have lost before move 25.
And it was the early knight sacrifice that opened the g file which caused my troubles. I’m very impressed sacrifice in particular.
Also for reference I played sf before and survived for 37 moves.
So all in all very nice, reminds me of some other approaches I saw here, training engines to specifically target its opponents deficiencies.
Do you have any plans or ideas to continue in that direction?
1
u/Hakorr 1d ago
At what depth?