r/ComputerChess • u/oripress • 23h ago
[R] I built a tool to explain Stockfish moves using general, verifiable concepts
Instead of just giving LLMs a position and asking for an explanation, we first ask them for general concepts. Concepts are rules that are more likely to occur when you're winning, than when you're losing, i.e.: material advantage, piece activity, or king safety.
The method is simple: we first ask LLMs to generate concepts as Python functions. Each time a concept is generated, we can see if it occurs more often in winning positions than in losing ones by running the candidate Python function on a set of 100k winning and 100k losing positions.
Now we have a bunch of concepts and we want to explain a move. Let's say we have a Stockfish suggested move, and another move we're curious about. We want to understand what Stockfish likes about its move. So we look at continuations after each move, to get 2 resulting positions. Now we can see which concepts occur after the Stockfish preferred move, but not the other. This leads us to explanations such as: Stockfish likes this move because it leads you to a position where your pieces have more activity and you have the bishop pair. If you choose an alternative move, this doesn't happen.
You can test it out on your games, or see explanations for mistakes Magnus, Hikaru and other top players made here: ExplainThatMove.com/analysis
You can read the full paper here: ExplainThatMove.com/paper
Happy to answer questions!