| | --- |
| | license: mit |
| | tags: |
| | - chess |
| | task_categories: |
| | - reinforcement-learning |
| | --- |
| | # ChessExplained_500k_v0 Dataset |
| |
|
| | ## Overview |
| | This dataset contains approximately 500,000 chess positions with explanations for optimal moves, prepared for Supervised Fine-Tuning (SFT). The data is tokenized using **Qwen/Qwen3-8B** tokenizer. |
| |
|
| | ## Format |
| | - **File**: JSONL format (one JSON object per line) |
| | - **Fields**: |
| | - `text`: Full conversation in Qwen chat format with special tokens |
| | - `fen`: Position in FEN notation |
| | - `move`: Best move in UCI notation |
| | - `explanation`: Natural language explanation for the move |
| |
|
| | ## Explanation Generation Process |
| |
|
| | Each explanation is generated through the following pipeline: |
| |
|
| | 1. **Position Analysis**: Extract current position features from the FEN |
| | 2. **Best Move Calculation**: Determine optimal move using Stockfish engine |
| | 3. **Move Application**: Apply the move and extract new position features |
| | 4. **Position Evaluation**: Use Stockfish evaluation to classify the position: |
| | - Winning (|eval| > 2) |
| | - Drawish (|eval| ≤ 2) |
| | 5. **Feature Extraction**: Identify key tactical/strategic elements by comparing position features: |
| | - Attacking new pieces |
| | - Escaping attacks |
| | - Forced checkmates |
| | - Captures |
| | - Pawn promotions |
| | - Checks |
| | - Center control |
| | - Pins |
| | - King safety improvements |
| | - Rooks on 7th rank |
| |
|
| | ## Explanation Template |
| |
|
| | Explanations are generated by comparing position features before and after the best move. The system detects tactical/strategic changes and constructs natural language explanations. |
| |
|
| | **Standard format:** |
| | ``` |
| | After {piece} {action} {square}, this causes {color} to {reason(s)}. |
| | So {move_SAN} is the most logical. {evaluation}. |
| | ``` |
| |
|
| | **Detected features include:** |
| | - Checkmate delivery |
| | - Castling (kingside/queenside) |
| | - Giving check |
| | - Captures |
| | - Pawn promotions |
| | - Escaping attacks |
| | - Attacking new pieces |
| | - Gaining center control |
| | - Creating pins |
| | - Placing rook on 7th/2nd rank |
| |
|
| | **Fallback:** When no specific tactical features are detected, the explanation describes piece development (early game) or repositioning (mid/late game). |
| |
|
| | ## Example Entry |
| |
|
| | ```json |
| | { |
| | "text": "<|im_start|>user\nYou are an expert chess player...", |
| | "fen": "rnbq1rk1/ppp1bpp1/4pn1p/3p4/2PP4/2N1PN2/PP1B1PPP/R2QKB1R b KQ - 0 7", |
| | "move": "c7c5", |
| | "explanation": "After Pawn moves to c5, this causes Black to attacks the pawn on d4. So c5 is the most logical. Position is drawish." |
| | } |
| | ``` |
| |
|
| | ``` |
| | <|im_start|>user |
| | You are an expert chess player looking at the following position in FEN format: |
| | r3kb1N/pp2p2p/n5p1/2p5/2BP2q1/7b/PPP2P2/R1BQK3 b q - 3 16 |
| | Briefly, FEN describes chess pieces by single letters [PNBRKQ] for white and [pnbrkq] for black. The pieces found in each rank are specified, starting at the top of the board (a8..h8) and describing all eight ranks. Within each rank, all 8 positions must be specified, with one or more empty squares noted with a digit [1..8]. For example, /8/ is an empty rank (no pieces), while /4P3/ specifies four empty squares, a white pawn, and three more empty squares. |
| | |
| | Here is an additional visualization of the board (♔♕♖♗♘♙ = White pieces, ♚♛♜♝♞♟ = Black pieces): |
| | |
| | a b c d e f g h |
| | +---------------+ |
| | 8 | ♜ · · · ♚ ♝ · ♘ | 8 |
| | 7 | ♟ ♟ · · ♟ · · ♟ | 7 |
| | 6 | ♞ · · · · · ♟ · | 6 |
| | 5 | · · ♟ · · · · · | 5 |
| | 4 | · · ♗ ♙ · · ♛ · | 4 |
| | 3 | · · · · · · · ♝ | 3 |
| | 2 | ♙ ♙ ♙ · · ♙ · · | 2 |
| | 1 | ♖ · ♗ ♕ ♔ · · · | 1 |
| | +---------------+ |
| | a b c d e f g h |
| | |
| | The current side to move is black. |
| | The possible legal moves for the side to move are: ['f8g7', 'f8h6', 'e8d8', 'e8d7', 'a8d8', 'a8c8', 'a8b8', 'a6b8', 'a6c7', 'a6b4', 'g4c8', 'g4d7', 'g4e6', 'g4h5', 'g4g5', 'g4f5', 'g4h4', 'g4f4', 'g4e4', 'g4d4', 'g4g3', 'g4f3', 'g4g2', 'g4e2', 'g4g1', 'g4d1', 'h3g2', 'h3f1', 'e8c8', 'c5d4', 'h7h6', 'e7e6', 'b7b6', 'g6g5', 'h7h5', 'e7e5', 'b7b5']. |
| | |
| | Your task is to select the best move for the side to move. Please choose a move from this list, and output it in the following format: |
| | <uci_move>one_move_from_the_list</uci_move>. |
| | An example of a valid move for this position is <uci_move>f8g7</uci_move>. |
| | Think about the move and output it in the following format: |
| | <think>your_thinking</think> |
| | <uci_move>one_move_from_the_list</uci_move>. |
| | <|im_end|> |
| | <|im_start|>assistant |
| | <think> |
| | After Queen moves to g1, this causes Black to give check, moves away from attack, attacks the pawn on f2, creates a pin. So Qg1+ is the most logical. Black has a huge advantage. |
| | </think> |
| | |
| | <uci_move>g4g1</uci_move><|im_end|> |
| | ``` |
| |
|