chess-board-2400plus-b
a chess transformer imitating master play
2 min read
The model is a compact 22-million-parameter transformer that predicts the next move of a strong player (2400+ rating on Lichess) directly from the current board position. It takes square states—including castling rights and move history—as input, and outputs move probabilities, a game outcome prediction (win, draw, or loss), and predicted opponent responses. The architecture features 12 transformer blocks with a hidden dimension of 384 and specialized auxiliary heads for deep position analysis. The project will be useful for chess bot developers, neural network architecture researchers, and chess programming enthusiasts.
Key features
- Compact size: only 22 million parameters with high accuracy (rating level comparable to Maia-2 at around 2390).
- Trained on 10 million games: trained exclusively on real games from strong Lichess players rated 2400 and above.
- Multi-task architecture: alongside the main move, the model predicts the game outcome, the opponent's reply, and further gameplay progression.
- Efficient input: processes the board as 64 square tokens without relying on bulky tree search.
What you can do
- Integrate the model into a custom chess bot to generate human-like moves instead of pure Stockfish engine brute-force search.
- Research look-ahead behavior and decision-making patterns in chess AI models.
- Use it for analyzing chess positions and obtaining real-time probabilities for a win, draw, or loss.
Example
import json, sys
import chess
from huggingface_hub import snapshot_download
from safetensors.torch import load_file
d = snapshot_download("Arisp/chess-board-2400plus-b")
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()
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)))
print(out["result"][0].softmax(-1))
Read more
Details• Benchmarks: top-1 accuracy on held-out games is 59.43% (move loss 1.1838).
• Training: 5 epochs, 389,900 steps, ~800 million positions on a single NVIDIA B200 GPU in bf16 format.
• Requirements: PyTorch library, python-chess, numpy, safetensors, and about 22M parameters in memory.
• Features: no tree search or engine labels, pure imitation of human play.










Comments