Maxime Labonne's LFM2.5-230M-Chess Hits 2000 Elo Running in Your Browser
A 230M parameter Liquid model reaches 2004 Elo in chess by combining Stockfish distillation, a bit of RL, and shallow test-time search.
Takeaways
- LFM2.5-230M-Chess reaches 2004 Elo, running in-browser via WebGPU.
- Every legal chess move (1,968 total) is encoded as a single vocabulary token.
- SFT distills Stockfish across 126M positions from Lichess and endgame drills.
- HL-Gauss soft value targets added +60 Elo, GRPO polish added +16 Elo.
- Depth-3 test-time search over 12/6 branching adds ~300 Elo on top.
- Read the full write-up or try the demo.
Large general-purpose language models often emit illegal chess moves, revive captured pieces, or lose track of the board during long games. Their text tokenization does not encode the game’s legal action space. Maxime Labonne’s LFM2.5-230M-Chess weights take a specialized approach: a 230-million-parameter decoder fine-tuned from Liquid AI’s LFM2.5 base. Labonne reports roughly 2000 Elo when the model uses its depth-3 search.
Labonne’s implementation combines chess-specific tokens, Stockfish distillation, an ordinal value loss, Group Relative Policy Optimization, and shallow minimax search. The model can run locally through WebGPU, exports to ONNX, and is published under the LFM1.0 license.
Chess becomes a token problem
LFM2.5-230M-Chess emits constrained chess tokens. The vocabulary includes all 1,968 geometrically possible UCI-style moves, with each move represented by one token such as <m:e2e4>. Another 64 tokens divide win probability into discrete bins.
The position is serialized into an 80-token prompt containing a fixed 64-token board sequence and state information for the side to move, castling rights, en passant, the halfmove clock, and repetition. Forsyth-Edwards Notation, commonly called FEN, supplies most of those fields. Repetition requires game history because a FEN string does not preserve prior positions.
Direct policy inference uses two forward passes. The first pass selects one of the 64 value tokens, producing the model’s position evaluation. The second appends that value token and a best-move marker, restricts the output logits to moves supplied by an external legal-move generator, and selects the highest-scoring legal move. Illegal output remains possible only if the position serializer or legal-move generator is wrong.
The project adds 2,106 tokens for moves, values, and control state. Their embeddings are initialized from the mean and covariance of the existing embedding distribution, which keeps their initial scale aligned with the base model. A single causal decoder emits both value and policy tokens, allowing standard causal-language-model tooling to export and run the network.