/ Модель

Характеристики

Контекст
256 токенов
Параметры
143 млн
Лицензия
MIT
Архитектура
llama · dense
Библиотека
transformers
Опубликована
6 авг 2026

philidor-142m

Генерация текстаТекст → текст3 профессии

Компактная языковая модель, обученная с нуля предсказывать шахматные ходы в нотации UCI по истории партии.

26скачиваний за 30 дней1лайквеса обновлены6 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Philidor 142M — модель, разработанная billygeekourson и обученная с нуля для предсказания ходов в шахматах. Она принимает последовательность ходов в нотации UCI и генерирует следующий ход как языковая модель предсказывает следующее слово; представление доски и явно заданные правила игры не используются. Модель предназначена для выбора ходов в партиях и изучения закономерностей человеческой игры, а файл vocab_uci.json позволяет маскировать нелегальные ходы при выборе.

Это decoder-only Transformer из 20 слоёв с шириной 768 и 12 головами внимания, загружаемый через Transformers как LlamaForCausalLM. Модель содержит 143,1 млн параметров, использует контекст длиной 256 ходов и обучена на 3,2 млрд ходов из публичных архивов Lichess. README сообщает о 98,85% легальных ходов при свободной генерации и согласии с человеческим ходом в 55,48% случаев на первой позиции.

Модель не умеет продолжать игру из произвольной позиции FEN, а без маскирования примерно один ход из ста может быть нелегальным. Она не использует поиск или просмотр вариантов и заметно слабее движков с более высоким уровнем игры; эндшпили даются хуже дебютов. Лицензия — MIT.

Сценарии применения

  • генерация следующего хода в шахматной партии
  • создание ходов для шахматного соперника без поиска вариантов
  • оценка предпочтений модели среди легальных ходов с маскированием
  • изучение закономерностей человеческих шахматных партий
  • эксперименты с обучением языковых моделей правилам настольных игр

Ограничения

Модель принимает только историю ходов от начальной позиции и не поддерживает произвольную позицию FEN; без маскирования возможны нелегальные ходы. Она делает один проход без поиска вариантов, играет скромно и хуже справляется с эндшпилями.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Philidor 142M

Version française plus bas

A language model trained from scratch to play chess, without ever being given a single rule of the game.

It never sees a board. It does not know that pieces, squares or a king exist. It receives a sequence of moves in UCI notation and predicts the next one, exactly the way a language model predicts the next word.

"Pawns are the soul of chess." François-André Danican Philidor, 1749

Result

98.85 % of the moves it proposes are legal, in free generation, with no constraint whatsoever. 95 % confidence interval: [98.69 – 98.99], measured on 20,000 positions from held-out games.

No rule was ever hard-coded. The model inferred the mechanics of the game from 3.2 billion moves played by humans.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

tok = AutoTokenizer.from_pretrained("billygeekourson/philidor-142m")
model = AutoModelForCausalLM.from_pretrained("billygeekourson/philidor-142m")

ids = tok("e2e4 e7e5 g1f3 b8c6", return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=20, do_sample=True,
                     temperature=0.6, top_k=20, pad_token_id=0)
print(tok.decode(out[0], skip_special_tokens=True))

Moves are written in UCI, separated by spaces. One move is exactly one token, so an 80-ply game takes 80 tokens.

Playing without ever producing an illegal move

The bundled vocab_uci.json lets you mask impossible moves before choosing. A single forward pass is enough, and the model keeps its preference ordering among the playable moves.

import json, torch, chess
from huggingface_hub import hf_hub_download

v = json.load(open(hf_hub_download("billygeekourson/philidor-142m",
                                   "vocab_uci.json")))
board = chess.Board()
board.push_uci("e2e4"); board.push_uci("c7c5")

logits = model(tok("e2e4 c7c5", return_tensors="pt").input_ids).logits[0, -1]
mask = torch.full_like(logits, float("-inf"))
for move in board.legal_moves:
    i = v["stoi"][move.uci()]
    mask[i] = logits[i]

print(v["itos"][int(mask.argmax())])   # g1f3

Architecture

Decoder-only Transformer: 20 layers, width 768, 12 attention heads, hidden MLP 2048. Pre-norm, RMSNorm, RoPE, SwiGLU, tied embeddings. Context of 256 moves, i.e. a whole game.

141,589,248 non-embedding parameters (143,102,976 total).

The architecture happens to match Llama exactly, which was not planned: the four building blocks were each chosen on their own merits. The model therefore loads as a standard LlamaForCausalLM, and the conversion was verified with a maximum logit difference of 0.00e+00 at every sequence length.

Vocabulary

1,971 tokens: the 1,968 geometrically possible UCI moves on a chessboard, plus <pad>, <bos> and <eos>.

No BPE. The vocabulary is finite and known in advance, which makes legality masking possible and spares the model from relearning that e2 and e4 form a single unit.

Data

Four months of public Lichess archives, April to July 2026.

Games read356,621,928
Games kept43,824,173 (12.3 %)
Training tokens3,186,179,287

Filtering: both players between 1800 and 2600 Elo, bullet excluded, normal termination, between 20 and 300 plies. The validation split is done per game, never per token, so that no game is cut between the two sets.

Training

A single RTX 3090. 20 hours, 77,787 steps, one full epoch. bf16, AdamW, cosine schedule with warmup, effective batch of 40,960 tokens. Measured MFU: 71 %.

Final loss: 1.4312 training, 1.4439 validation. Both curves stay superimposed, so no overfitting.

What the model knows

MetricValue
Legal moves in free generation98.85 %
Agreement with the human move, top-155.48 %
Agreement with the human move, top-591.95 %
Castling100.00 %
En passant100.00 %
Promotion99.80 %
Getting out of check98.60 %

All measurements are on held-out validation positions, at temperature 1.0 for legality and on the argmax for the rest.

Known limitations

No board representation. The model only understands a sequence of moves from the initial position. It cannot resume from an arbitrary FEN position.

About one move in a hundred is illegal without masking. For actual play, masking is essential.

Modest playing strength. On par with Stockfish capped at skill level 0, it drops off at level 1. This is a search-free model: it plays the most probable move after a single forward pass, with no lookahead.

It plays endgames less well than openings. Positions with few pieces offer less statistical regularity to exploit.

Related model

philidor-51m: same method, 51 M parameters, one month of data, two hours of training, 97.86 % legal moves. Useful for observing the effect of scale.

License

MIT for the model. Data comes from the public Lichess archives, released under CC0.



Philidor 142M (français)

Un modèle de langage entraîné de zéro à jouer aux échecs, sans qu'aucune règle du jeu ne lui ait jamais été donnée.

Il ne voit pas d'échiquier. Il ne sait pas qu'il existe des pièces, des cases, un roi. Il reçoit une suite de coups en notation UCI et prédit le suivant, exactement comme un modèle de langage prédit le mot suivant.

« Les pions sont l'âme des échecs. » François-André Danican Philidor, 1749

Le résultat

98,85 % des coups qu'il propose sont légaux, en génération libre, sans aucune contrainte. Intervalle de confiance à 95 % : [98,69 – 98,99], mesuré sur 20 000 positions issues de parties de validation jamais vues.

Aucune règle n'a été codée. Le modèle a déduit la mécanique du jeu de 3,2 milliards de coups joués par des humains.

Utilisation

from transformers import AutoModelForCausalLM, AutoTokenizer

tok = AutoTokenizer.from_pretrained("billygeekourson/philidor-142m")
model = AutoModelForCausalLM.from_pretrained("billygeekourson/philidor-142m")

ids = tok("e2e4 e7e5 g1f3 b8c6", return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=20, do_sample=True,
                     temperature=0.6, top_k=20, pad_token_id=0)
print(tok.decode(out[0], skip_special_tokens=True))

Les coups s'écrivent en UCI, séparés par des espaces. Un coup vaut exactement un token, donc une partie de 80 demi-coups occupe 80 tokens.

Jouer sans jamais produire de coup illégal

Le fichier vocab_uci.json permet de masquer les coups impossibles avant de choisir. Un seul passage avant suffit, et le modèle conserve son ordre de préférence entre les coups jouables.

import json, torch, chess

v = json.load(open("vocab_uci.json"))
board = chess.Board()
board.push_uci("e2e4"); board.push_uci("c7c5")

logits = model(tok("e2e4 c7c5", return_tensors="pt").input_ids).logits[0, -1]
masque = torch.full_like(logits, float("-inf"))
for coup in board.legal_moves:
    i = v["stoi"][coup.uci()]
    masque[i] = logits[i]

print(v["itos"][int(masque.argmax())])   # g1f3

Architecture

Transformer décodeur : 20 couches, dimension 768, 12 têtes d'attention, MLP caché 2048. Pre-norm, RMSNorm, RoPE, SwiGLU, embeddings liés. Contexte de 256 coups, soit une partie entière.

141 589 248 paramètres hors embeddings (143 102 976 au total).

L'architecture correspond exactement à celle de Llama, ce qui n'était pas prévu : les quatre briques ont été choisies séparément pour leurs mérites propres. Le modèle se charge donc comme un LlamaForCausalLM standard, et la conversion a été vérifiée : écart maximal de 0.00e+00 sur les logits, à toutes les longueurs de séquence.

Vocabulaire

1 971 tokens : les 1 968 coups UCI géométriquement possibles sur un échiquier, plus <pad>, <bos> et <eos>.

Pas de BPE. Le vocabulaire est fini et connu d'avance, ce qui rend possible le masquage de légalité et évite au modèle de réapprendre que e2 et e4 forment une seule unité.

Données

Quatre mois d'archives publiques Lichess, d'avril à juillet 2026.

Parties lues356 621 928
Parties conservées43 824 173 (12,3 %)
Tokens d'entraînement3 186 179 287

Filtrage : les deux joueurs entre 1800 et 2600 Elo, bullet exclu, terminaison normale, entre 20 et 300 demi-coups. Le découpage validation se fait par partie et non par token, pour qu'aucune partie ne soit coupée entre les deux jeux.

Entraînement

Une seule RTX 3090. 20 heures, 77 787 steps, une époque complète. bf16, AdamW, cosinus avec chauffe, batch effectif de 40 960 tokens. MFU mesuré : 71 %.

Loss finale : 1,4312 en entraînement, 1,4439 en validation. Les deux courbes restent superposées, donc aucun surapprentissage.

Ce que le modèle sait

MesureValeur
Coups légaux en génération libre98,85 %
Accord avec le coup humain, top-155,48 %
Accord avec le coup humain, top-591,95 %
Roque100,00 %
Prise en passant100,00 %
Promotion99,80 %
Sortie d'échec98,60 %

Toutes les mesures portent sur des positions de validation jamais vues à l'entraînement, à température 1,0 pour la légalité et sur l'argmax pour le reste.

Limites à connaître

Aucune représentation de l'échiquier. Le modèle ne comprend qu'une suite de coups depuis la position initiale. Il ne sait pas repartir d'une position arbitraire donnée en FEN.

Environ un coup sur cent est illégal sans masquage. Pour jouer réellement, le masquage est indispensable.

Force de jeu modeste. À égalité avec Stockfish bridé au niveau 0, il décroche au niveau 1. C'est un modèle sans recherche : il joue le coup le plus probable après un unique passage avant, sans aucune anticipation.

Il ne joue pas les finales aussi bien que les ouvertures. Les positions à peu de pièces offrent moins de régularité statistique à exploiter.

Modèle apparenté

philidor-51m : même méthode, 51 M de paramètres, un mois de données, deux heures d'entraînement, 97,86 % de coups légaux. Utile pour observer l'effet de l'échelle. Le résultat est instructif : tripler la taille du modèle à volume de données égal ne change presque rien à la légalité, mais gagne deux à trois points d'accord avec le coup humain.

Licence

MIT pour le modèle. Les données proviennent des archives publiques Lichess, diffusées en CC0.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
9451c2b

0 моделей