Koivisto 5.0

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

Moderators: hgm, Rebel, chrisw

Luecx
Posts: 138
Joined: Thu Jun 18, 2020 9:20 pm
Full name: Finn Eggers

Koivisto 5.0

Post by Luecx »

It has been a long time since we released Koivisto 4.0 and many things happened since. We are actively developing Koi while not wanting Koivisto to be tested by third parties who also list obvious clones which makes the ratings increditable.

We dislike the popularity of neural networks inside chess engines, not because we do not understand how they work but mostly those who use them seem to not understand what they are actually doing.
Using neural networks does not require any understanding of chess which you would need when writing a hand-crafted-evaluation or as we like to refer to: real-men-evaluation (RME). Using neural networks became more of an engineering challenge than anything else. 3 components are required for them which is: a good tuner, good data, good engine implementation. Since a good tuner requires some understanding of how they work, most engines out there seem to be using other peoples tuners. Effectively there are just a few tuners out there but a lot more NN engines. Secondly, generating data seems to be a privilege to the big projects which gather computing resources around them. The easiest part is probably the NN implementation inside the engines themself although even here many people seem to ctrl+c, ctrl+v popular implementations.

Since we personally work with neural networks beside chess engine development, we decided to write our own tuner... from scratch... We already did this a few months ago but just a few days ago we decided to give it a shot and actually tune a few networks. We generated around 1.5M selfplay-games with Koivisto, extracted a few positions and initially ended up with around 50M positions. Later we realised, the filtering mechanism we applied was bad and simply wrong. This lead to a neural network which beat our master branch by just 40 elo. Since there are other parties helping out with Koivisto like @justNo4b who generated some data with Drofa himself, he used the tuner and generated a network which was suddenly +80 elo above master.

The result seemed slightly surprising so we rechecked the data generation and filtering and found a bug. After redoing the training process which barely took one hour, we tested a new network which showed the following result:

Code: Select all

ELO   | 103.93 +- 5.74 (95%)
CONF  | 10.0+0.10s Threads=1 Hash=16MB
GAMES | N: 10240 W: 5019 L: 2044 D: 3177
A network trained on 100M positions of Ethereal data provided by Andrew Grant was ~150 elo above master.

Koivisto, while standing on the shoulder of giants, has implemented many of it's own specialities to both search and classical eval on top of well known concepts. We are now taking the path of the sloth, and replacing our beloved RME with a silly neural network. We want to maintain our distance from other engines, so it was important that our NN development kept the same 'koivisto touch' that we already had before. All three aspects of our development have been done internally and are our own. We have written our own trainer, generated our own data, and have our own NN probing code. We strive to be as original as possible, and will not veer from this path moving forward.

Generation of higher quality data is going on and might lead to additional elo being gained here. Since the NN branch in our project started as a small test to verify the integrity of our NN tuner, we have choosen a very simple, non-relative, 2-layer, 12x64-input network. A new topology is high on our list since we do consider the topology to be very far from optimal.

Beside the addition of neural network code inside Koivisto, we have 83 further elo gaining patches since 4.0. Many RME patches have been going on which are eventually invalidated. More to that later. Our search has also made a lot of progress. Adding further unique ideas not found in any other engine so far, we gained a large amount of elo inside our search since then.

Together with the neural network code, our results look similar to this against Koivisto 4.0.

Code: Select all

ELO   | 367.3 +- 30.5 (95%)
CONF  | 10.0+0.10s Threads=1 Hash=16MB
GAMES | N: 919 W: 767 L: 46 D: 106
Due to the size of the network, we will keep the networks seperate in a submodule of our repository. Further information can be found on our github page. Furthermore, the only compile we offer are AVX2 compiles. Any machine which does not support AVX2 will not be able to run Koivisto games from now on.

Beside Koivisto 5.0 being released, we will also ship binaries for 4.83. Since many people, especially Berserk author has helped with our classical evaluation, we want to make a final release which marks the end of development for RME inside Koivisto.

https://github.com/Luecx/Koivisto/releases/tag/v5.0

------

We want to thank all the contributors to the project, especially Berserk author for his massive contribution to our search and the classical evaluation, @justNo4b for helping and supporting us with various topics and helping with the training of neural networks, Andrew Grant for the many discussions we had to improve parts of the code, sharing scripts and many more. Beside that we thank the official OpenBench discord with all its members (especially noobpwnftw) for answering any question we have as soon as possible and supporting us whenever possible. We also want to thank the author of Seer for offering us to share training resources and giving us ideas for training our classical as well as our neural network evaluation.
The ability to speak does not make you intelligent. https://github.com/Luecx/Koivisto

Image
Damir
Posts: 2801
Joined: Mon Feb 11, 2008 3:53 pm
Location: Denmark
Full name: Damir Desevac

Re: Koivisto 5.0

Post by Damir »

Very good. We need more strong chess engines. As the nnue networks keep improving we will see many other strong chess engines in the future. And if you can develop a nnue network that is original and not based on Stockfish network all the better. :) :)
User avatar
CMCanavessi
Posts: 1142
Joined: Thu Dec 28, 2017 4:06 pm
Location: Argentina

Re: Koivisto 5.0

Post by CMCanavessi »

Awesome progress!!!

Do you have plans to implement FRC support?
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls
Luecx
Posts: 138
Joined: Thu Jun 18, 2020 9:20 pm
Full name: Finn Eggers

Re: Koivisto 5.0

Post by Luecx »

CMCanavessi wrote: Wed Jul 07, 2021 9:07 pm Awesome progress!!!

Do you have plans to implement FRC support?
I am considering to fully rewrite the entire move-generation/board class which might ship FRC support. But currently this is not at the very top of our todo-list :)
The ability to speak does not make you intelligent. https://github.com/Luecx/Koivisto

Image
User avatar
Graham Banks
Posts: 41423
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Koivisto 5.0

Post by Graham Banks »

Nice progress, Finn and team. :)
gbanksnz at gmail.com
Jim Logan
Posts: 72
Joined: Thu Mar 09, 2006 4:14 am
Location: Nevada, USA

Re: Koivisto 5.0

Post by Jim Logan »

Could you help Mr. Blind as a Bat (me) find the NNUE file? How large is it?
jhonnold
Posts: 117
Joined: Wed Feb 17, 2021 3:16 pm
Full name: Jay Honnold

Re: Koivisto 5.0

Post by jhonnold »

Jim Logan wrote: Thu Jul 08, 2021 1:16 am Could you help Mr. Blind as a Bat (me) find the NNUE file? How large is it?
Here is a link to download it.

You can find their nets at their KoivistoNetworks repository.
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Koivisto 5.0

Post by mvanthoor »

Congratulations on the progress, but...

You islike neural networks, because they suspect other people are using them to make their engines stronger, withoutu actually knowing what those other people are doing.
Luecx wrote: Wed Jul 07, 2021 8:24 pm We dislike the popularity of neural networks inside chess engines, not because we do not understand how they work but mostly those who use them seem to not understand what they are actually doing.
You dislike neural networks with regard to chess, because you can implement and use them without actually understanding anything about chess.
Using neural networks does not require any understanding of chess which you would need when writing a hand-crafted-evaluation or as we like to refer to: real-men-evaluation (RME). Using neural networks became more of an engineering challenge than anything else.
Also you: *replaces HCE/RME with a neural network*
We are now taking the path of the sloth, and replacing our beloved RME with a silly neural network.
That makes my brain explode. Are you after the Elo points only? Why don't you try to become the strongest engine with HCE on the planet?

I understand the "use without understanding" gripe. I have some suspicions myself, because during my test runs (even my engine is still only in the 2150 Elo range), I'm encountering many engines that need LOTS more features and evaluation terms to reach their rating than I needed. Therefore I suspect these engines to just "grab features" from all around, without testing if they are getting the maximum benefit after they copy/paste or re-implement them.

It's the reason why my engine progresses so slowly, because I implement everything from scratch (and only after I completely understand it), and test everything by running thousands of games. Even though I'm going this slowly, I'm _still_ finding some optimizations (speed, time control), that left about 40-50 Elo lying around. If you're not completely understand the code you're working with, you can't make such optimizations, and you'll lose (or, maybe more accurately, waste) playing strength left and right.

Maybe, at some point, I'll look into neural networks myself, but for now, I know that an 3200 Elo on a single thread with HCE is possible, so that's what I'll try to reach first. Then I'll see if I even keep developing, beyond adding Lazy SMP, which I'll only be considering at around 3000 Elo. (Assuming I'll even _reach_ 3000 Elo with the fairly low amount of time I'm spending on this.)
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
AndrewGrant
Posts: 1753
Joined: Tue Apr 19, 2016 6:08 am
Location: U.S.A
Full name: Andrew Grant

Re: Koivisto 5.0

Post by AndrewGrant »

mvanthoor wrote: Thu Jul 08, 2021 3:41 am That makes my brain explode. Are you after the Elo points only? Why don't you try to become the strongest engine with HCE on the planet?
Luecx wrote: Wed Jul 07, 2021 8:24 pm The result seemed slightly surprising so we rechecked the data generation and filtering and found a bug. After redoing the training process which barely took one hour, we tested a new network which showed the following result:

Code: Select all

ELO   | 103.93 +- 5.74 (95%)
CONF  | 10.0+0.10s Threads=1 Hash=16MB
GAMES | N: 10240 W: 5019 L: 2044 D: 3177
A network trained on 100M positions of Ethereal data provided by Andrew Grant was ~150 elo above master.
I think you missed the point of his posting. If he wanted elo, he would just do what others have done and either used the SF implementation, or at least their data, and almost certainly their trainer. If he just wanted elo, he would have merged the Ethereal net above instead. Instead, he rejected the net even though it was stronger, because it was not HIS data, even though HE trained it and HIS engine runs it.

People will one day regret their gravity towards homogeneity.

-----

Congrats on the release, KoiBois. First of may elo gaining Networks to come. Hopefully soon we can welcome Koivisto into the upper tiers of events and rating lists, joining Stockfish, Ethereal, and Seer, and the mutual, but independent pursuits of NN technology.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: Koivisto 5.0

Post by Daniel Shawul »

Luecx wrote: Wed Jul 07, 2021 8:24 pm It has been a long time since we released Koivisto 4.0 and many things happened since. We are actively developing Koi while not wanting Koivisto to be tested by third parties who also list obvious clones which makes the ratings increditable.

We dislike the popularity of neural networks inside chess engines, not because we do not understand how they work but mostly those who use them seem to not understand what they are actually doing.
Using neural networks does not require any understanding of chess which you would need when writing a hand-crafted-evaluation or as we like to refer to: real-men-evaluation (RME). Using neural networks became more of an engineering challenge than anything else. 3 components are required for them which is: a good tuner, good data, good engine implementation. Since a good tuner requires some understanding of how they work, most engines out there seem to be using other peoples tuners. Effectively there are just a few tuners out there but a lot more NN engines. Secondly, generating data seems to be a privilege to the big projects which gather computing resources around them. The easiest part is probably the NN implementation inside the engines themself although even here many people seem to ctrl+c, ctrl+v popular implementations.

Since we personally work with neural networks beside chess engine development, we decided to write our own tuner... from scratch... We already did this a few months ago but just a few days ago we decided to give it a shot and actually tune a few networks. We generated around 1.5M selfplay-games with Koivisto, extracted a few positions and initially ended up with around 50M positions. Later we realised, the filtering mechanism we applied was bad and simply wrong. This lead to a neural network which beat our master branch by just 40 elo. Since there are other parties helping out with Koivisto like @justNo4b who generated some data with Drofa himself, he used the tuner and generated a network which was suddenly +80 elo above master.
....
The arrogance in this post is unbearable. You know a simple I released a new version of my engine will do.
One question: Why didn't you stick to your "real men evaluation" and leave NNs to those who don't understand them as you so claimed ?