Notes on the opponent
Your opponent is a neural network that learned chess by imitation. It was shown about a million positions from real games per level and trained to guess which move the human played. On top of that it runs a small Monte-Carlo tree search, deliberately short and always guided by the human-trained network. The goal is not the strongest possible chess. It is play that feels like a person of a given rating, blunders included.
The network does not see a picture of the board. It sees 64 tokens, one per square, and each token is a list of 34 numbers. Here is square e4 after 1. e4 e5 2. Nf3:
Token e4 · 34 numbers
Those 64 tokens then go through four stages:
64 × 34Square encoderA learned layer turns each token into 256 numbers and adds an “I am square e4” embedding.64 × 256Local mixerTwo ConvMixer blocks slide a 3×3 filter over the grid. Pawn chains and castled kings are neighbourhood things.64 × 256Transformer8 layers of self-attention, 8 heads each. Every square can look at every other, so a bishop sees down its diagonal.4,096 · 3Two headsPolicy: a score for every from → to pair, 64 × 64. Value: win, draw and loss.Each level is its own network, trained on the Lichess open database (January to April 2024). A game counts only if both players are inside the band, because a 1000-rated and a 2500-rated player differ in which moves they choose, not only in how often they blunder. The policy head learns to put probability on the move the human actually played (illegal moves are masked out); the value head learns the game's final result. 3,500 steps of 512 positions, about 30 minutes per level on a laptop.
| Level | 1Beginner | 2Club | 3Master |
|---|---|---|---|
| Lichess rating of both players | 800–1200 | 1600–2400 | 2400+ |
| Games × positions per game | 100k × 10 | 100k × 10 | 40k × 25 |
| Plays the human's move1 | 44.9% | 42.4% | 43.2% |
| Positions searched per move | 24 | 96 | 180 |
| Temperature T | 1.0 | 0.8 | 0.6 |
| Rating against Stockfish2 | 840 ± 196 | 1074 ± 138 | 1312 ± 121 |
1 Top-1 agreement on held-out positions the network never trained on. 2 Fitted from games against limited-strength Stockfish, on Stockfish's own Elo scale, which is not the Lichess scale of the training data. A rough, relative number.
One glance at the board gives the AI a gut feeling: which moves look natural, and who seems to be winning. The search tests that feeling by playing a few lines out in its head, one simulation at a time.
Why so little search? With 24 to 180 simulations (and a time cap) the visit counts stay close to the network's human priors. The search only nudges the AI away from moves its own value head dislikes, so it keeps its human habits. And it still fumbles, on purpose:
It samples. The most-visited move is likely, not certain. Lower levels sample more loosely.
Its judgement is rough. The value head was trained on who won human games, not on deep analysis.
It sees a few moves ahead. A tactic one ply past the horizon is invisible, just like at the club.
Plays
Judges
M3 for a forced mateThe centipawn score becomes an expected result for White, which fills the bar. So the AI plays like a human while the bar judges like an engine. When the two disagree, you have probably just watched a human-style mistake.
Pi = exp(si) / Σj exp(sj).v = P(win) − P(loss), between −1 and 1. A move's expected score is (v + 1) / 2.Q + c · P · √N / (1 + n): Q its average value so far for the mover, P its prior, n its visits, c = 1.5. Untried moves start at their parent's value minus 0.2.ni1/T / Σj nj1/T. A lower T leans harder on the most-visited move.E = 1 / (1 + 10−cp / 400), the standard Elo logistic. 0 cp gives 50%, +100 cp about 64%, +400 cp about 91%.The networks run with ONNX Runtime Web (WebAssembly) in a worker, and Stockfish runs in another. Nothing is sent to a server. Your game, level, colour and theme stay in your browser's local storage.
FumbleChess is an educational project. It is not affiliated with Lichess, Chess.com or the Stockfish team.