Datasets:

Languages:
English
ArXiv:
License:
CFRL-data / README.md
jiajinghu19's picture
card: self-contained download + load example
bfd0f82 verified
|
Raw History Blame Contribute Delete
7.59 kB
metadata
pretty_name: CFRL reasoning tasks (Countdown, Game24, Sudoku, Knights-and-Knaves)
license: other
license_name: mit-with-upstream-terms
license_link: LICENSE
language:
  - en
task_categories:
  - text-generation
size_categories:
  - 1M<n<10M
tags:
  - reasoning
  - program-verified
  - countdown
  - game24
  - sudoku
  - knights-and-knaves
  - flow-matching

CFRL reasoning tasks

The four program-verified reasoning datasets of the paper CFRL (reinforcement learning for continuous flow language models), in the exact form used to fine-tune and evaluate the ELF-B checkpoints at tufts-ml/CFRL. Every prompt has a program verifier that decides whether a model output is correct without reference to the stored answer, so rewards are exact and label-free.

task train valid (held out) prompt response
countdown 500,000 2,000 four or five integers and a target, e.g. 12 5 4 3 -> 25 a chain of equations, e.g. 12-5=7 , 4*7=28 , 28-3=25
game24 13,150 1,601 four numbers in 1..13, target 24 a chain of equations reaching 24
sudoku 400,000 2,000 the 81 cells of the puzzle, * for blanks all 81 cells of the solution
kk 300,000 2,000 one statement per character, 4 to 6 characters the knight/knave assignment

The valid split holds the held-out prompts of the paper. They are split by index into a validation half (even indices, used to select checkpoints) and a test half (odd indices, on which every reported accuracy is measured). Game24 is split by number set: no held-out number set appears in training in any order.

Format

Each split is a Hugging Face datasets folder written with Dataset.save_to_disk (Arrow). Download the repository and load a split with datasets.load_from_disk (load_dataset does not read this format):

from huggingface_hub import snapshot_download
from datasets import load_from_disk

root = snapshot_download("tufts-ml/CFRL-data", repo_type="dataset")   # all four tasks, 850 MB
ds = load_from_disk(f"{root}/countdown/train")
print(ds[0]["input"], "||", ds[0]["target"])

To fetch a single task, pass allow_patterns="countdown/*" to snapshot_download.

Columns shared by all tasks: input and target (the raw strings), condition_input_ids and input_ids (the T5-small token ids of prompt and response, each followed by EOS, as the ELF models consume them). Countdown and Game24 add nums, tgt and n_nums; Knights-and-Knaves adds n_nums (the number of characters); Sudoku adds rating, clues and source carried over from the upstream collection; the valid splits carry index.

To use the files with the CFRL code release, download them into its data/ folder:

hf download tufts-ml/CFRL-data --repo-type dataset --local-dir data

Where the data comes from

Countdown, Game24 and Knights-and-Knaves are generated by the CFRL code (cfrl/tasks/build_*.py in the release) with seeded Python generators and no external input. The task formulations follow earlier work:

  • Countdown follows the formulation of Stream of Search (Gandhi et al., 2024): random integers in 1..99, a target in 10..100, and a derivation as a sequence of binary operations. One random valid derivation per problem is stored as the supervised target; the verifier accepts any valid derivation.
  • Game24 follows the Game of 24 of Tree of Thoughts (Yao et al., 2023): reach 24 from four numbers in 1..13, each used once. All 1,345 solvable unordered number sets were enumerated and split by set.
  • Knights-and-Knaves follows Xie et al. (2024): each of 4 to 6 characters makes one statement ("A: C knave", "B: A same C", "C: D diff B"); only puzzles with a unique solution are kept. The generator and the compact statement format are the release's own.

Sudoku is derived from a third-party collection. The puzzles and solutions are taken from sapientinc/sudoku-extreme, the "Hardest Sudoku Puzzle Dataset V2" released by Sapient Intelligence with the Hierarchical Reasoning Model (Wang et al., 2025). That collection combines puzzles from the tdoku benchmark sets and the enjoysudoku forum, exact-deduplicated and randomly permuted, with a difficulty rating from the tdoku solver. Our train split is 400,000 puzzles sampled from its train.csv and our valid split 2,000 puzzles sampled from its test.csv, so the two remain mathematically inequivalent as in the upstream collection. The rating, clues and source columns are the upstream fields. The upstream dataset card states no license; the Sudoku splits here are redistributed under the upstream collection's terms, whatever they are, and the MIT license of this repository covers only the generated tasks and the packaging.

Token ids were produced with the T5-small tokenizer (Raffel et al., 2020), the encoder of ELF (Hu et al., 2026).

Reproducing the splits

scripts/prepare_data.sh in the code release regenerates the Countdown splits and the Sudoku train split byte-for-byte. The remaining splits were produced by the same builders with different seeds or ordering than the script states (Sudoku valid: seed 1; Knights-and-Knaves valid: seed 11, and train: seed 0 excluding the valid prompts), and the Game24 split keeps a subset of the orderings of each training set. The files in this repository are therefore the canonical splits; treat the script as documentation of the generators.

Citation

If you use this data, please cite the CFRL paper and the sources of the tasks:

@article{gandhi2024sos,
  title={Stream of Search ({SoS}): Learning to Search in Language},
  author={Gandhi, Kanishk and Lee, Denise and Grand, Gabriel and Liu, Muxin and Cheng, Winson and Sharma, Archit and Goodman, Noah D.},
  journal={arXiv preprint arXiv:2404.03683}, year={2024}}
@article{yao2023tot,
  title={Tree of Thoughts: Deliberate Problem Solving with Large Language Models},
  author={Yao, Shunyu and Yu, Dian and Zhao, Jeffrey and Shafran, Izhak and Griffiths, Thomas L. and Cao, Yuan and Narasimhan, Karthik},
  journal={arXiv preprint arXiv:2305.10601}, year={2023}}
@article{xie2024kk,
  title={On Memorization of Large Language Models in Logical Reasoning},
  author={Xie, Chulin and Huang, Yangsibo and Zhang, Chiyuan and Yu, Da and Chen, Xinyun and Lin, Bill Yuchen and Li, Bo and Ghazi, Badih and Kumar, Ravi},
  journal={arXiv preprint arXiv:2410.23123}, year={2024}}
@article{wang2025hrm,
  title={Hierarchical Reasoning Model},
  author={Wang, Guan and Li, Jin and Sun, Yuhao and Chen, Xing and Liu, Changling and Wu, Yue and Lu, Meng and Song, Sen and Abbasi Yadkori, Yasin},
  journal={arXiv preprint arXiv:2506.21734}, year={2025}}
@misc{sudokuextreme,
  title={Hardest Sudoku Puzzle Dataset V2 (sudoku-extreme)}, author={Sapient Intelligence},
  howpublished={\url{https://huggingface.co/datasets/sapientinc/sudoku-extreme}}}
@article{hu2026elf,
  title={{ELF}: Embedded Language Flows},
  author={Hu, Keya and Qiu, Linlu and Lu, Yiyang and Zhao, Hanhong and Li, Tianhong and Kim, Yoon and Andreas, Jacob and He, Kaiming},
  journal={arXiv preprint arXiv:2605.10938}, year={2026}}
@article{cfrl2026,
  title={CFRL: Reinforcement Learning for Continuous Flow Language Models},
  year={2026}}