Invitation to play Leorik as a human player

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
lithander
Posts: 912
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Invitation to play Leorik as a human player

Post by lithander »

Today I uploaded a bunch of networks here that range from only 1 neuron to 1024 in the hidden layer.

As this graph shows doubling the amount of neurons improves the accuracy of the networks and provides about 100 Elo each time. The smallest network however with just one neuron is essentially a Piece-Square-Table, not even a tapered one. It provides only the most rudimentary evaluation for a position.

Image

I think now there are three ways for humans to reduce the playing strength and I would like to invite you to combine them and try a match against him and tell me how that felt compared to e.g. the weak bots on chess.com. (I'm sadly only a 600 Elo player myself)

If you want to give it a try download Leorik 3.1 from github then replace the network that came with the downloaded version with one of the smallest networks (maybe start with 1-Neuron even) and when you setup the engine for play in your GUI set the UCI option Temperature to 100-200 (which will give each root move a random bias in centipawns) and then limit the Nodes to ~20000 in the time control settings. Now it should play always instantly while you can give yourself a larger time budget! Let me know if you found Leorik fun to play and how changing the three parameters influenced his style.

(without any of the modifications Leorik is around ~3400 Elo)
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
chesskobra
Posts: 347
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Invitation to play Leorik as a human player

Post by chesskobra »

This is interesting to a lot of people who are looking for a sane way to adjust playing levels. I have one question. I downloaded the pre-compiled linux binary. It seems that the default network is compiled into the binary. So if I want to use another network, do I have to compile the engine with another network? In xboard options, I didn´t see a way to just change the network file. In that case, could you please give compilation instructions. I have never compiled C# and use only linux.
User avatar
lithander
Posts: 912
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Invitation to play Leorik as a human player

Post by lithander »

The download should contains 3 files! The one with the file ending nnue is the network file and you can just replace it with a different one from the separate download i linked. Make sure theres always only one network file in the same folder as the executable. No need to compile anything. The engine only supports the UCI protocol though. No xboard!
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
User avatar
lithander
Posts: 912
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Invitation to play Leorik as a human player

Post by lithander »

I just updated the released binaries on github from 3.1.2 to 3.1.3 and if you want to use the small networks with less than 16 neurons in the hidden layer you should re-download or update&recompile your executable and make sure it's version 3.1.3!

For everyone else there's no difference between the two versions!
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
chesskobra
Posts: 347
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Invitation to play Leorik as a human player

Post by chesskobra »

I am planning to set this up. In the zip file of the latest release (3.1.3), there is the network

Code: Select all

./Leorik 3.1 Linux/640HL-S-5288M-Tmix-Q5-v19.nnue
and in the zip file of the networks, there is

Code: Select all

./Leorik 3.1 Networks/640HL-S-5732M-Tmix-Q5-v19.nnue
The two have the same size. Are they the same? Also, the largest is

Code: Select all

./Leorik 3.1 Networks/1024HL-S-5732M-Tmix-Q5-v19.nnue
Why is it not the default?
User avatar
lithander
Posts: 912
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Invitation to play Leorik as a human player

Post by lithander »

chesskobra wrote: Mon Apr 21, 2025 9:20 pm The two have the same size. Are they the same?
They have the same size but are not the same. The naming scheme works like this:
  • 640HL means 640 neurons in the hidden layer
  • S indicates SCReLU activation
  • 5732M means it was trained on 5.7 Billion labeled positions
  • Tmix mixed temperature, some of the played games these positions were derived from had a randomness factor
  • Q5 some positions were noisy (e.g. best move was capture) but where made quiet by backpropagating the leaf-node of a q-search of up to depth 5
  • v19 a network from the 19th generation of selfplay which means all positions in the trainingdata are from selfplay with nets of v18 and below
...so the difference is that the one from the zip was trained on half a billion more positions.
chesskobra wrote: Mon Apr 21, 2025 9:20 pm Also, the largest is

Code: Select all

./Leorik 3.1 Networks/1024HL-S-5732M-Tmix-Q5-v19.nnue
Why is it not the default?
It was trained after the release of 3.1 and as the graph shows it's only +10 Elo stronger than the 512 HL. Basically the 640HL, 768HL and 1024HL networks are almost equal in strength. This is because the runtime cost of inference doubles when you double the size but the accuracy gains more neurons provide have diminishing returns. So bigger is not automatically better, but if you want the strongest Leorik and play on LTC then the 1024 is probably the strongest choice.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess