Add model card
Browse files
README.md
CHANGED
|
@@ -13,12 +13,16 @@ library_name: pytorch
|
|
| 13 |
|
| 14 |
# Chessformer v0
|
| 15 |
|
|
|
|
|
|
|
| 16 |
A ~50M parameter transformer trained to **imitate human chess play across the full Elo spectrum**, conditioned on player Elo, remaining clock time, and time increment.
|
| 17 |
|
| 18 |
> **44.4% top-1 joint move accuracy** on a held-out, Elo-balanced validation set (predicting the exact human move — from-square and to-square).
|
| 19 |
|
| 20 |
## What it does
|
| 21 |
|
|
|
|
|
|
|
| 22 |
- **Strength is a dial.** Pass `white_elo=1200` and it plays like a 1200. Pass `white_elo=2800` and it plays like a 2800.
|
| 23 |
- **No rules, no search.** Legal-move understanding is emergent from training data only.
|
| 24 |
- **Clock-aware.** Conditioning on remaining time lets the model represent time-pressure play.
|
|
@@ -70,18 +74,22 @@ Board pieces use **additive embeddings**: `emb[color] + emb[piece_type] + emb[fi
|
|
| 70 |
- **LR:** 3e-4, cosine decay with 1000-step warmup
|
| 71 |
- **Optimizer:** AdamW, weight decay 0.01
|
| 72 |
|
| 73 |
-
## Metrics (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
| Metric | Value |
|
| 76 |
| --- | --- |
|
| 77 |
-
| Top-1
|
| 78 |
-
|
|
| 79 |
-
|
| 80 |
-
|
| 81 |
|
| 82 |
-
|
| 83 |
-
- Puzzle-solving is emergent and not explicitly optimized.
|
| 84 |
-
- Clock conditioning is only as good as the training data's clock annotations.
|
| 85 |
|
| 86 |
## License
|
| 87 |
|
|
@@ -89,8 +97,7 @@ Apache 2.0. Training data from [database.lichess.org](https://database.lichess.o
|
|
| 89 |
|
| 90 |
## Citation
|
| 91 |
|
| 92 |
-
```
|
| 93 |
-
@misc{chessformer2024,
|
| 94 |
author = {Albert-Roulhac, Edouard},
|
| 95 |
title = {Chessformer: Elo-conditioned human chess imitation via transformer},
|
| 96 |
year = {2024},
|
|
|
|
| 13 |
|
| 14 |
# Chessformer v0
|
| 15 |
|
| 16 |
+
[Demo](https://huggingface.co/spaces/edarsem/chessformer-demo) · [GitHub](https://github.com/edarsem/chessformer)
|
| 17 |
+
|
| 18 |
A ~50M parameter transformer trained to **imitate human chess play across the full Elo spectrum**, conditioned on player Elo, remaining clock time, and time increment.
|
| 19 |
|
| 20 |
> **44.4% top-1 joint move accuracy** on a held-out, Elo-balanced validation set (predicting the exact human move — from-square and to-square).
|
| 21 |
|
| 22 |
## What it does
|
| 23 |
|
| 24 |
+
Attempts to predict the human move. The goal is for the model to learn the human way to play chess, and later to encode the position the way a human would see it, with human intuition, strength and time management.
|
| 25 |
+
|
| 26 |
- **Strength is a dial.** Pass `white_elo=1200` and it plays like a 1200. Pass `white_elo=2800` and it plays like a 2800.
|
| 27 |
- **No rules, no search.** Legal-move understanding is emergent from training data only.
|
| 28 |
- **Clock-aware.** Conditioning on remaining time lets the model represent time-pressure play.
|
|
|
|
| 74 |
- **LR:** 3e-4, cosine decay with 1000-step warmup
|
| 75 |
- **Optimizer:** AdamW, weight decay 0.01
|
| 76 |
|
| 77 |
+
## Metrics (test set, Elo-balanced, 671k positions)
|
| 78 |
+
|
| 79 |
+
All numbers from the held-out test split (Lichess December 2017 — a different month from training data).
|
| 80 |
+
|
| 81 |
+
**Top-1 accuracy** — the model's top prediction exactly matches the human move (from-square and to-square). A random legal move scores ~3–5%.
|
| 82 |
+
|
| 83 |
+
**Plausible 20%** — the human move is assigned ≥ 20% probability in both the from-square and to-square distributions (the model "sees" the idea even when not picking it first).
|
| 84 |
|
| 85 |
| Metric | Value |
|
| 86 |
| --- | --- |
|
| 87 |
+
| Top-1 move accuracy | **44.4%** |
|
| 88 |
+
| Plausible 20% | **62.9%** |
|
| 89 |
+
| Puzzle solved (all moves correct) | **28.0%** |
|
| 90 |
+
| Puzzle advancement (avg fraction solved) | **34.0%** |
|
| 91 |
|
| 92 |
+
Accuracy is flat and best across 1100–2200 Elo, where training data is abundant. Puzzle-solving is fully emergent — the model was never trained on puzzles.
|
|
|
|
|
|
|
| 93 |
|
| 94 |
## License
|
| 95 |
|
|
|
|
| 97 |
|
| 98 |
## Citation
|
| 99 |
|
| 100 |
+
```@misc{chessformer2024,
|
|
|
|
| 101 |
author = {Albert-Roulhac, Edouard},
|
| 102 |
title = {Chessformer: Elo-conditioned human chess imitation via transformer},
|
| 103 |
year = {2024},
|