A random walk down NNUE street ….

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

Moderators: hgm, Rebel, chrisw

User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

A random walk down NNUE street ….

Post by MikeB »

A random and somewhat rambling walk down NNUE street ...

We all know what NNUE means now or perhaps it would be more accurate to say NNUE means something to each of us, but perhaps different for each of us.. I still remember reading Larry Kaufman’s post, the “The Stockfish of Shogi” about how a programmer in Japan , using Stockfish search and neural network, was quickly developing one the strongest shogi engines in the world.

Larry has been my good friend for many, many years dating back to the ICD chess reports in the 1980’s that he, along with the sponsor of this website “You Move Chess and Games”, then commonly known as ICD/Chess, were issuing chess reports periodically , sometimes quarterly, sometimes yearly. Those articles written 30 years ago are just as interesting to read now as they were then. The Mephisto 68030 was my dream machine and I was fortunate to have one for many years before my good friend SteveB ( and his always regards signoffs) orchestrated a 3-way deal , he got my Mephisto 68030 and I ended up with TASC R30. Overall, a pretty good deal for both of us.

And I distinctly remember thinking, how cool would that be if Stockfish., would be able to use that technology at some point in the future. But I was not thinking months , I was thinking it would take a few years, at least two and maybe three.

We all remember what happened summer and that was, for me anyway, the most exciting event in computer chess since Kasparov beat Deep Blue. For me Alpha Zero beating Stockfish was interesting , but not exciting. Stockfish getting NNUE was exciting, Why? Because each of us was going to able to experience an Alpha Zero like experience on our own home computer, not on some big powerful computers hidden somewhere in Mountain View, California.
Fast forward to March 2021, I have now taken the plunge in building a NNUE during the last week or so.

Some observations, the very first net you build, if you build it from scratch, a “fresh network” as some say – that net is totally random and with Stockfish is probably somewhere between 2600 to 2800 (CCRL). I found that remarkable. Who would have thought, that with a totally random constructed evaluation and SF is playing, arguably, at grandmaster strength. That was a very sobering discovery. That net btw will be in the folder “Zero” on your first build if you want to check it out. My first week of trying to improve that net was a total waste of time. I got maybe a 30 Elo gain at best. But I was doing it my way, meaning trial and error. It has been a journey , but journey where you go nowhere. A lot of stop signs , detours and start overs and when you wake up the next morning, you are at the same place where you were the day before – something the fictional Phil Connors must have felt in Groundhog Day

How do you really know you are making progress with your NNUE? When you start seeing signs that your net will play d4 or e4 on its first move. Just started seeing those signs today, but it is still early. There is a lot of good information out there, but it is not always easy to find.

More to come, and it has been a random walk down NNUE street so far ...
Image
Uri Blass
Posts: 10269
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: A random walk down NNUE street ….

Post by Uri Blass »

What is the meaning of net that is totally random?
Do you say that stockfish with random evaluation is 2600 to 2800(CCRL)?

I do not believe it
Note that with totally random evaluation you do not know that a queen is better than a pawn and that winning material is good
Maybe with random evaluation you are unlucky to believe that having a queen is worse than not having a queen so you even do not know to search good captures earlier than moves that are not captures.
Krzysztof Grzelak
Posts: 1525
Joined: Tue Jul 15, 2014 12:47 pm

Re: A random walk down NNUE street ….

Post by Krzysztof Grzelak »

MikeB it is necessary to invent something better than NNUE. That would be a revolution on the world scale.
Fabian Fichter
Posts: 50
Joined: Mon Dec 12, 2016 2:14 pm

Re: A random walk down NNUE street ….

Post by Fabian Fichter »

I can imagine that with hybrid evaluation even a random net still can still give good results, because the random eval is just some noise, and the classical evaluation still gives a clear direction. In contrast, 2600+ with pure random evaluation should be close to impossible, I would rather guess around 2000 Elo lower.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

Uri Blass wrote: Sat Mar 06, 2021 11:15 am What is the meaning of net that is totally random?
Do you say that stockfish with random evaluation is 2600 to 2800(CCRL)?

I do not believe it
Note that with totally random evaluation you do not know that a queen is better than a pawn and that winning material is good
Maybe with random evaluation you are unlucky to believe that having a queen is worse than not having a queen so you even do not know to search good captures earlier than moves that are not captures.
Correct, totally random,, In fact , there is message that comes across your screen during your first fresh build.

INFO (initialize_training): Performing random net initialization that is the first net that gets saved in Folder '0" folder labled '0" on a fresh build.
It's random evaluation parameters of the board - where pieces are in relation to each other, I do not believe it would use random piece type values, they are in types.h of the code. The net effectively replaces evaluate.cpp Yes that would be truly unbelievable then. I will let someone who is more of an expert to weigh in on that.
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

Fabian Fichter wrote: Sat Mar 06, 2021 3:38 pm I can imagine that with hybrid evaluation even a random net still can still give good results, because the random eval is just some noise, and the classical evaluation still gives a clear direction. In contrast, 2600+ with pure random evaluation should be close to impossible, I would rather guess around 2000 Elo lower.
Thanks for the clarification Fabian.
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: A random walk down NNUE street ….

Post by MikeB »

Krzysztof Grzelak wrote: Sat Mar 06, 2021 11:34 am MikeB it is necessary to invent something better than NNUE. That would be a revolution on the world scale.
Quantum computing for chess seems to be a a long way off, if ever. I'm not expecting to see anything with my remaining days on earth, but who knows, maybe I will.
Image
Krzysztof Grzelak
Posts: 1525
Joined: Tue Jul 15, 2014 12:47 pm

Re: A random walk down NNUE street ….

Post by Krzysztof Grzelak »

MikeB wrote: Sat Mar 06, 2021 5:28 pm Quantum computing for chess seems to be a a long way off, if ever. I'm not expecting to see anything with my remaining days on earth, but who knows, maybe I will.
I apologise that I will ask - you can programme - most probably you can programme, you have a head and a mind - I think that yes. Everything in front of you, you do not need any of quantum computers.
RubiChess
Posts: 584
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: A random walk down NNUE street ….

Post by RubiChess »

Fabian Fichter wrote: Sat Mar 06, 2021 3:38 pm I can imagine that with hybrid evaluation even a random net still can still give good results, because the random eval is just some noise, and the classical evaluation still gives a clear direction. In contrast, 2600+ with pure random evaluation should be close to impossible, I would rather guess around 2000 Elo lower.
An NNUE engine with a random net is a random mover. (I'm testing Rubi playing with a random net against Baislika, Zevra, older OliThink and it loses ever game as expected.) Maybe not exactly like a random mover, preferring captures with positive SEE but nearly.
Uri Blass
Posts: 10269
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: A random walk down NNUE street ….

Post by Uri Blass »

RubiChess wrote: Sat Mar 06, 2021 6:23 pm
Fabian Fichter wrote: Sat Mar 06, 2021 3:38 pm I can imagine that with hybrid evaluation even a random net still can still give good results, because the random eval is just some noise, and the classical evaluation still gives a clear direction. In contrast, 2600+ with pure random evaluation should be close to impossible, I would rather guess around 2000 Elo lower.
An NNUE engine with a random net is a random mover. (I'm testing Rubi playing with a random net against Baislika, Zevra, older OliThink and it loses ever game as expected.) Maybe not exactly like a random mover, preferring captures with positive SEE but nearly.
No reason to prefer captures with positive SEE for random evaluation.

It is not a random mover because it prefers checkmate relative to not checkmate.
Another reason it is not a random mover is because it should prefer moves that limit the mobility of the opponent(more chances to fail high)