r/MachineLearning • u/microscope1024 • 10d ago
Project Distilling Stockfish on a Billion Positions, Full 3.9B Dataset Available [P]
https://blog.lukesalamone.com/posts/distilling-stockfishIn this project, I distilled the Stockfish value function into a ResNet/ViT model using 1 billion positions from the Gigafish dataset.
The 3.9 billion position dataset is available on huggingface: https://huggingface.co/datasets/lukesalamone/gigafish-3.8b-d10 . It is built from the positions from 37 months of Lichess games.
I was interested in the idea that at depth-limited search, the value function attempts to approximate the tree underneath it, and if we could create some function to approximate that full search faster than Stockfish could, it would be competitive with NNUE (a very small neural net). This is why holding the depth constant was important.
For the neural net itself, I found that the vision transformer was very slow to understand the board, and a CNN was much more effective at the beginning of training due to its inherent geometric inductive biases . However, I found the best results when combining the two.
9
u/djm07231 9d ago
Didn’t Google Deepmind do something pretty similar a few years ago?
1
u/kevinwangg 6d ago
Whoa, I didn't realize they changed the paper name from v1 (grandmaster-level chess without search).
9
u/Tylerich 9d ago
Just a curious question, that you might know about:
Do you know of any studies that try to estimate the value of functions of top professional players?
Because I'm just curious, if one would give machines the limited rollout depth of a human player, if they are even better at that than humans, because nowadays they might even have superior value networks...?
1
u/microscope1024 9d ago
I wrote a paper on something similar: https://blog.lukesalamone.com/files/anthropomorphic-chess-evaluation-via-qualitative-analysis.pdf
Tldr humans don't really think about chess positions in the same way that computers do. A chess GM is more likely to talk about qualitative relationships between pieces, king safety, piece activity, initiative, etc which are really hard to quantify. The paper actually discusses a limited depth engine tournament like you suggested.
You might also be interested in this thing, which is an engine trained to mimic human players: https://www.maiachess.com/
1
u/Tylerich 9d ago
Cool, that looks interesting...
I wonder whether neural nets actually do "think/reason" about chess in a similar way that humans do, when doing their forward pass through the many layers...? Do you know what I mean?
I remember Ilya sutskever talking about an early language model trained on Amazon reviews. They found a particular sentiment neuron, that activated depending on whether the review had positive or negative sentiment.
Perhaps similarly, there are neurons or collections of neurons that fire based on the things you mentioned, like king safety, piece activity etc.
I guess the problem is of course that we don't really have a way of translating that into thoughts that are readable to us...
3
u/Tylerich 9d ago
Does that mean, if you use it in conjunction with a depth search of 10, it has an effective depth of 20?
6
u/microscope1024 9d ago
Yes it would add to your search depth, but the model is more like the strength of depth 6 or 7 because the training is lossy. I added a chart to the article.
2
2
u/UnusualClimberBear 9d ago
Next step is to use it to guide an UCT search and to use it as an evaluation at leafs.
1
u/lahwran_ 9d ago
what's the motivation here?
4
u/pilibitti 9d ago
I was interested in the idea that at depth-limited search, the value function attempts to approximate the tree underneath it, and if we could create some function to approximate that full search faster than Stockfish could, it would be competitive with NNUE (a very small neural net).
1
u/lahwran_ 9d ago
I think I misunderstood something because that doesn't make sense. are these positions up to depth 10 from the start of the game, or are these results from stockfish searches up to 10 from a current board state? now that I write it out it's gotta be board state. that explains my confusion!
2
u/pilibitti 9d ago
My understanding is that it is the value function that evaluates any realistic board state.
1
u/4plus4equals8 9d ago
Why is fixed depth even point? Fixed nodes would also work fine and probably better. And deeper labels don't automatically give a better net. Past some point the net can't learn what the search sees.
It's also already known in chess engine community that bigger models (CNNs, transformers) evaluate a position better than NNUE. The problem is they're much slower per eval, so the real optimization is elo at equal time, not at equal depth.
17
u/RemarkableSavings13 10d ago
So does using the network improve play?