--- license: cc0-1.0 task_categories: - other tags: - chess - lichess - sequence-modeling - language-modeling pretty_name: Lichess 2024–2025 Standard Rated (Binary Move Encoding) size_categories: - 1B np.ndarray: start_byte = 0 if i == 0 else offsets[i - 1] end_byte = offsets[i] # offsets are byte positions; tokens are 2 bytes each return moves[start_byte // 2 : end_byte // 2] # Per-game metadata aligns row-for-row with the games in *.bin meta = pq.read_table(f"{prefix}-metadata.parquet").to_pandas() print(meta.iloc[0]) print(get_game_tokens(0)) ``` To decode an individual move token: ```python def decode(token: int): op = (token >> 12) & 0xF if op == 0b1000: return ("game_end", token & 0xFFF) from_file = (token >> 9) & 0x7 from_rank = (token >> 6) & 0x7 to_file = (token >> 3) & 0x7 to_rank = token & 0x7 return (op, from_file, from_rank, to_file, to_rank) ``` ## Coverage 21 months: `2024-01`, `2024-02`, …, `2024-12`, `2025-01`, …, `2025-09`. Games per month are on the order of 10⁸ (the source Lichess dumps contain ~90–100M standard rated games per month). Games with non-standard starting positions (e.g., Chess960 mixed into the standard archive, or unusual `FEN` tags) are skipped during encoding, so `GameIndex` is not contiguous. ## Filtering / partial downloads Use `huggingface_hub`'s filtered download to pull only the months or file types you need: ```python from huggingface_hub import snapshot_download # Just the metadata Parquet files (~13 GB total) snapshot_download( repo_id="Alfredvc/chess-autocomplete-lichess", repo_type="dataset", allow_patterns="*-metadata.parquet", local_dir="./lichess", ) # A single month, all three files snapshot_download( repo_id="Alfredvc/chess-autocomplete-lichess", repo_type="dataset", allow_patterns="lichess_db_standard_rated_2024-01*", local_dir="./lichess", ) ``` ## License The underlying Lichess game data is published by Lichess under **CC0 1.0** (public domain dedication). This re-encoded copy is released under the same terms. Please cite the [Lichess database](https://database.lichess.org/) when using this dataset.