building NN for different chess positions

Discussion of chess software programming and technical issues.

Moderator: Ras

DrCliche
Posts: 65
Joined: Sun Aug 19, 2018 10:57 pm
Full name: Nickolas Reynolds

Re: building NN for different chess positions

Post by DrCliche »

The evaluation function is of significantly less importance when evaluating a position over an extended period of time.

If you want an LC0 style engine to be better at executing long and intricate tactical plans, you need to use a method other than MCTS (pUCT) for rollouts, like counterfactual regret minimization or alpha-beta. All three can be blended together, if you like.
brianr
Posts: 540
Joined: Thu Mar 09, 2006 3:01 pm
Full name: Brian Richardson

Re: building NN for different chess positions

Post by brianr »

Fully agree about the importance of better search.
For Lc0, work has been going on in the areas you mentioned for more than a year.
So far, it is proving to be very difficult to realize any major improvements.
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: building NN for different chess positions

Post by dangi12012 »

What Uri Blass has understood here correctly is that chess from a position other than the starting position is a completely different game.
Mike Sherwin mentioned something along those lines too. (dynamic learning)

Imagine an Engine that becomes a god level player from the position it currently has - and not from the starting position.

Since it has retrained all networks to become an expert starting in the current position it will be arguabely better than something that has been trained to start every game from default or on random positions. Like learning Texel values for the current position from scratch in a few milliseconds. It would be an engine that has developed "opening theory" for its local environment on the graph of chess and not on (0,0).

This is a unique idea and is something worth to pursue. For now its a hard engineering problem of how to make training so efficient.
It boils down to:
search along a known heuristic vs learning the heuristic itself. For now engines do all the 'learning' part before/seperate from compiling but its not a rule that this cannot be done at runtime.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: building NN for different chess positions

Post by dangi12012 »

I wonder if there is a tool that people can download simply to build NN for some time that you define in advance and analyze later with the NN you got.
Since SF is open source and you can setup your own training server the question is yes - but there is no *simple* dedicated tool for that.


In fact after further reflection the answer to the question if its stronger is definitely yes:
When the position does not contain a knight or other piece - then the network does not need to learn any rules around the knight.
Since you have the same number of NN nodes but the network does need to learn less it will outperform any other network of the same size which contains or knows about these pieces.

In fact: Why not learn to a NNUE network to the same degree as SF mainbrainch - and create a runtime NNUE network loader for millions of position and pick the most matching position-network pair.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
brianr
Posts: 540
Joined: Thu Mar 09, 2006 3:01 pm
Full name: Brian Richardson

Re: building NN for different chess positions

Post by brianr »

Fully agree that nets can be trained to be superior for positions with constraints, such as a reduced number of pieces, or no knights.
That is not the issue. The problem is that the game starts from the initial position and determining when and how to use the specialized nets is far from trivial. In practice, it has never worked well (IIRC; I might well be not remembering some cases). Blended weighted scores from multiple sources have also been tried with relatively poor results as well. The same concept is being experimented with using nets with A/B "helper" engines to look for deep tactical lines that the nets struggle with. Exactly how to do so is still very much a work in progress.

It might be easier and more practical to create a well-crafted very large opening book (a major effort by itself), and train a strong net starting from numerous out-of-book positions. Then, with the addition of endgame tablebases, I suspect this approach would be something worth looking at, as the hand-off points are cleaner.