r/chessprogramming • u/yavuZd • 31m ago
Technical Predicting the next move in live GM games: a softmax over Stockfish MultiPV, recalibrated on held-out games
I've been building a side project that opens a small prediction market on the next move of live broadcast games (World Championship first, then whatever strong events are on Lichess). People predict with free virtual coins, and the market settles as soon as the move appears on the broadcast. It's live at yournextgambit.com, but the modelling is why I'm posting here.
The move model
- Stockfish MultiPV analyses the position. Each move's logit is its centipawn loss vs. the best move divided by a temperature (capped, so blunders don't become −∞), plus a small bonus for the engine's top few ranks.
- The temperature depends on the phase of the game. The opening runs "hotter" because humans play from preparation and taste, not by engine rank. The endgame runs colder. Time trouble also changes it.
- Moves outside MultiPV get a fixed "tail" share of the probability, which grows with the number of unanalysed moves and is capped. That share is spread over them with extra weight for captures and checks, because humans play those far more than their eval suggests.
- At the end comes a recalibration curve fitted on held-out games: the raw softmax was overconfident in the 30–60% range.
Live-feed problems that turned out harder than the model
- Late predictions: a move can appear on the broadcast a few seconds before my feed receives it. So the cut-off for predictions is based on the source timestamp minus an expected-latency margin, never on when the move arrived. Cancelling a prediction has a matching delay, so you can't back out once you've seen the move.
- Settling exactly once: organisers correct moves and take them back. A corrected move after settlement refunds the affected predictions instead of paying out twice.
- Connection limits: Lichess allows only a couple of concurrent stream connections per IP, so one shared stream per round carries every game in it. On top of that there's a freshness check and a PGN resync when the stream goes quiet.
The server is Go, standard library only, for no deep reason beyond curiosity.
Questions for you:
- Has anyone fitted move-choice models on human games? Rating-dependent temperatures? Maia-style approaches?
- Better ways to give probability to moves the engine never ranked than "captures and checks get extra weight"?
- Which calibration metric do you trust for a 20–40-way categorical prediction: log loss, Brier score, or something else?
Feedback welcome, including "this is wrong because…".