Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,161 @@
|
|
1 |
-
---
|
2 |
-
license: mit
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
---
|
4 |
+
<h1 align="center">
|
5 |
+
<b>Sudoku-Bench</b><br>
|
6 |
+
</h1>
|
7 |
+
|
8 |
+
<p align="center">
|
9 |
+
π€ <a href="https://huggingface.co/SakanaAI/Sudoku-CTC-Reasoning">[Sudoku-CTC-Reasoning dataset]</a><br>
|
10 |
+
π <a href="https://github.com/SakanaAI/Sudoku-Bench">[Sudoku-Bench GitHub]</a><br>
|
11 |
+
π <a href="https://sakana.ai/#">[Blog Post]</a>
|
12 |
+
</p>
|
13 |
+
|
14 |
+
|
15 |
+
## Sudoku-Bench puzzle dataset
|
16 |
+
|
17 |
+
The `SakanaAI/Sudoku-Bench` puzzle dataset contains three subsets:
|
18 |
+
|
19 |
+
- `challenge_100`: A collection of 100 creative Sudoku puzzles.
|
20 |
+
- `test` split: 100 puzzles
|
21 |
+
- `nikoli_100`: A collection of 100 beautiful handmade standard Sudoku puzzles designed by Nikoli.
|
22 |
+
- `test` split: 100 puzzles
|
23 |
+
- `ctc`: A larger collection of puzzles featured as puzzles solves in the [Cracking the Cryptic](https://www.youtube.com/c/CrackingTheCryptic) (CTC) YouTube channel.
|
24 |
+
- `test` split: 2565 puzzles
|
25 |
+
|
26 |
+
## Subset details
|
27 |
+
|
28 |
+
### `challenge_100` subset
|
29 |
+
|
30 |
+
The purpose of the `challenge_100` subset is to evaluate the reasoning capabilities of LLMs on a diverse set of Sudokus.
|
31 |
+
|
32 |
+
The subset includes
|
33 |
+
- 15 4Γ4 puzzles (Sudoku variants)
|
34 |
+
- 15 6Γ6 puzzles (Sudoku variants)
|
35 |
+
- 50 9Γ9 puzzles (Sudoku variants)
|
36 |
+
- 20 9Γ9 puzzles (standard Sudoku) taken from the `nikoli_100` set
|
37 |
+
|
38 |
+
The selection of puzzles covers a range of difficulty. The 9Γ9 puzzles are roughly evenly distributed across difficulty levels 1 through 5 (using the [Logic Masters](https://logic-masters.de/Raetselportal/) difficulty scale). Around 5 puzzles are more difficult than the standard 5-star difficulty and are considered a challenge to the best human solvers. Difficulty is not a reflection of how complex the puzzle appears, and is not necessarily related to the length of the ruleset. Difficulty is a measure of how much skill and time is required for a human solver and is more closely a reflection of the depth of the idea required to find the puzzle's break-in.
|
39 |
+
|
40 |
+
The 4Γ4 puzzles are significantly easier and most are rated 1-star difficulty. A subset of the 4Γ4 puzzles are quite simple and predominately test the model's ability to understand the constraints of Sudoku variant.
|
41 |
+
|
42 |
+
Taken as a whole, the `challenge_100` includes a broad spectrum of difficulty and can be used to evaluate the performance of reasoning models of varying capabilities.
|
43 |
+
|
44 |
+
### `nikoli_100` subset
|
45 |
+
|
46 |
+
The `nikoli_100` subset contains 100 beautiful handmade standard Sudoku puzzles designed by Nikoli, the Japanese puzzle company that popularized Sudoku.
|
47 |
+
|
48 |
+
[Algorithimcally generated Sudoku puzzles](https://www.kaggle.com/datasets/rohanrao/sudoku) tend to find only puzzles of a certain type, namely whose solution path is similarly algorithmic. Human setters are more capable of creating puzzles that require deeper reasoning and creativity in the solve: see [this video](https://www.youtube.com/watch?v=mlLq8qaTLBo), for an example.
|
49 |
+
|
50 |
+
### `ctc` subset
|
51 |
+
|
52 |
+
The `ctc` subset contains 2565 puzzles featured as puzzles solves in the Cracking the Cryptic channel. The `ctc` subset can be used in conjunction with the reasoning traces in [huggingface.co/datasets/SakanaAI/Sudoku-CTC-Reasoning](https://huggingface.co/datasets/SakanaAI/Sudoku-CTC-Reasoning). That is, you may wish to use the reasoning traces together with prompts derived from the content of the puzzle being solved, which the `ctc` subset can provide.
|
53 |
+
|
54 |
+
## Puzzle details
|
55 |
+
|
56 |
+
Each puzzle in `SakanaAI/Sudoku-Bench` contains the fields:
|
57 |
+
|
58 |
+
#### Puzzle data
|
59 |
+
- `puzzle_id`: Identifier for the puzzle
|
60 |
+
- `sudokupad_url`: Link to play the puzzle on [Sudokupad](https://sudokupad.app)
|
61 |
+
- `author`: Creator of the puzzle
|
62 |
+
- `title`: Name of the puzzle
|
63 |
+
- `rules`: The puzzle rules
|
64 |
+
- `initial_board`: String representation of the starting grid (empty cells shown as '.')
|
65 |
+
- `solution`: String representation of the completed grid (81 digits for a 9Γ9 puzzle)
|
66 |
+
- `rows`: Number of rows in the puzzle
|
67 |
+
- `cols`: Number of columns in the puzzle
|
68 |
+
- `visual_elements`: JSON-encoded string containing detailed specifications for visual components like circles, lines, and other custom markings specific to the puzzle variant (see [Sudoku-Bench/src/sudokupad_interaction/puzzle_tools](https://github.com/SakanaAI/Sudoku-Bench/blob/main/src/sudokupad_interaction/puzzle_tools.py) for the extraction of the visual elements)
|
69 |
+
- `encoded_puzzle`: A compressed representation of the puzzle using SudokuPad's encoding scheme; for loading the puzzle directly in an offline SudokuPad (see [Sudoku-Bench/src/sudokupad_interaction/README.md](https://github.com/SakanaAI/Sudoku-Bench/blob/main/src/sudokupad_interaction/README.md))
|
70 |
+
|
71 |
+
The puzzles from the `ctc` subset contain additional fields:
|
72 |
+
|
73 |
+
#### Video metadata
|
74 |
+
- `youtube_id`: The YouTube ID of the video from which the puzzle was solved
|
75 |
+
- `sequential_number`: The index of the puzzle in the video (for videos where multiple puzzles are solved; in most cases this is 1)
|
76 |
+
- `date`: The upload date of the video
|
77 |
+
- `lgc_timestamp`: The time in seconds when the phrase "let's get cracking" is said indicating the start of the solve in the video
|
78 |
+
|
79 |
+
## Example puzzle: Parity Fish
|
80 |
+
|
81 |
+
<img width="229" alt="Image" src="https://github.com/user-attachments/assets/48820b54-78bf-47af-ad04-f64ad7a0dd13" style="float: right;"/>
|
82 |
+
|
83 |
+
The puzzle Parity Fish by Marty Sears is included in the `challenge_100` dataset.
|
84 |
+
|
85 |
+
- `puzzle_id`: `'sxsm_MartySears_580c6fdbbba9bfb0e71ae19044f02d4c'` (using SudokuPad's internal `id` field)
|
86 |
+
- `sudokupad_url`: `'https://sudokupad.app/wsj7iunsg6'` (link to the puzzle on SudokuPad)
|
87 |
+
- `author`: `'Marty Sears'`
|
88 |
+
- `title`: `'Parity Fish'`
|
89 |
+
- `rules`: `'Normal sudoku rules apply; fill the grid with the digits 1-9 so that digits don\'t repeat in any row, column, and marked 3x3 box.\\nTwo cells adjacent along a red line must contain one even digit and one odd digit.\\nTwo cells connected by a white dot contain consecutive digits.\\nTwo cells connected by a black dot contain digits where one is double the other.',`
|
90 |
+
- `initial_board`: `'.................................................................................'` (empty cells are represented as `.`)
|
91 |
+
- `solution`: `'854369172976251834123478956419582367568937421237146598785694213691823745342715689'`
|
92 |
+
- `rows`: `9`
|
93 |
+
- `cols`: `9`
|
94 |
+
|
95 |
+
### Visual elements
|
96 |
+
|
97 |
+
The `visual_elements` field is a JSON-encoded string containing detailed specifications for visual components of the puzzle. In the Parity Fish puzzle, there are 24 visual elements: 5 black dots, 16 white dots, and 3 red lines. You can display the visual elements using the `pretty_print_visual_elements` function in [`src/eval.utils`](https://github.com/SakanaAI/Sudoku-Bench/blob/main/src/eval/utils.py) in the [SakanaAI/Sudoku-Bench](https://github.com/SakanaAI/Sudoku-Bench) repo
|
98 |
+
|
99 |
+
```python
|
100 |
+
import datasets
|
101 |
+
import json
|
102 |
+
from eval.utils import pretty_print_visual_elements
|
103 |
+
|
104 |
+
puzzle = datasets.load_dataset("SakanaAI/Sudoku-Bench", "challenge_100")['test'][23] # Parity Fish puzzle
|
105 |
+
print(pretty_print_visual_elements(json.loads(puzzle['visual_elements'])))
|
106 |
+
# - shape: circle, color: white (stroke color: black), location: between r4c8 and r4c9
|
107 |
+
# - shape: circle, color: white (stroke color: black), location: between r5c8 and r5c9
|
108 |
+
# - shape: circle, color: white (stroke color: black), location: between r6c8 and r6c9
|
109 |
+
# - shape: circle, color: white (stroke color: black), location: between r5c1 and r5c2
|
110 |
+
# - shape: circle, color: white (stroke color: black), location: between r8c3 and r9c3
|
111 |
+
# - shape: circle, color: white (stroke color: black), location: between r7c1 and r8c1
|
112 |
+
# - shape: circle, color: white (stroke color: black), location: between r1c1 and r2c1
|
113 |
+
# - shape: circle, color: white (stroke color: black), location: between r7c7 and r7c8
|
114 |
+
# - shape: circle, color: white (stroke color: black), location: between r7c1 and r7c2
|
115 |
+
# - shape: circle, color: white (stroke color: black), location: between r9c8 and r9c9
|
116 |
+
# - shape: circle, color: white (stroke color: black), location: between r8c5 and r8c6
|
117 |
+
# - shape: circle, color: white (stroke color: black), location: between r1c4 and r2c4
|
118 |
+
# - shape: circle, color: white (stroke color: black), location: between r7c6 and r8c6
|
119 |
+
# - shape: circle, color: white (stroke color: black), location: between r2c7 and r3c7
|
120 |
+
# - shape: circle, color: white (stroke color: black), location: between r1c2 and r1c3
|
121 |
+
# - shape: circle, color: white (stroke color: black), location: between r1c5 and r2c5
|
122 |
+
# - shape: circle, color: black, location: between r3c2 and r4c2
|
123 |
+
# - shape: circle, color: black, location: between r4c7 and r4c8
|
124 |
+
# - shape: circle, color: black, location: between r2c3 and r3c3
|
125 |
+
# - shape: circle, color: black, location: between r9c2 and r9c3
|
126 |
+
# - shape: circle, color: black, location: between r8c8 and r9c8
|
127 |
+
# - line, color: red, coords: r3c2, r3c3, r3c4, r3c5, r3c6, r4c7, r5c8, r6c7, r7c6, r7c5, r7c4, r7c3, r7c2
|
128 |
+
# - line, color: red, coords: r4c1, r4c2, r5c3, r6c4, r7c4
|
129 |
+
# - line, color: red, coords: r6c1, r6c2, r5c3, r4c4, r3c5
|
130 |
+
```
|
131 |
+
|
132 |
+
The intermediate `json.loads(puzzle['visual_elements']))` is a list of dictionaries, each of which is a verbose description extracted from the SudokuPad rendering engine. We encourage the user to adopt their own `pretty_print_visual_elements` function to display the visual elements in a way that is most useful for their application.
|
133 |
+
|
134 |
+
Please see [`src/sudokupad_interaction/puzzle_tools`](https://github.com/SakanaAI/Sudoku-Bench/blob/main/src/sudokupad_interaction/puzzle_tools.py) for more details on the `visual_elements` field.
|
135 |
+
|
136 |
+
### Encoded puzzle
|
137 |
+
|
138 |
+
The `encoded_puzzle` field is a byte64 encoding of the puzzle using SudokuPad's internal encoding method.
|
139 |
+
|
140 |
+
The `encoded_puzzle` field can be used to obtain an alternate URL for the puzzle. Namely, `https://sudokupad.app/wsj7iunsg6` and [`https://sudokupad.app/{parity fish's encoded_puzzle string}`](https://sudokupad.app/sclN4SwJgXA5AzgHjAtgfQLIEMBOAXAngZQFMsZkBWADgAYBjANgDMwAjV9ATmYeasIHYAjOkID2VACziGVAExhxNKABpEhbOjDp1EYDAD2AV0w1C0fAbB6A1gYAEGK4Uy2AbjNlkAdLM8zxAWhoaBjJ0CjpldANsAAs9TGgMHFxbIhJlTAMAG0IYaAA5eMR0LNsYC2s7TJyYW3QAB3qs3ABuWwYQLNLYwlsAc0xwWwB3EFjbH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roOU/z1NQ0L2si2LEtS1jxts/1v06Yr3Nk6rfMCw7MNO7rjPi8z0se7jfHm0ovtBVb/02+rgshwjYf6xHhtRybCF0Pj9kJ8r/sp3bGtaxnesu5H7t5wXMUW/7Se87bQea47Vfh67Rt5xQHNN0rLcB239sd+nOvVwbbsy4hfD4z7lsq2X7eV5P3e17PCF/u9i/N8vavl2nwuZzXOd157SheHvQ8H4HY9r870+92zYkN4PfvW4fq+d+vWc97nNm3sRLxyXqXb+D9f5P2zjPaOiE/xyxvp/ZOECK5QNPs/QBuNfJx19l5JOXk0EhzRtAi+2DC4f3wVzQhx8I6kK3jJXB1CS5/RocHJm9C4EIX7nFShLDARsPHhwjBWDTZKHnkgqhxNBFaxISIrG6FoJAA) will load the same puzzle. Both URLs point to Sven's SudokuPad website. However, only the second method works when running SudokuPad locally and avoids a call to the SudokuPad puzzle database. To ensure longevity of the benchmark, we provide a local usage in [`src/sudokupad_interaction`](https://github.com/SakanaAI/Sudoku-Bench/tree/main/src/sudokupad_interaction).
|
141 |
+
|
142 |
+
The `encoded_puzzle` field can be ignored if using the text-only approach outlined in `src.eval` in this repo as all relevant information has already been extracted.
|
143 |
+
|
144 |
+
## Puzzle edge cases
|
145 |
+
|
146 |
+
Because of the wide array of puzzles solved, the `ctc` subset is provided "as-is". There are a number of edge cases that make a pure text representation of the puzzle incomplete:
|
147 |
+
1. Some puzzles have visual elements that are difficult to encode in the `visual_elements` field (see below for a description of the `visual_elements` field). For example, the delightful [RatRun puzzles](https://www.youtube.com/watch?v=-KXjRMkYpA4) will not have a coherent textual description of the visual elements due to the visual complexity of the puzzle.
|
148 |
+
2. Other puzzles have the `solution` field omitted as many puzzle setters choose not to disclose the solution in SudokuPad.
|
149 |
+
3. A popular recent trend is the use of fog-of-war in Sudoku puzzles. For such puzzles, all hidden elements will be exposed in the `visual_elements` field meaning the puzzle will not be presented as intended by the puzzle setter.
|
150 |
+
|
151 |
+
Please consider filtering the `ctc` subset based on your needs.
|
152 |
+
|
153 |
+
## Citation
|
154 |
+
```bibtex
|
155 |
+
@misc{seely2025sudoku-bench,
|
156 |
+
title={{Sudoku-Bench}},
|
157 |
+
author={Seely, Jeffrey and Imajuku, Yuki and Zhao, Tianyu and Cetin, Edoardo and Jones, Llion},
|
158 |
+
howpublished = {\url{https://github.com/SakanaAI/Sudoku-Bench}},
|
159 |
+
year={2025}
|
160 |
+
}
|
161 |
+
```
|