A 22M-parameter transformer that predicts the move a 2400+-rated human plays, from the current board. The board goes in as 64 square tokens (side to move's view). The model has a move head and a result head. It was trained only to imitate the moves people played (no search, no engine labels, no legal-move mask) on Lichess games where both players were rated 2400+.
It is variant A of a pair trained with the same recipe: Variant B adds heads for the opponent's reply and the follow-up move
(chess-board-2400plus-b). They are board-input versions of the move-sequence
models in AriSpiesberger/Memorize (chess_beyond/transcend/boardtf/).
move_tokens.py),
in the mover's frame. Result head: win / draw / loss for the side to move, from the mean of the final tokens.Held-out results are on the 5,000 held-out games. "Twin" is the move-sequence model trained on the same games (given the moves so far, not the board), compared on the same positions (plies 0-182, its context window).
| this model (twin) | |
|---|---|
| move loss, plies 0-182 | 1.1978 (1.3798) |
| top-1 (played move is the top move), plies 0-182 | 0.5896 (0.5445) |
| move loss / top-1, all plies | 1.2047 / 0.5873 |
| result cross-entropy (frequency baseline; per ply and colour) | 0.8620 (1.0531; 1.0243) |
| result calibration error (ECE) | 0.0239 |
| probability on illegal moves (twin incl. special tokens) | 0.0005 (0.0158) |
| raw top move illegal | 0.0000 |
| score vs Lichess level 1 / 3 / 5 (twin) | 0.995 (0.985) / 1.000 (0.890) / 0.910 (0.440) |
| rating, Maia-2 scale (twin) | 2366 ± 74 (1897) |
| score vs the twin | 0.825 |
Games: greedy top legal move, 50 openings from held-out games played with both colours, 100 games per opponent. Levels are Lichess's Stockfish levels (Fairy-Stockfish).
The tests from Evidence of Learned Look-Ahead in a Chess-Playing Neural Network (Leela Chess Zero), on Lichess puzzles. "Common": puzzles this model solves, "failed": ones it does not.
| puzzles solved, first move / whole line (22,517 puzzles) | 0.687 / 0.674 |
| patching the 3rd move's target square: log-odds drop vs other squares (common) | L3/12: 2.30 vs 0.58 other (1st 2.39; n=1736) |
| probe for the 3rd move's target square (common) | 0.888 vs random init 0.371 (best layer 10) |
| attention 1st-move target -> 3rd-move target, top-key rate (common) | 0.808 (L11H3), zeroing it 1.48 vs 0.05 all other entries |
| patching (failed) | L4/12: 0.28 vs 0.24 other (1st 0.32; n=3085) |
| probe (failed) | 0.634 vs random init 0.117 (best layer 9) |
For comparison, Leela T82 on its own common set: patching 2.21 vs 0.48, probe 95% vs 42%; Maia-3 23M @1900: 2.13 vs 0.41, 86% vs 24%, and 46.9% / 45.7% of the same puzzles.
import json, sys
import chess
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
d = snapshot_download("Arisp/chess-board-2400plus-a")
sys.path.insert(0, d)
from bt_model import BoardTransformer
from bt_data import encode_boards, mover_move_id
model = BoardTransformer(**json.load(open(f"{d}/config.json"))["model"])
model.load_state_dict(load_file(f"{d}/model.safetensors"))
model.eval()
board = chess.Board() # keep the move stack: it gives the previous move and repetitions
out = model(*encode_boards([board]))
legal = list(board.legal_moves)
probs = out["move"][0, [mover_move_id(board, m) for m in legal]].softmax(-1)
print(max(zip(probs.tolist(), legal))) # most likely move
print(out["result"][0].softmax(-1)) # win / draw / loss for the side to move
Needs torch, python-chess, numpy, safetensors.