DrCliche wrote: ↑Mon Aug 30, 2021 1:23 amLook up ML papers on contrastive learning.
You want to use a network to encode chess positions into a (much smaller) latent space, where the loss function has a term that penalizes the distance between encodings of similar positions. (It is up to you to determine how you want to define "similar", though of course there are unsupervised methods.)
A second network can then evaluate a given chess position using its latent vector as input, rather than (or in addition to) the chess position itself. Here you would have a normal loss function that simply encourages evaluation accuracy, plus whatever regularization terms you find aid generalization.
You can either use strong engine evaluations as a training target (this is what Stockfish does), or use search to allow the evaluation function to essentially bootstrap itself, comparing one node evaluations against aggregated 800 node evaluations or whatever (this is what Leela does).
If you train both the encoder and the evaluator in tandem, you will likely end up with a system that "understands" chess positions in a more "humanlike" way. (And though not necessary for the functioning of a chess engine, you may find the encoder trains more stably if you also simultaneously train a decoder, whose job is to take a position's latent vector as input and output the actual chess position, or possible moves, or whatever.)
That's a good answer: thank you for taking the time to write it!
In order to focus on just the exact thing that we're talking about (learning methods), I'm going to temporarily talk about images instead of chess positions: a dog and a cat look roughly the same. Humans and ANNs can tell them apart. ANNs can do it because they've been trained on a large dataset. Humans can tell things apart without having been trained on a large dataset. I've managed, on my first attempt, to find a case where image search fails:
People who dress well - link.
People who don't dress well - link
Many of the same images appear on both searches, so that's a fail!
When an image classifier is trained to differentiate cats from dogs by training on a large number of images, I am guessing that this doesn't confer any skill in differentiating horses from cows. Relating that to what you said: knowing how to differentiate "good" positions from similar "bad" positions in one type of position won't necessarily confer any skill in differentiating "good" positions from "bad" positions in a different type of position - and I think you'll agree that the number of position types in chess is absolutely massive.
Given that the threshold for becoming a GM is "only" good knowledge of fifty thousand different chess patterns, while, as I said before, your answer is good, I don't think it's going to deliver what we would want: a GM level evaluation of most positions at ply 1.
My preference would be to learn how to evaluate a chess position. I'm thinking that one approach to achieve this might be as follows (first attempt - obviously there's going to be room for improvement!):
* create a set of evaluation components (add to this as necessary)
* get a set of chess positions with "reasonably accurate" evaluations
* the ML's job it to pick a subset of evaluation components that give the correct score (or "close enough" to it)
* optimising of two things tends to be more awkward than optimising on one thing - so here's the twist: optimise on minimising the number of evaluation components used (maximising the simplicity of the resulting EF), using the correct evaluation as a CONSTRAINT to the optimisation - not the TARGET of it
* a bit more nebulous, but then include in the optimisation reward for building similar EFs for similar types of position
The end result would be an NN that could do a good job of selecting EF components (and hence build a good EF) for various types of position. This probably isn't quite what humans do, but trying to do what humans do isn't usually the best way to get a machine to display intelligent behaviour.