SATQuest / README.md
sdpkjc's picture
Create README.md
789b154 verified
---
license: mit
task_categories:
- question-answering
size_categories:
- n<1K
---
# SATQuest Dataset
[![License MIT](https://img.shields.io/badge/License-MIT-green)](https://opensource.org/licenses/MIT)
[![GitHub Repo](https://img.shields.io/badge/GitHub-sdpkjc/SATQuest-181717?logo=github)](https://github.com/sdpkjc/SATQuest)
[![PyPI](https://img.shields.io/pypi/v/satquest?logo=pypi)](https://pypi.org/project/satquest/)
**TL;DR.** Synthetic CNF benchmark for LLM reasoning: **140** matched SAT/UNSAT pairs with `n in [3, 16]` and fixed ratio `m=4n`. The dataset stores only CNF formulas and solver stats; use the [`SATQuest`](https://github.com/sdpkjc/SATQuest) Python library to render prompts/answers for SATDP, SATSP, MaxSAT, MCS, and MUS in four formats (math, DIMACS, story, dual story).
## Data fields
- `id`: unique identifier for each row.
- `num_literal`: total number of literals in the unsatisfiable formula.
- `sat_dimacs`: DIMACS representation of the satisfiable CNF.
- `unsat_dimacs`: DIMACS representation of the unsatisfiable CNF.
- `num_variable`: number of variables n, between 3 and 16.
- `num_clause`: number of clauses `m` in the CNF, with `m=4n`.
- `solver_metadatas`: dictionary of PySAT solver statistics (conflicts, decisions, propagations, restarts) for SATSP, MaxSAT, MCS, MUS, SATDP_SAT and SATDP_UNSAT tasks.
## Quick usage
Install the package and load a CNF instance:
```python
from datasets import load_dataset
from satquest import CNF, create_problem, create_question
item = load_dataset('sdpkjc/SATQuest', split='test')[0]
cnf = CNF(dimacs=item['sat_dimacs'])
problem = create_problem('SATSP', cnf) # or 'SATDP', 'MaxSAT', 'MCS', 'MUS'
question = create_question('math') # or 'dimacs', 'story', 'dualstory'
prompt = problem.accept(question)
answer = problem.solution # reference answer
reward = int(problem.check(answer)) # 1 if answer is correct, 0 otherwise
```
## Reproducing the dataset
To build an identical dataset from scratch, clone the repository and run the provided generation script:
```bash
pip install datasets numpy tyro
git clone https://github.com/sdpkjc/SATQuest.git
cd SATQuest
# produce the evaluation set (140 CNF pairs)
python gen_cnf_dataset.py --hf-entity {YOUR_HF_ENTITY} --seed 9527
```
## Citation
Please cite the SATQuest paper if you use this dataset:
```bibtex
@misc{satquest2025,
author = {Yanxiao Zhao, Yaqian Li, Zihao Bo, Rinyoichi Takezoe, Haojia Hui, Mo Guang, Lei Ren, Xiaolin Qin, Kaiwen Long},
title = {SATQuest: A Verifier for Logical Reasoning Evaluation and Reinforcement Fine-Tuning of LLMs},
year = {2025},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/sdpkjc/SATQuest}},
}
```