Text Generation
Safetensors
qwen3_5
chess
reasoning
reinforcement-learning
grpo
unsloth
qwen3.5
conversational
Instructions to use maxylium/chess-qwen35-4b-rl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Desktop
Chess Qwen 3.5 4B (v2 Zero-Hallucination Champion)
An advanced, end-to-end trained Chess Reasoning & Move Generation LLM built on Qwen 3.5 4B, fine-tuned and aligned on an AMD Instinct MI300X (192GB VRAM):
- Curated Full SFT: 202,785 high-quality chess reasoning traces (candidate captures, checks, PV analysis, and best UCI moves).
- Zero-Hallucination GRPO v2 RL: Online GRPO with severe punitive illegal move penalties (-15.0) and +2.0 legal move baseline incentives on 62,794 dynamic self-play, endgame, and GM puzzle positions.
- Logit-Constrained High-Elo Engine: 100% legal move adherence across all multi-ply tournament play.
Evaluation Benchmarks
1. Static Accuracy & Engine Alignment (478 Held-Out Positions)
| Metric | SFT Base | RL v1 | RL v2 Champion |
|---|---|---|---|
| Format Compliance | 100.0% | 100.0% | 100.0% |
| Legal Move Rate | 90.8% | 91.8% | 92.7% |
| Stockfish Top-1 Match | 32.2% | 31.8% | 31.0% |
| Stockfish Top-3 Match | 48.5% | 48.1% | 47.7% |
| Mean Centipawn Loss (ACPL) | 329.1 cp | 328.2 cp | 330.7 cp |
2. Multi-Elo Ladder Benchmark Results
| Opponent Tier | Engine Elo | Games | W / D / L | Model Score % | Retries Used |
|---|---|---|---|---|---|
| Beginner Baseline (200โ600 Elo) | 200โ600 | 5 | 1/1/3 | 30.0% | 33 |
| Stockfish 1350 | 1350 | 5 | 0/0/5 | 0.0% | 22 |
| Stockfish 1600 | 1600 | 5 | 0/0/5 | 0.0% | 53 |
| Stockfish 1850 | 1850 | 5 | 0/0/5 | 0.0% | 40 |
| Max Stockfish (Skill 20 / 3000+ Elo) | 3000+ (Max) | 3 | 0/0/3 | 0.0% | 18 |
How to Play
import chess, re
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained("maxylium/chess-qwen35-4b-rl")
FastModel.for_inference(model)
board = chess.Board()
prompt = f"You are a chess engine. Analyze the board inside <think></think> tags and output the best UCI move inside <move></move> tags.\nFEN: {board.fen()}\nBoard:\n{board}"
inputs = tokenizer.apply_chat_template([{'role': 'user', 'content': prompt}], add_generation_prompt=True, return_tensors='pt').to('cuda')
output = model.generate(inputs, max_new_tokens=256, temperature=0.2)
text = tokenizer.decode(output[0], skip_special_tokens=True)
print(text)
- Downloads last month
- 53