LayaChess: Laya fine-tuned for chess

Laya (Convai Innovations, ModernBERT-large, 421M) is a System 1 decision model that had never seen a chessboard. This checkpoint fine-tunes it on 2 million Stockfish-rated moves from DeepMind's ChessBench. For each legal move, a Laya score question predicts the win chance of the side to move over 10 levels. The LayaChess engine wraps it in a Monte Carlo tree search.

Results

Base Laya This checkpoint
Picks Stockfish's best move (300 held-out positions) 6% 27%
Win-chance error (percentage points) 28.6 8.2

Checkpoint final: step 32,000, 2,048,000 training examples. Encoding, levels and the question template are in chess_meta.json. train_state.pt is the optimizer state for resuming training; inference doesn't need it.

Run it on your own machine

git clone https://github.com/devroopsaha744/LayaChess.git
cd LayaChess/engine
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m laya_chess.play          # browser board at http://localhost:8000

The engine downloads this checkpoint on first start. Optional: install Stockfish (brew install stockfish or sudo apt install stockfish) to see its preferred move next to Laya's. Full steps are in the GitHub README.

Use it from Python

import chess
from laya_chess import LayaChessModel

model = LayaChessModel("datafreak/laya-chess")
for move, win in model.score_moves(chess.Board())[:5]:
    print(move, f"{win:.0%}")

Credits

Laya by Convai Innovations (Apache 2.0) 路 ChessBench by Google DeepMind 路 Stockfish 路 python-chess

Downloads last month
20
Safetensors
Model size
0.4B params
Tensor type
F16
路
Inference Providers NEW
This model isn't deployed by any Inference Provider. 馃檵 Ask for provider support

Model tree for datafreak/laya-chess

Finetuned
(143)
this model

Space using datafreak/laya-chess 1