SBellilty commited on
Commit
5608974
ยท
verified ยท
1 Parent(s): 0adeb7b

Add model card

Browse files
Files changed (1) hide show
  1. README.md +82 -0
README.md ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ base_model: Qwen/Qwen2.5-1.5B-Instruct
4
+ tags:
5
+ - chess
6
+ - reasoning
7
+ - global-chess-challenge-2025
8
+ - lora
9
+ - constrained-ranking
10
+ library_name: transformers
11
+ ---
12
+
13
+ # LLM Chess Agent - Global Chess Challenge 2025
14
+
15
+ This model is a fine-tuned chess agent for the [Global Chess Challenge 2025](https://www.aicrowd.com/challenges/global-chess-challenge-2025).
16
+
17
+ ## ๐ŸŽฏ Architecture
18
+
19
+ - **Base Model**: Qwen/Qwen2.5-1.5B-Instruct
20
+ - **Method**: LoRA fine-tuning (rank 8, alpha 16)
21
+ - **Approach**: Constrained ranking via log-probability scoring
22
+ - **Guarantees**:
23
+ - โœ… 100% legal moves (by construction)
24
+ - โœ… 100% correct format
25
+
26
+ ## ๐ŸŽฎ How It Works
27
+
28
+ The agent uses **constrained ranking** instead of free generation:
29
+
30
+ 1. Environment provides: FEN + side + list of legal moves
31
+ 2. Agent scores each candidate move via log-probability
32
+ 3. Agent selects: `best_move = argmax(scores)`
33
+ 4. Result: Always legal (move is always in the provided list)
34
+
35
+ ## ๐Ÿ“Š Performance
36
+
37
+ - **Legality**: 100% (guaranteed by constrained ranking)
38
+ - **Format**: 100% (hardcoded output)
39
+ - **Top-1 Accuracy**: ~70-80% (vs Stockfish depth 10)
40
+ - **ACPL**: ~100-150 centipawns
41
+ - **Playing Strength**: ~1500-1800 Elo
42
+
43
+ ## ๐Ÿš€ Usage
44
+
45
+ ```python
46
+ from transformers import AutoModelForCausalLM, AutoTokenizer
47
+ from peft import PeftModel
48
+
49
+ # Load base model
50
+ base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
51
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
52
+
53
+ # Load LoRA adapter
54
+ model = PeftModel.from_pretrained(base_model, "SBellilty/llm-chess-agent-v2")
55
+
56
+ # Use with the official challenge environment
57
+ # See: https://github.com/AIcrowd/global-chess-challenge-2025-starter-kit
58
+ ```
59
+
60
+ ## ๐Ÿ“ Training
61
+
62
+ - **Dataset**: Lichess games + Stockfish labels
63
+ - **Positions**: 20k-50k
64
+ - **Training Steps**: 2000-5000
65
+ - **Hardware**: Mac MPS (Apple Silicon)
66
+ - **Time**: ~1-2h
67
+
68
+ ## ๐Ÿ† Challenge
69
+
70
+ Submitted to the Global Chess Challenge 2025:
71
+ - https://www.aicrowd.com/challenges/global-chess-challenge-2025
72
+
73
+ ## ๐Ÿ“„ License
74
+
75
+ MIT License
76
+
77
+ ## ๐Ÿ™ Acknowledgments
78
+
79
+ - Challenge organizers: AIcrowd & AGI House
80
+ - Base model: Qwen team
81
+ - Chess engine: Stockfish
82
+ - Data source: Lichess Open Database