For those of you that never visit the programming forum Thomas Jahn has released a new and different version of Leorik. The reason I think it deserves a mention here is because it has imo a new, fresh and exciting style of play.
https://github.com/lithander/Leorik
Leorik 2.3 Released
Moderator: Ras
-
Mike Sherwin
- Posts: 965
- Joined: Fri Aug 21, 2020 1:25 am
- Location: Planet Earth, Sol system
- Full name: Michael J Sherwin
-
Gabor Szots
- Posts: 1487
- Joined: Sat Jul 21, 2018 7:43 am
- Location: Budapest, Hungary
- Full name: Gabor Szots
Re: Leorik 2.3 Released
Thanks Mike. I am one of its followers and am just doing a test run with it. Unfortunately I did not follow its games but I may catch up. Strengthwise it is around version 2.2 I assess.
Gabor Szots
CCRL testing group
CCRL testing group
-
lithander
- Posts: 918
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Leorik 2.3 Released
Thanks for making a dedicated thread about Leorik, Mike! That's an honor! 
I'm sadly not good enough a chess player to really judge the style of it's play but here's a game that caught my attention:
[pgn][Event "?"]
[Site "?"]
[Date "2022.12.21"]
[Round "160"]
[White "Leorik-2.3"]
[Black "Inanis-1.1.1"]
[Result "1-0"]
[ECO "A43"]
[Opening "Old Benoni defense"]
[TimeControl "40/30"]
[PlyCount "91"]
[GameDuration "00:01:02"]
[GameEndTime "2022-12-21T17:33:58.596 Mitteleuropäische Zeit"]
[GameStartTime "2022-12-21T17:32:56.517 Mitteleuropäische Zeit"]
1. d4 c5 2. dxc5 e6 3. Be3 Na6 4. Nf3 Nf6 5. Bd4 Bxc5 6. e3 Bxd4 7. Qxd4
O-O 8. Nc3 Qe7 9. Bxa6 bxa6 10. O-O Bb7 11. Ne5 d6 12. Nc4 Rfd8 13. Na5 e5
14. Qd3 Rac8 15. Rad1 Qc7 16. Nxb7 Qxb7 17. Rb1 Rc5 18. e4 Qc6 19. f3 h6
20. Rbd1 Rc4 21. Qe3 Rb8 22. Rb1 Rcb4 23. b3 Rc8 24. Na4 d5 25. c3 Rb7 26.
exd5 Nxd5 27. Qe4 Nxc3 28. Nxc3 Qb6+ 29. Kh1 Rxc3 30. Qxe5 Rc2 31. Rbc1
Rxa2 32. Rc8+ Kh7 33. Qe8 Qb5 34. Qg8+ Kg6 35. Rfc1 Qe2 36. R8c6+ f6 37.
Rxf6+ Kxf6 38. Rc6+ Kg5 39. Qd5+ Kf4 40. g3+ Ke3 41. Rc3+ Kf2 42. Qd4+ Ke1
43. Rc1+ Qd1 44. Rxd1+ Ke2 45. Qd3+ Kf2 46. Rf1# 1-0 [/pgn]
Very short win against a stronger engine. And the moves 36. to 39. where Leorik sacrifices a rook to drive the black King out of hiding and towards his own pawns are kinda cool, right?

The interesting thing about Leorik 2.3 is that it's evaluation is now 100% based on tunable weights (~1500 values) and after reseting all weights Leorik learned to walk again from scratch by learning from selfplay games, only.
Previously I was using a 3rd party dataset of labeled positions for tuning the weights where Stockfish was involved in the labeling. This new approach doesn't require labeling anymore, the PGNs are the only input to the tuner. I thought Leorik finding his "own" style that way while keeping it's overall strength was worth a minor version bump.
I'm sadly not good enough a chess player to really judge the style of it's play but here's a game that caught my attention:
[pgn][Event "?"]
[Site "?"]
[Date "2022.12.21"]
[Round "160"]
[White "Leorik-2.3"]
[Black "Inanis-1.1.1"]
[Result "1-0"]
[ECO "A43"]
[Opening "Old Benoni defense"]
[TimeControl "40/30"]
[PlyCount "91"]
[GameDuration "00:01:02"]
[GameEndTime "2022-12-21T17:33:58.596 Mitteleuropäische Zeit"]
[GameStartTime "2022-12-21T17:32:56.517 Mitteleuropäische Zeit"]
1. d4 c5 2. dxc5 e6 3. Be3 Na6 4. Nf3 Nf6 5. Bd4 Bxc5 6. e3 Bxd4 7. Qxd4
O-O 8. Nc3 Qe7 9. Bxa6 bxa6 10. O-O Bb7 11. Ne5 d6 12. Nc4 Rfd8 13. Na5 e5
14. Qd3 Rac8 15. Rad1 Qc7 16. Nxb7 Qxb7 17. Rb1 Rc5 18. e4 Qc6 19. f3 h6
20. Rbd1 Rc4 21. Qe3 Rb8 22. Rb1 Rcb4 23. b3 Rc8 24. Na4 d5 25. c3 Rb7 26.
exd5 Nxd5 27. Qe4 Nxc3 28. Nxc3 Qb6+ 29. Kh1 Rxc3 30. Qxe5 Rc2 31. Rbc1
Rxa2 32. Rc8+ Kh7 33. Qe8 Qb5 34. Qg8+ Kg6 35. Rfc1 Qe2 36. R8c6+ f6 37.
Rxf6+ Kxf6 38. Rc6+ Kg5 39. Qd5+ Kf4 40. g3+ Ke3 41. Rc3+ Kf2 42. Qd4+ Ke1
43. Rc1+ Qd1 44. Rxd1+ Ke2 45. Qd3+ Kf2 46. Rf1# 1-0 [/pgn]
Very short win against a stronger engine. And the moves 36. to 39. where Leorik sacrifices a rook to drive the black King out of hiding and towards his own pawns are kinda cool, right?
There are no new features that would make it significantly stronger, only small fixes and the changed evaluation. But in my own tests it was about 40 Elo better. I hope it doesn't end up a regression over 2.2
The interesting thing about Leorik 2.3 is that it's evaluation is now 100% based on tunable weights (~1500 values) and after reseting all weights Leorik learned to walk again from scratch by learning from selfplay games, only.
Previously I was using a 3rd party dataset of labeled positions for tuning the weights where Stockfish was involved in the labeling. This new approach doesn't require labeling anymore, the PGNs are the only input to the tuner. I thought Leorik finding his "own" style that way while keeping it's overall strength was worth a minor version bump.
-
Dariusz
- Posts: 379
- Joined: Sat Jun 13, 2015 10:08 am
- Location: Poland
- Full name: Dariusz Domagała
Re: Leorik 2.3 Released
Indeed, a cool and nice style of game.
Right now Leorik 2.3 is playing its games in MCERL
Probably tomorrow or the day after tomorrow I will publish the next edition of this ranking list, which will also include the latest Leorik.
Thank you for this cool engine!
Right now Leorik 2.3 is playing its games in MCERL
Probably tomorrow or the day after tomorrow I will publish the next edition of this ranking list, which will also include the latest Leorik.
Thank you for this cool engine!
Regards, Darius
https://chessengeria.eu
https://chessengeria.eu
-
Wolfgang
- Posts: 989
- Joined: Sat May 13, 2006 1:08 am
Re: Leorik 2.3 Released
-
lithander
- Posts: 918
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Leorik 2.3 Released
I see you have added a NN sufix to the name? I'm not sure if that fits or not. I have weights and they are tuned using linear regression but there are no hidden layer. Each feature in a position is multiplied by the weight (the features centipawn score) and summed up. Eval = f0 * w0 + ... + fn * wn
The features are still very handcrafted. "A queen on e5" etc... For pawns I have more than 64 features e.g. the "a passed pawn on e6" would only be not zero if there is a pawn and it is indeed passed. Last but not least even mobility has become such a feature multiplied by a weight. There are 88 weights for features such as "A queen that has 14 moves".
That approach allows me to come up with just new features and the tuner then figures out how to weigh them in this long linear function so the evals prediction becomes better by minimizing the mean squared error of the eval on the prediction of outcomes of the games that were played in the PGN.
So it's nothing so complex like NNUE but you could say it counts as a very simple NN. Your choice if you keep the NN tag. I just thought I would supply some info on what the eval is actually doing.
-
lithander
- Posts: 918
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Leorik 2.3 Released
Since Christmas I'm the proud owner of a Raspberry Pi 400 and my Linux.ARM compile (made on Windows!) ran out of the box, after setting permissions.
The computer, consuming 5W only, is meant to give Leorik a permanent home on Lichess: LeorikBot will be online 24/7 and even though it's only performing at 400k nps instead of the usual 5M I'm excited to watch Leorik's career as an independent chess-playing entity!
Please give it some play!
The computer, consuming 5W only, is meant to give Leorik a permanent home on Lichess: LeorikBot will be online 24/7 and even though it's only performing at 400k nps instead of the usual 5M I'm excited to watch Leorik's career as an independent chess-playing entity!
Please give it some play!
-
Mike Sherwin
- Posts: 965
- Joined: Fri Aug 21, 2020 1:25 am
- Location: Planet Earth, Sol system
- Full name: Michael J Sherwin
Re: Leorik 2.3 Released
Nice!lithander wrote: ↑Mon Dec 26, 2022 1:51 pm Since Christmas I'm the proud owner of a Raspberry Pi 400 and my Linux.ARM compile (made on Windows!) ran out of the box, after setting permissions.
The computer, consuming 5W only, is meant to give Leorik a permanent home on Lichess: LeorikBot will be online 24/7 and even though it's only performing at 400k nps instead of the usual 5M I'm excited to watch Leorik's career as an independent chess-playing entity!
Please give it some play!![]()
Now just imagine if LeorikBot had after game reinforcement learning. The way it could work for UCI is to record the game moves. Then at the end of the game overlay the game moves onto a tree of previous games or if preferred a giant hash table. Every move of the winning side gets a small bonus at the root and the bonus gets bigger higher up in the tree. Every move of the losing side gets a small penalty at the root and the penalty gets bigger higher up in the tree. Draws get a tiny penalty for all moves. Before each search the appropriate subtree, if there is one, has its moves added to the search hash table while adjusting the scores in the hash table according to the RL scores. Everyone keeps saying RL is a book method and pooh pooh's all over it. It is not a book method when used in this way. It does not dictate a move. It only sways the search and may or may not change the move played. In the short term bad moves can get a bonus and good moves can get a penalty but in the long term they are corrected.
The advantage for the LiChess member playing LeorikBot is that LiorikBot will not be a static strength opponent that one would outgrow. And the advantage for LeorikBot is that LeorikBot will learn good human moves and thus play more like a human as time passes.
-
Guenther
- Posts: 4718
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: Leorik 2.3 Released
Bazillions of SF clones and SF modifications as opponents, as expected :(lithander wrote: ↑Mon Dec 26, 2022 1:51 pm Since Christmas I'm the proud owner of a Raspberry Pi 400 and my Linux.ARM compile (made on Windows!) ran out of the box, after setting permissions.
The computer, consuming 5W only, is meant to give Leorik a permanent home on Lichess: LeorikBot will be online 24/7 and even though it's only performing at 400k nps instead of the usual 5M I'm excited to watch Leorik's career as an independent chess-playing entity! :)
Please give it some play! :)
-
carldaman
- Posts: 2287
- Joined: Sat Jun 02, 2012 2:13 am
Re: Leorik 2.3 Released
He might try to disallow challenges from other BOTs, although that may mean (far) fewer games.
That's what I did with Nezh-BOT, anyway.
That's what I did with Nezh-BOT, anyway.