by krick · 5y ago · 0 comments
In fact, isn't the position evaluation pretty much the only thing that makes Stockfish different from Leela, the rest being just some tweaks on top of traversing the decision tree? And if it now seems that NN is better at this after all, what is the purpose of having these 2 engines at all, shouldn't all the future work just be moving over to Leela?
It uses clever integer arithmetic in the neural network, so you don't need a monster GPU to get good performance. I believe as of now it's using both the nn and the classic heuristic-based system for different situations.
> I believe as of now it's using both the nn and the classic heuristic-based system for different situations.
That's what I'm actually curious about. How does it combine these 2, precisely?
Edit: actually, reading more carefully the "Hybrid" section it kind of answers the last question. But still makes me wonder if the rest of the 2 engines cannot be combined.
(1) an evaluation function, that quantifies black/white advantage in a chess position.
(2) a search algorithm, that iteratively checks move sequences from a starting position using (1) and returns a recommendation of the best move to play.
Historically (1) was handcrafted, but it recently switched to a 'NNUE' neural network architecture (now it using different evaluation functions depending on how balanced the position is).
This is a good video if you want to understand how Stockfish works.
https://www.youtube.com/watch?v=pUyURF1Tqvg
"But if it turns out to be that heuristics-based approach has lost to NN, it isn't that clear anymore why these have to be 2 separate projects. At least, in terms of the rest of the engine."
Leela's evaluation function is a deep neural network, inference can only be carried out efficiently using GPU, whilst the Stockfish system has been optimised for a CPU-based computer architecture. The innovation of NNUE is that inference can be performed efficiently on a CPU, partly because the network is much smaller, and partly because the architecture is designed to be efficient at recomputing evaluations of only a single piece has changed.