NNUE Research Project

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

Moderators: hgm, Rebel, chrisw

chrisw
Posts: 4317
Joined: Tue Apr 03, 2012 4:28 pm

Re: NNUE Research Project

Post by chrisw »

xr_a_y wrote: Thu Mar 11, 2021 3:42 pm
chrisw wrote: Thu Mar 11, 2021 12:58 pm
xr_a_y wrote: Thu Mar 11, 2021 12:09 pm What is called "Minic" here is a net if I understand well. But is it "Napping Nexus" or "Nascent Nutrient" ?
The first one is based on SF data, the second on Minic (the engine) ones.
Ed can answer, because the names listed are the filenames he used to save the data. I think, not entirely sure, he took NNs and ran them within SF12 and SF13, ie he’s trying to compare nets not search. There seem to be three mimic connected nets, which he called Minic, nascent and nexus. Does that figure?
ok I missed the "nexus" and "nascent" in here. So my guess is that the net called "Minic" here is something else. Maybe the good SV net I was using at first.
Ah, yes, thanks, that’s how I thought it was, but good to confirm.

Can you detail a little on how nexus and nascent were trained, net characteristics and so on? I try to build up some anecdotal data points on net character against our RMS and pearsonr results.
chrisw
Posts: 4317
Joined: Tue Apr 03, 2012 4:28 pm

Re: NNUE Research Project

Post by chrisw »

David Carteau wrote: Thu Mar 11, 2021 1:16 pm
Rebel wrote: Wed Mar 10, 2021 9:29 pm NNUE Research Project
March 10, 2021

(...)

http://rebel13.nl/home/nnue.html
That's an interesting initiative, thank you !

Just to say few words about Orion 0.7 (the site states that "Orion 0.7 - From the information on the website the nnue origin of version 0.7 is unclear, the RMS implies a strong correlation with SF12.") : the site should mention "Orion 0.7 NNUE" and not "Orion 0.7".

In fact, "Orion 0.7" embeds a traditional hand-crafted evaluation function, the latter being entirely replaced by the NNUE network of SF12 (hence the high similarity observed) during my experiments to implement my own NNUE inference code. The resulting "experimental" version of Orion was then named "Orion 0.7 NNUE".

Kind regards from France ;)
Thanks! When Ed sends me more data (including Orion results) which I don’t have, I’ll add them to the list. Presumably v0.7 will give high pearsonr and v0.8 low?
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: NNUE Research Project

Post by xr_a_y »

chrisw wrote: Thu Mar 11, 2021 4:09 pm
xr_a_y wrote: Thu Mar 11, 2021 3:42 pm
chrisw wrote: Thu Mar 11, 2021 12:58 pm
xr_a_y wrote: Thu Mar 11, 2021 12:09 pm What is called "Minic" here is a net if I understand well. But is it "Napping Nexus" or "Nascent Nutrient" ?
The first one is based on SF data, the second on Minic (the engine) ones.
Ed can answer, because the names listed are the filenames he used to save the data. I think, not entirely sure, he took NNs and ran them within SF12 and SF13, ie he’s trying to compare nets not search. There seem to be three mimic connected nets, which he called Minic, nascent and nexus. Does that figure?
ok I missed the "nexus" and "nascent" in here. So my guess is that the net called "Minic" here is something else. Maybe the good SV net I was using at first.
Ah, yes, thanks, that’s how I thought it was, but good to confirm.

Can you detail a little on how nexus and nascent were trained, net characteristics and so on? I try to build up some anecdotal data points on net character against our RMS and pearsonr results.
napping nexus (09/2020) : a Stockfish data based net build in many steps from 2 billions depth 10 data. Data are from Stockfish genfen. Learner used is the Nodchip repository one. Validation data are 1M depth 16 and 20 Stockfish data. With this net, MinicNNUE is around 100Elo weaker than with SV net.

nascent nutrient (10/2020) : a Minic data based net build from 400M random positions evaluated by Minic at depth 12. Data were generated using the Minic genfen feature and Minic random mover. The learner merged inside Minic is used in order to ensure Minic evaluation is used. Validation data are 1M depth 16 Minic data extracted from Minic2.48 games in pgn format. No RL with game outcome for this net. With this net, MinicNNUE is around 100Elo weaker than with napping nexus.
connor_mcmonigle
Posts: 530
Joined: Sun Sep 06, 2020 4:40 am
Full name: Connor McMonigle

Re: NNUE Research Project

Post by connor_mcmonigle »

chrisw wrote: Thu Mar 11, 2021 11:06 am
connor_mcmonigle wrote: Thu Mar 11, 2021 1:19 am Interesting results. If you're just directly applying RMSE to the raw low depth evaluations, you're likely picking up mostly on the scale of the evaluation rather than the uniqueness of the evaluations (which could explain the high similarity of the FF2 net assuming ChessBase's claims about its origins are true). A number of engines scale the output of the network to best match the evaluation scale expected by their search (static null move pruning conditions, etc.). To resolve this, I'd suggest first standardizing (subtract mean and divide by variance) the evaluation distributions to Normal(0, 1) before the taking RMSE. This metric should better correspond to what we mean by a unique evaluation function.
Yup, quite so. When we ran the results, I also programmed in the pearsonr, which I think basically does a scale and translate (slope and intercept) on the data and then measures the deviations. It wasn’t presented on Ed’s result page because last time I tried presenting pearsonr data it just got grunted at, but actually it’s probably a rather fine similarity measure for CC evals.
For example, two nets where one uses (in effect) 13359 for material and the other 2, 6, 6, 10, 18 are basically identical, but RMS won’t tell you. Pearsonr will.

I have only a subset of Ed's data, but here's an inverse sorted list of engine pairs with pearsonr.
0.94, 0.95 and above looks to be the value where quite strong net similarity shows up.

Code: Select all

Pearson r, RMS, engine pair
======================
0.838 108.6 SF12-Igel-280 v SF12-nexus
0.854 105.8 SF12-Igel-270 v SF12-nexus
0.856 104.6 SF12-Igel-280 v SF12-nn-516f5b95189a
0.858 80.5 SF12-nn-803c91ad5c v _SF13
0.858 108.6 SF12-Igel-280 v SF12
0.859 104.7 SF12-Igel-280 v SF12-Minic
0.86 79.5 SF12-nn-803c91ad5c v SF13
0.864 93.7 SF12-nn-803c91ad5c v SF12
0.865 111.1 SF12-Igel-280 v _SF12
0.868 95.5 SF12-nn-803c91ad5c v _SF12
0.868 100.1 SF12-Igel-280 v SF12-nn-dd0c4c630f7e
0.87 101.2 SF12-Igel-280 v SF12-nn-0c6fc5ef48e1
0.871 89.1 SF12-Minic v SF12-nn-803c91ad5c
0.872 105.9 SF12-Igel-270 v SF12
0.873 101.9 SF12-Igel-270 v SF12-Minic
0.874 87.6 SF12-Igel-280 v SF13
0.875 88.5 SF12-Igel-280 v _SF13
0.875 108.8 SF12-Igel-270 v _SF12
0.875 88.1 SF12-nn-516f5b95189a v SF12-nn-803c91ad5c
0.875 101.3 SF12-Igel-270 v SF12-nn-516f5b95189a
0.876 60.7 SF12-nn-803c91ad5c v _FF2
0.881 93.0 SF12-Minic v SF12-nascent
0.883 96.0 SF12-nascent v SF12
0.884 97.3 SF12-Igel-270 v SF12-nn-dd0c4c630f7e
0.885 79.0 SF12-nascent v _SF13
0.885 84.6 SF12-nn-0c6fc5ef48e1 v SF12-nn-803c91ad5c
0.885 83.4 SF12-nn-803c91ad5c v SF12-nn-dd0c4c630f7e
0.886 78.0 SF12-nascent v SF13
0.886 98.3 SF12-Igel-270 v SF12-nn-0c6fc5ef48e1
0.886 85.0 SF12-Igel-270 v SF13
0.886 98.4 SF12-nascent v _SF12
0.887 86.0 SF12-Igel-270 v _SF13
0.89 91.0 SF12-nascent v SF12-nn-516f5b95189a
0.891 85.5 SF12-nexus v SF12-nn-803c91ad5c
0.892 76.2 SF12-nexus v _SF13
0.892 76.5 SF12-nexus v SF13
0.894 91.7 SF12-nascent v SF12-nexus
0.895 62.7 SF12-Igel-280 v _FF2
0.895 88.7 SF12-nascent v SF12-nn-0c6fc5ef48e1
0.895 53.6 SF12-Igel-280 v SF12-nn-803c91ad5c
0.898 78.9 SF12-nexus v _FF2
0.9 51.9 SF12-Igel-270 v SF12-nn-803c91ad5c
0.901 56.1 SF12-nascent v _FF2
0.901 86.3 SF12-nascent v SF12-nn-dd0c4c630f7e
0.902 60.6 SF12-Igel-270 v _FF2
0.905 75.4 SF12-nexus v _SF12
0.905 74.6 SF12-nexus v SF12
0.915 46.1 SF12-nascent v SF12-nn-803c91ad5c
0.916 69.3 SF12-Minic v SF12-nexus
0.922 66.1 SF12-nexus v SF12-nn-dd0c4c630f7e
0.923 65.8 SF12-nexus v SF12-nn-0c6fc5ef48e1
0.923 39.3 SF12-Igel-280 v SF12-nascent
0.925 38.6 SF12-Igel-270 v SF12-nascent
0.925 65.7 SF12-nexus v SF12-nn-516f5b95189a
0.928 69.6 SF12-Minic v _FF2
0.929 72.2 SF12 v _FF2
0.934 73.4 _FF2 v _SF12
0.934 60.6 SF12-Minic v SF13
0.934 67.4 SF12-nn-516f5b95189a v _FF2
0.935 59.6 SF12-Minic v _SF13
0.935 64.8 SF12-nn-dd0c4c630f7e v _FF2
0.938 65.0 SF12-nn-0c6fc5ef48e1 v _FF2
0.939 56.9 SF12-nn-dd0c4c630f7e v SF13
0.94 59.9 SF12 v SF13
0.941 61.0 SF13 v _SF12
0.941 58.8 SF12 v _SF13
0.942 55.5 SF12-nn-dd0c4c630f7e v _SF13
0.943 56.4 SF12-nn-516f5b95189a v SF13
0.944 55.7 SF12-nn-516f5b95189a v _SF13
0.945 58.9 _SF12 v _SF13
0.945 54.7 SF12-nn-0c6fc5ef48e1 v SF13
0.947 55.1 SF12-Minic v SF12-nn-516f5b95189a
0.947 54.8 SF12-Minic v SF12-nn-0c6fc5ef48e1
0.947 51.8 SF13 v _FF2
0.947 54.2 SF12-Minic v SF12-nn-dd0c4c630f7e
0.948 53.2 SF12-nn-0c6fc5ef48e1 v _SF13
0.948 55.0 SF12-nn-516f5b95189a v SF12
0.949 55.3 SF12-nn-516f5b95189a v _SF12
0.951 53.6 SF12-nn-0c6fc5ef48e1 v SF12
0.951 50.9 _FF2 v _SF13
0.952 52.8 SF12-nn-dd0c4c630f7e v SF12
0.954 26.1 SF12-Igel-270 v SF12-Igel-280
0.954 52.7 SF12-nn-dd0c4c630f7e v _SF12
0.954 52.6 SF12-Minic v _SF12
0.955 51.3 SF12-Minic v SF12
0.955 52.2 SF12-nn-0c6fc5ef48e1 v _SF12
0.956 49.7 SF12-nn-516f5b95189a v SF12-nn-dd0c4c630f7e
0.959 47.8 SF12-nn-0c6fc5ef48e1 v SF12-nn-516f5b95189a
0.96 47.0 SF12-nn-0c6fc5ef48e1 v SF12-nn-dd0c4c630f7e
0.975 33.9 SF13 v _SF13
0.977 37.4 SF12 v _SF12

(Just noticed I typed variance instead of sqrt variance in my original post. Whoops)

Ahh. Cool. Thanks for the information. Surprising that with standardization, we see that the FF2 network is of even greater similarity to the master SF network than even different nets from SV's training run... Hmm

Anyhow, I'm a little confused as to how the data is being presented on Ed's website. Are all the nets in Ed's test run inside SF? I don't see how this can be the case given Orion 0.8 is listed which, to the best if my knowledge, uses an incompatible file format. Same for Minic which now is using a somewhat modified version of Seer's network architecture and inference code which is definitely incompatible (weights aren't even quantized and topology differs).

In the case of Orion 0.8 and Seer v1.2.1, as both use a network trained on Stockfish's evaluation, but original training code and inference code, it would be interesting to see how similar their static evals are. I have some new networks intended for Seer v1.3 trained from "zero" using all original code and Seer's search only. I know David has been working on something similar so it would be quite interesting to test these nets as well for comparison and to establish a similarity threshold for network training data originality when using different training code+inference code.
David Carteau
Posts: 121
Joined: Sat May 24, 2014 9:09 am
Location: France
Full name: David Carteau

Re: NNUE Research Project

Post by David Carteau »

connor_mcmonigle wrote: Thu Mar 11, 2021 4:26 pm Anyhow, I'm a little confused as to how the data is being presented on Ed's website. Are all the nets in Ed's test run inside SF? I don't see how this can be the case given Orion 0.8 is listed which, to the best if my knowledge, uses an incompatible file format. Same for Minic which now is using a somewhat modified version of Seer's network architecture and inference code which is definitely incompatible (weights aren't even quantized and topology differs).
Yes, I confirm that Orion 0.8 network has a different architecture than SF's one (mainly half number of parameters, and weights encoded as floats instead of integers).
connor_mcmonigle wrote: Thu Mar 11, 2021 4:26 pm In the case of Orion 0.8 and Seer v1.2.1, as both use a network trained on Stockfish's evaluation, but original training code and inference code, it would be interesting to see how similar their static evals are.
Very nice idea, and maybe a good way to measure the impact/efficiency of architecture or training method ?
connor_mcmonigle wrote: Thu Mar 11, 2021 4:26 pm I have some new networks intended for Seer v1.3 trained from "zero" using all original code and Seer's search only. I know David has been working on something similar (...).
Yes, I'm currently trying the "zero" approach, but I'm struggling with the second step of the process : I successfully trained a net based on a pure material evaluation function (~2150 elo), but when using this net as the new eval function, I'm failing to train a stronger new net. I restarted the process with more positions (32M instead of 16M), always searched at depth 8, but evaluating this (small) dataset is really long (~2 weeks). So, no major progress expected before a few... months ?!
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: NNUE Research Project

Post by Rebel »

Regarding the questions, I compiled a download with all the epd files at http://rebel13.nl/nnue-epd.7z

Contents:

Code: Select all

11-03-2021  19:58    <DIR>          .
11-03-2021  19:58    <DIR>          ..
11-03-2021  19:54    <DIR>          ff2
04-03-2021  08:59           647.686 Nemorino.epd
09-03-2021  22:18           644.556 Orion_0.8.epd
08-03-2021  12:18           649.858 SF12-Igel-270.epd
08-03-2021  12:35           649.635 SF12-Igel-280.epd
08-03-2021  21:18           652.073 SF12-Igel-290.epd
08-03-2021  12:53           652.728 SF12-Minic.epd
08-03-2021  13:11           653.371 SF12-napping-nexus.epd
08-03-2021  13:29           650.594 SF12-nascent-nutrient.epd
09-03-2021  11:03           652.710 SF12-Orion_0.7.epd
08-03-2021  13:46           652.583 SF12-sf-0c6fc5ef48e1.epd
08-03-2021  17:44           652.711 SF12-sf-516f5b95189a.epd
08-03-2021  17:27           652.513 SF12-sf-dd0c4c630f7e.epd
09-03-2021  09:40           652.457 SF12-sv-20200720-1017.epd
09-03-2021  10:00           652.411 SF12-sv-20200721-0909.epd
09-03-2021  10:20           652.651 SF12-sv-20200721-1432.epd
09-03-2021  10:38           652.882 SF12-sv-20200906-1046.epd
09-03-2021  10:56           652.892 SF12-sv-20200908-1733.epd
09-03-2021  11:15           652.759 SF12-sv-20200914-1520.epd
08-03-2021  11:43           652.698 SF12.epd
08-03-2021  21:35           651.330 SF13-Igel-290.epd
08-03-2021  23:30           652.440 SF13-Rubi-2.01.epd
09-03-2021  09:06           651.983 SF13-sf-6b7a4192c303.epd
09-03-2021  09:26           651.878 SF13-sf-94816594b327.epd
08-03-2021  12:01           652.459 SF13.epd
Remarks:
1. nets are tested as much as possible with SF12 and SF13.
2. Nemorino and Orion 0.8 are the exceptions since they have a different file format.
3. The Orion 0.7 version has the exact SF12 net.
4. the folder ff2 contains the epd's of sf12, 13 and ff2 at 100ms, 250 and 500ms, made by someone else on a different pc.
5. epd's labelled with "sv" are the tested "sergio" nets.
6. epd's labelled with "sf" are Stockfish nets.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: NNUE Research Project

Post by xr_a_y »

I think what is called Minic here is probably in fact a SV net?

nn-97f742aaefcd.nnue probably (see http://rebel13.nl/speedy.html)

Or is it Minic HCE? No it can't have a SIM of 72, no way. Must be MinicNNUE+SV net.

So the high similarity of what you call "Minic", that is in fact MinicNNUE+sv net..., is very logical, as this net is probably quite close to the SF12 one.

Really, naming convention here matters, be careful please. I don t think the text of your analysis about Minic in the web page is accurate enough.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: NNUE Research Project

Post by Rebel »

xr_a_y wrote: Thu Mar 11, 2021 9:30 pm I think what is called Minic here is probably in fact a SV net?

nn-97f742aaefcd.nnue probably (see http://rebel13.nl/speedy.html)

Or is it Minic HCE? No it can't have a SIM of 72, no way. Must be MinicNNUE+SV net.

So the high similarity of what you call "Minic", that is in fact MinicNNUE+sv net..., is very logical, as this net is probably quite close to the SF12 one.

Really, naming convention here matters, be careful please. I don t think the text of your analysis about Minic in the web page is accurate enough.
Vivien, apologies, let's fix it. I think you are right.

I checked again and at the time (about 6 months ago) I actually tested 2 Minic version 2.48 and 2.50, links:
2.48 - http://rebel13.nl/speedy.html
2.50 - http://rebel13.nl/download/srl-1000.html

Both use the same net - 97f742aaefcd, actively tested here - http://talkchess.com/forum3/search.php? ... f742aaefcd

The webpage states:

3. Minic - we learn from its website the author in the beginning used Stockfish NNUE but later moved to an own net, it could explain our finding with the similar RMS to Stockfish.

How would you like me to change the text?
90% of coding is debugging, the other 10% is writing bugs.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: NNUE Research Project

Post by xr_a_y »

Ok good to know this was a good sv net. Thanks.

To clarify, it will be helpful to call those Minic2.46 to 2.53 MinicNNUE+named net, if a net is being used.

I only really "assume" nnue technology starting from Minic 3.00 where the implementation was switchd to Seer one and architecture is not the same as SF at all. Now in the next Minic 3.05 to come, supported net has even diverged from Seer architecture.

To go back on the very high similarity here, I think we already discuss that back in September. We conclude evaluation, so here net in used, is much more important than search in similarity testing. So using here a SF data based net is clearly leading to high similarity. On the contrary, looking at a Minic data net (but still using the same architecture as the SF one) namely nascent nutrient, we get a smaller similarity.

So whatever the search is, seeing nets that have high similarity with SF probably indicates SF data were used to build the net.
dkappe
Posts: 1631
Joined: Tue Aug 21, 2018 7:52 pm
Full name: Dietrich Kappe

Re: NNUE Research Project

Post by dkappe »

Rebel wrote: Thu Mar 11, 2021 9:05 pm ...
The Igel nets at that time were Night Nurse 0.1 and 0.2b. They were trained from Bad Gyal data.
Fat Titz by Stockfish, the engine with the bodaciously big net. Remember: size matters. If you want to learn more about this engine just google for "Fat Titz".