Play my chess engine
How it works
Two networks share the work. For the first few moves, an opening model reads the game so far as a sequence of moves and plays its top choice when it is confident. After that, a policy/value network reads the board itself: it suggests promising moves and estimates who is winning, and a Monte Carlo tree search uses those estimates to look ahead within its thinking time.
Everything runs on your device. The first game downloads the model (about 17 MB) and a runtime, then uses your GPU through WebGPU if your browser supports it, or the CPU if not, so it plays more strongly on faster machines and with more thinking time.
Analyse your game
When a game ends, you can step through it and run the probes from my square-ablation analysis on any position. Each probe edits the board one square at a time (removing a piece, moving it, switching its colour, or dropping in a pawn) and the engine's position network scores every edited board, so you can see which pieces and squares its evaluation and its move choice depend on. It runs on your device too: a quick sweep is a few hundred boards, and the relocation probe a few thousand.
Training
I trained it for a tournament whose rules fix the ingredients for every entrant: the same games to learn from, a cap of 10¹⁸ floating-point operations of training compute (counted across every run the final model descends from), and an engine that has to run in a browser in under 10 seconds a move.
The data. The games come from the Lichess open database: January to March 2026 for training (269 million games), with April held back to measure progress. I kept games where both players averaged 2250 or more and were within 200 points of each other, and dropped bullet. That leaves 4.0 million games, 1.5% of the total. Two labelling choices do most of the work. The move targets come only from the moves of the player who went on to win. The evaluation targets come from every position's final result (win, draw or loss for the side to move). Identical positions are merged, so each one carries a spread of the moves and results seen there rather than a single example.
The models. The opening model is a small transformer (0.9 million parameters) that reads the game so far as a list of moves and predicts the next one, trained on 12 million distinct opening sequences from the first ten moves. The position network is a larger transformer (6.5 million parameters) that reads the board itself, flipped so the side to move always plays White. It has two outputs: scores for every possible move, and the chances of a win, draw or loss. It learned from 246 million distinct positions from move 5 onward.
Choosing the rating floor. With compute fixed, the floor trades quality against quantity: each 100 points higher roughly halves the data. The budget buys about 300 million training examples for a network this size. At a floor of 2250, the data supplies about as many distinct positions as that, so training sees each position about once, using the strongest games the budget can cover.
Where data supply meets the compute budget. Each vertical line is a model size; the marker is the rating floor at which it makes one pass over the data.
Training runs. The position network trained on rented A100 graphics cards (Hugging Face Jobs), at about two minutes per 2 million positions, for 142 rounds: 7.5 × 10¹⁷ operations, three-quarters of the cap. The opening model trained on my laptop. The first position network played badly. Its evaluation barely tracked material, it had never seen a position before move 11, and it squeezed both outputs through a single summary of the board. The redesign scores moves directly from pairs of squares, gives the evaluation every square, and learns from move 5. On held-out games its top move matches the winners' most common move 59% of the time, against 15% for the first design after more compute.
Position network, held-out April games. The dotted stretch is where the training log is missing.
Opening model, held-out April games.
Predicting the result. The position network's second output, its estimate of who wins, matters as much as its move choice: it is what the search uses to compare lines. It also gets better as the game goes on, because there is more to go on. Endgames (six or fewer pieces besides kings and pawns) are easier to call than middlegames throughout training. To see it move by move, I ran the network the site plays over every position of 3,000 April games it never trained on. At move 1 it is no better than a coin flip at picking the winner. By move 40 it picks the winner of decisive games three times in four, and by move 70 nearly nine times in ten.
Evaluation accuracy over training, held-out April positions, split by game phase. The dotted stretch is where the training log is missing.
The network the site plays, on every position of 3,000 held-out April games (avg. rating 2250+), averaged over four-move bands. “Picks the winner” counts decisive games only. Late moves come only from long games, so the right of the chart is a smaller and different mix of games.
Shipping it. Both networks are exported to ONNX, and the position network is converted to half precision. That halves its size to 13 MB, and its top move still agrees with the full-precision version on 99.9% of positions. On a laptop, the graphics card scores about 500 positions a second, against about 20 on a single processor thread. More positions per move means a deeper search, which is why the engine is stronger on a graphics card.
Measured in Chrome on a Ryzen 7 8845HS laptop with Radeon 780M graphics, batches of 16 positions.
How strong it is, e.g. results against other engines or an estimated rating
- Code: link needed