--- dataset_info: features: - name: PuzzleId dtype: string - name: FEN dtype: string - name: Moves dtype: string - name: Rating dtype: int64 - name: RatingDeviation dtype: int64 - name: Popularity dtype: int64 - name: NbPlays dtype: int64 - name: Themes dtype: string - name: GameUrl dtype: string - name: OpeningTags dtype: string splits: - name: train num_bytes: 888854149 num_examples: 4062423 download_size: 423300746 dataset_size: 888854149 configs: - config_name: default data_files: - split: train path: data/train-* license: cc0-1.0 pretty_name: Lichess puzzles tags: - chess --- # Dataset Card for Lichess Puzzles ## Dataset Description 4,062,423 chess puzzles, rated and tagged. See them in action on [Lichess](https://lichess.org/training/themes). ### Dataset Creation Generating these chess puzzles took more than **50 years of CPU time**. We went through **300,000,000 analyzed games** from the Lichess database, and re-analyzed interesting positions with Stockfish 12/13/14/15 NNUE at 40 meganodes. The resulting puzzles were then [automatically tagged](https://github.com/ornicar/lichess-puzzler/tree/master/tagger). To determine the rating, each attempt to solve is considered as a Glicko-2 rated game between the player and the puzzle. Finally, player votes refine the tags and define popularity. ## Dataset Usage Using the `datasets` library: ```python from datasets import load_dataset dset = load_dataset("Lichess/puzzles", split="train") ``` ## Dataset Details ### Dataset Sample One row of the dataset looks like this: ```python {'PuzzleId': '0009B', 'FEN': 'r2qr1k1/b1p2ppp/pp4n1/P1P1p3/4P1n1/B2P2Pb/3NBP1P/RN1QR1K1 b - - 1 16', 'Moves': 'b6c5 e2g4 h3g4 d1g4', 'Rating': 1112, 'RatingDeviation': 74, 'Popularity': 87, 'NbPlays': 569, 'Themes': 'advantage middlegame short', 'GameUrl': 'https://lichess.org/4MWQCxQ6/black#31', 'OpeningTags': 'Kings_Pawn_Game Kings_Pawn_Game_Leonardis_Variation'} ``` ### Dataset Fields Every row of the dataset contains the following fields: - **`PuzzleId`**: `string`, the puzzle's unique identifier. The puzzle would be live at `https://lichess.org/training/{PuzzleID}`. - **`FEN`**: `string`, the FEN string of the position before the opponent makes their move. - **`Moves`**: `string`, the solution to the puzzle. All player moves of the solution are "only moves", i.e. playing any other move would considerably worsen the player position. An exception is made for mates in one: there can be several. Any move that checkmates should win the puzzle. - **`Rating`**: `int`, the Glicko-2 rating of the puzzle. - **`RatingDeviation`**: `int`, the Glicko-2 rating deviation of the puzzle. - **`Popularity`**: `int`, a number between `100` (best) and `-100` (worst), calculated as `100 * (upvotes - downvotes)/(upvotes + downvotes)`. Votes are weighted by various factors such as whether the puzzle was solved successfully or the solver's puzzle rating in comparison to the puzzle's. - **`NbPlays`**: `int`, the number of times a puzzle was played. - **`Themes`**: `string`, a space separated list of puzzle themes. - **`GameUrl`**: `string`, the link to the specific game and move the puzzle was taken from. - **`OpeningTags`**: `string`, a space separated list of openings. This is only set for puzzles starting before move 20. ## Additional Information - For a list of all possible puzzle themes and their description: https://github.com/ornicar/lila/blob/master/translation/source/puzzleTheme.xml - For a list of all possible openings: https://github.com/lichess-org/chess-openings