A very interesting post

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

Moderators: hgm, Rebel, chrisw

User avatar
Sylwy
Posts: 4467
Joined: Fri Apr 21, 2006 4:19 pm
Location: IASI - the historical capital of MOLDOVA
Full name: SilvianR

A very interesting post

Post by Sylwy »

User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: A very interesting post

Post by Laskos »

Sylwy wrote: Fri Aug 21, 2020 6:46 pm Take a look here, please:

https://github.com/official-stockfish/S ... -678112885
Different nets for different stages of the game is worth pursuing. It sure will bring an order of 100 Elo points in less than a year. The nets perform best for very narrow tasks. For example, very regular Chess (regular openings, material etc) is played better by SF NNUE than some variants close to Chess, and divergent variants are played very poorly compared to classical SF. Similarly, concentrating on very narrow tasks as "regular openings" or even "French Defense" or "opposite color Bishops endgame" will benefit greatly many-nets SF NNUE Elo-wise. In some time we will have automated distribution and training for different nets over different parts of the game, with number of different nets in dozens and more.
User avatar
towforce
Posts: 11575
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK

Re: A very interesting post

Post by towforce »

Laskos wrote: Fri Aug 21, 2020 9:53 pmDifferent nets for different stages of the game is worth pursuing. It sure will bring an order of 100 Elo points in less than a year. The nets perform best for very narrow tasks. For example, very regular Chess (regular openings, material etc) is played better by SF NNUE than some variants close to Chess, and divergent variants are played very poorly compared to classical SF. Similarly, concentrating on very narrow tasks as "regular openings" or even "French Defense" or "opposite color Bishops endgame" will benefit greatly many-nets SF NNUE Elo-wise. In some time we will have automated distribution and training for different nets over different parts of the game, with number of different nets in dozens and more.

The plan:

1. a "master net" to classify a position and choose which evaluation net to use

2. a large number of evaluation nets to do the actual evaluation, each specialising in a different type of position

Although I wasn't thinking about NNs at the time, I had the same basic idea of a large number of evaluation functions for different position types 23 years ago - link (page 29).
Writing is the antidote to confusion.
It's not "how smart you are", it's "how are you smart".
Your brain doesn't work the way you want, so train it!
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: A very interesting post

Post by Laskos »

towforce wrote: Fri Aug 21, 2020 10:41 pm
Laskos wrote: Fri Aug 21, 2020 9:53 pmDifferent nets for different stages of the game is worth pursuing. It sure will bring an order of 100 Elo points in less than a year. The nets perform best for very narrow tasks. For example, very regular Chess (regular openings, material etc) is played better by SF NNUE than some variants close to Chess, and divergent variants are played very poorly compared to classical SF. Similarly, concentrating on very narrow tasks as "regular openings" or even "French Defense" or "opposite color Bishops endgame" will benefit greatly many-nets SF NNUE Elo-wise. In some time we will have automated distribution and training for different nets over different parts of the game, with number of different nets in dozens and more.

The plan:

1. a "master net" to classify a position and choose which evaluation net to use

2. a large number of evaluation nets to do the actual evaluation, each specialising in a different type of position

Although I wasn't thinking about NNs at the time, I had the same basic idea of a large number of evaluation functions for different position types 23 years ago - link (page 29).
Great, especially now, with NN evals. NN engines are much more specialized players than classical engines with handcrafted evals. Handcrafted eval engine has a degree of abstraction and generalization for many kinds of tasks higher than a NN eval engine. It is very visible when playing Chess variants, where NN based engines lose hundreds of Elo points to classical engines. But if NN engine is trained on this variant, it becomes much stronger than classical engines. The search also matters, Lc0 with PUCT is probably damned to be weak in endgames and deep tactics compared to top AB searchers, no matter what specialized endgame nets are used for Lc0.
Jhoravi
Posts: 291
Joined: Wed May 08, 2013 6:49 am

Re: A very interesting post

Post by Jhoravi »

towforce wrote: Fri Aug 21, 2020 10:41 pm The plan:

1. a "master net" to classify a position and choose which evaluation net to use

2. a large number of evaluation nets to do the actual evaluation, each specialising in a different type of position

Although I wasn't thinking about NNs at the time, I had the same basic idea of a large number of evaluation functions for different position types 23 years ago - link (page 29).
Isn't it simpler for separate nets depending on the number of pieces? About 30 Nets for the whole game.
User avatar
M ANSARI
Posts: 3707
Joined: Thu Mar 16, 2006 7:10 pm

Re: A very interesting post

Post by M ANSARI »

I agree and have been thinking that for a while now. A single NNUE evaluation is very limited at 20mb if you use that evaluation for all the phases of the game. But if you manage to find an algo that can correctly steer into specialized evaluation modules then there should be a tremendous amount of low lying fruit with regards to gains in ELO strength. Actually ... if several evaluation nets can be incorporated and switched on the fly, it would make sense to make the nets smaller (thus run much faster). The thing is how do you correctly decide to automatically switch to the correct net? Should it be by the number of pieces left? Should it be with regards to how many possible moves are in the position? Maybe a more sophisticated system where King safety or passed pawns become a factor? Really a lot of potential ideas that can be tried and for sure there will be a major shift in engine strength soon. This actually might mean that EGTB's are no longer needed as the endgame can be correctly played by specialized nets. There might also be a better way to run these smaller nets and make them run much faster on the hardware side. The next few months might see a major change in how the software AND hardware is used. Maybe the 2080 Ti cards that people purchased for Lc0 can still be put to good use.

For all this to happen there needs to be some good way to go through millions of games and choose specific positions with the specified number of pieces or certain criteria in the position to train specialized nets. I am guessing if the number of pieces is the criteria this should be easy ... but if the criteria is king safety or passed pawns or "dynamic" position etc... probably more difficult. Maybe this software is already available?
Jouni
Posts: 3286
Joined: Wed Mar 08, 2006 8:15 pm

Re: A very interesting post

Post by Jouni »

Just when I was about to ask I see in github pull request: the embedding of the nnue default file in the engine executable! No more any difficulties to install NNUE for beginners.
Jouni