Flow map for Sudoku-Extreme, after RL
A 7.5M-parameter discrete flow map (transformer, width 256, depth 6, 8 heads) that fills in a Sudoku grid. The clues stay fixed and the puzzle is the condition, as in Flow Reasoning Models (arXiv 2606.29150). Code: https://github.com/martindrieux/RL-for-discrete-flow-map
Training
- Pretraining: 200,000 steps (batch 128, learning rate 3e-4) on 1,000 puzzles from the Sudoku-Extreme training split (seed 1), learning to map a puzzle to its solution.
- RL: 5,000 policy-gradient steps (learning rate 3e-5). The reward is 1 if the generated grid is a valid solution and 0 otherwise. Each answer is generated from pure noise with 4 network calls; 16 answers per puzzle, baseline = mean reward of the other 15 answers. Each step samples 64 training puzzles and trains on 16 of them, putting first the puzzles whose 16 answers got different rewards.
The full settings of both stages are in config.json.
Results
Percentage of grids fully right, with 32 network calls and sampling temperature 0.1:
| Validation | Test | |
|---|---|---|
| Start of RL (pretraining step 200,000) | 21.8 | 23.5 |
| This checkpoint (end of RL) | 29.4 | 31.3 |
Validation is 1,000 other puzzles from the training split; test is a fixed subset of 1,000 puzzles from the official test split. Neither is trained on. This checkpoint was picked among our RL runs by its validation score. For reference, Flow Reasoning Models report 99.5% on this benchmark with their full method.
Use
The weights are stored as safetensors (4 files) with the settings in config.json. to_pt.py rebuilds the single checkpoint file that the repository's evaluation script reads.
pip install -U huggingface_hub safetensors
git clone https://github.com/martindrieux/RL-for-discrete-flow-map && cd RL-for-discrete-flow-map && git checkout 8c15985
hf download mdrieux/sudoku-extreme-flow-map-rl --local-dir hf_ckpt
python hf_ckpt/to_pt.py hf_ckpt sudoku_extreme_rl.pt
Build the puzzle sets from the dataset, then evaluate (expected: 31.3% on test):
hf download sapientinc/sudoku-extreme --repo-type dataset --local-dir sudoku-extreme
python -m rlfm.data.sudoku_extreme sudoku-extreme/train.csv sudoku-extreme/test.csv
python scripts/eval_passk.py fm sudoku_extreme_rl.pt K=32 zs=0 T=0.1 n=1000 S=2 split=test
- Downloads last month
- 31