Chess LoRA - Fine-tuned for Chess Move Prediction

This is a LoRA adapter fine-tuned on chess positions to predict the best move.

Training Details

Parameter Value
Base Model Qwen/Qwen3-4B-Instruct-2507
Dataset agi-noobs/chess-sft-100k
Training Steps 2,812
Unique Examples 90,000
Total Examples 89,984
Test Samples 10,000
Epochs 1
Batch Size 32
LoRA Rank 128
LoRA Alpha 32
LoRA Params 264,241,152 (6.57% of model)
Total Model Params 4,022,468,096
Learning Rate 0.0004905250962784578
LR Schedule cosine
Total Tokens 26,862,473
Budget N/A
WandB chess-lora-20251230-010330

Evaluation Results

Metric Value
Best Move Accuracy 14.0%
Legal Move Rate 99.0%
ACPL (mean) 323.7
ACPL (median) 171.0
Good Moves (<50 CPL) 31.3%
Inaccuracies (50-100) 9.6%
Mistakes (100-300) 18.7%
Blunders (300+) 40.4%
Puzzle Accuracy 25.0%

Prompt Template

You are an expert chess player. Here is the position in FEN format:
{{ FEN }}

Legal moves: {{ legal_moves_san }}

Select the best move. Keep your thinking to 2 sentences or less, then output your chosen move in SAN first, then convert it to UCI.

CRITICAL: Your move must always be one of the moves from legal moves list. With no spaces in between.

An example of a valid move for this position is <uci_move>{{ first_legal_move }}</uci_move>. 
Format:
<rationale>brief thinking</rationale>
<san>Nf3</san>
<uci_move>g1f3</uci_move>

Response Template

<rationale>{{ thinking }}</rationale>
<san>{{ best_move_san }}</san>
<uci_move>{{ best_move_uci }}</uci_move>

Sample Positions

Sample 1

FEN: rnbq1rk1/pp2ppbp/3p1np1/2p5/2PPP3/2N1BP2/PP4PP/R2QKBNR w KQ - 0 7 Best Move: g1e2

Sample 2

FEN: 4n3/6b1/p2pN1kp/2pPpN2/2P1P1p1/P4q2/2Q2P2/6K1 b - - 6 37 Best Move: f3a3

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("YOUR_USERNAME/YOUR_REPO")
tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/YOUR_REPO")

prompt = "<|im_start|>user\n[Your chess prompt here]<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))

Training Infrastructure

Trained using Tinker by Thinking Machines Lab.

Downloads last month
12
Safetensors
Model size
4B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for agi-noobs/chess-sft-100k-chess-lora-20251230-010330

Adapter
(127)
this model

Dataset used to train agi-noobs/chess-sft-100k-chess-lora-20251230-010330