chess-puzzles-rlvr / README.md
codingmonster1234's picture
Add deterministic UUID item_id column for curriculum tracking
279b58f verified
---
dataset_info:
features:
- name: fen
dtype: string
- name: rating
dtype: int64
- name: tags
list: string
- name: turn
dtype: string
- name: uci_moves
list: string
- name: uuid
dtype: string
splits:
- name: train
num_bytes: 867658667
num_examples: 4278346
- name: validation
num_bytes: 102119282
num_examples: 503581
- name: test
num_bytes: 51001348
num_examples: 251434
download_size: 786486627
dataset_size: 1020779297
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: validation
path: data/validation-*
- split: test
path: data/test-*
license: mit
language:
- en
size_categories:
- 1M<n<10M
---
# Dataset Card: Chess-Puzzles-RLVR
## Dataset Summary
This dataset is a highly processed and stratified collection of approximately **5 million chess puzzles**, ranging from Elo ratings of **400 to 3300**. It is specifically designed for **Curriculum Learning** and **Reinforcement Learning (RLVR)** agents.
Unlike standard puzzle datasets, this version is pre-sorted and split into "rating buckets" to ensure that training, validation, and testing sets maintain an identical difficulty distribution across the entire spectrum.
---
## Dataset Structure
### Data Instances
Each instance represents a unique chess puzzle with a starting position (FEN) and the correct sequence of moves (UCI).
### Key Fields (Schema)
* **`fen`** *(string)*: The Forsyth-Edwards Notation representing the board state before the first move of the puzzle.
* **`uci_moves`** *(list of strings)*: The sequence of best moves in Universal Chess Interface (UCI) format (e.g., `["e2e4", "e7e5"]`).
* **`rating`** *(int)*: The difficulty rating of the puzzle (Elo).
* **`tags`** *(list of strings)*: Tactical motifs associated with the puzzle (e.g., `["fork", "sacrifice", "mateIn2"]`).
* **`turn`** *(string)*: Indicates which side is to move in the starting FEN (`"White"` or `"Black"`).
### Data Splits
The dataset is split into three parts, with each split containing a proportionate amount of data from every 100-point rating interval:
| Split | Percentage | Purpose |
| :--- | :--- | :--- |
| **Train** | 85% | Primary data for model training. |
| **Validation** | 10% | Monitoring performance and preventing catastrophic forgetting across difficulty tiers. |
| **Test** | 5% | Final holdout set for objective evaluation. |
---
## Creation Process
### 1. Data Cleaning and Transformation
The dataset was transformed from a raw chess puzzle format using the `python-chess` library. The following steps were taken for every row:
* **Turn Extraction**: The active color was parsed directly from the FEN string.
* **String Tokenization**: Raw space-separated strings for `moves` and `tags` were converted into clean Python lists for easier model consumption.
* **Feature Pruning**: Redundant boolean flags (e.g., `white_kingside`, `board`) were removed to reduce the dataset footprint and focus strictly on necessary state representation.
### 2. Stratified Bucketing
To facilitate curriculum learning, the dataset underwent a unique **Stratified Bucketing** process:
1. The entire dataset was sorted globally by **rating**.
2. The data was partitioned into **29 buckets**, each representing a 100-point rating range (e.g., 400-500, 501-600, ..., 3200-3300).
3. The 85/10/5 split was applied **locally within each bucket**.
4. These local splits were then re-concatenated into the final global `train`, `validation`, and `test` splits.
This ensures that whether the model is training on "easy" or "hard" data, the validation set always provides a statistically accurate reflection of the model's ability across the entire difficulty spectrum.
---
## Usage Considerations
This dataset is optimized for a **Sliding Window Sampler**. During training, it is recommended to:
1. Sample **80%** of your batch from the model's current "target" rating bucket.
2. Sample **20%** from all previously learned (easier) buckets to maintain tactical proficiency and prevent regression.