RecurrReason / README.md
gmannem's picture
Update README.md
4a53451 verified
|
Raw
History Blame Contribute Delete
10.2 kB
---
license: cc-by-4.0
task_categories:
- text-generation
- question-answering
language:
- en
tags:
- reasoning
- planning
- symbolic-reasoning
- algorithmic-reasoning
- benchmark
- length-generalization
size_categories:
- 100K<n<1M
configs:
- config_name: block_world
data_files:
- split: train
path: "Block World/*_train_1_7.csv"
- split: test
path: "Block World/*_test_8_10.csv"
- config_name: checkers_jumping
data_files:
- split: train
path: "Checkers Jumping/*_train_1_7.csv"
- split: test
path: "Checkers Jumping/*_test_8_10.csv"
- config_name: tower_of_hanoi
data_files:
- split: train
path: "Tower of Hanoi/*_train_1_7.csv"
- split: test
path: "Tower of Hanoi/*_test_8_10.csv"
- split: all_1_to_20
path: "Tower of Hanoi/*_all_1_20.csv"
- config_name: river_crossing
data_files:
- split: train
path: "River Crossing/*_train_1_7.csv"
- split: test
path: "River Crossing/*_test_8_10.csv"
pretty_name: RecurrReason
---
<div align="center">
# RecurrReason: Recurrent Reasoning on Symbolic Puzzles
**A difficulty-controlled benchmark for evaluating multi-step reasoning in language models**
[![Paper](https://img.shields.io/badge/Paper-ICLR%202026-blue)](https://openreview.net/forum?id=ErgAON9dOW)
[![GitHub](https://img.shields.io/badge/GitHub-Code-green)](https://github.com/gowravmannem/Recurrent-Reasoning-on-Puzzles)
[![License](https://img.shields.io/badge/License-CC%20BY%204.0-yellow.svg)](https://creativecommons.org/licenses/by/4.0/)
[![HuggingFace](https://img.shields.io/badge/πŸ€—-Dataset-orange)](https://huggingface.co/datasets/gmannem/RecurrReason)
</div>
---
## πŸ“‹ Table of Contents
- [Overview](#overview)
- [Dataset Structure](#dataset-structure)
- [Puzzles](#puzzles)
- [Quick Start](#quick-start)
- [Citation](#citation)
- [License](#license)
---
## 🎯 Overview
RecurrReason is a benchmark of **four recurrent logic puzzles** with **optimal trajectories** and controlled difficulty scaling (N=1 to 10). It tests whether language models can:
- Find **optimal** (minimal-length) solutions
- Produce **valid** intermediate steps
- **Generalize** to harder out-of-distribution instances
| Metric | Value |
|--------|-------|
| **Total Puzzles** | 10,817 |
| **Total Moves** | 285,933 |
| **Puzzle Types** | 4 |
| **Difficulty Range** | N=1 to 10 |
Current reasoning benchmarks often test only **final answer correctness**. RecurrReason evaluates:
- **Move validity**: Are all intermediate steps legal?
- **Optimality**: Is the solution minimal-length?
- **Length generalization**: Does performance hold on longer sequences?
---
## πŸ“Š Dataset Structure
### Data Splits
| Split | N Range | Purpose |
|-------|---------|---------|
| **Train** | N=1-7 | In-distribution training data |
| **Test (OOD)** | N=8-10 | Out-of-distribution evaluation |
**Note:** We provide train and test splits. Users can create their own validation split from the training data if needed.
### File Structure
```
RecurrReason/
β”œβ”€β”€ Block World/
β”‚ β”œβ”€β”€ bw_train_1_7.csv
β”‚ └── bw_test_8_10.csv
β”œβ”€β”€ Checkers Jumping/
β”‚ β”œβ”€β”€ cj_train_1_7.csv
β”‚ └── cj_test_8_10.csv
β”œβ”€β”€ Tower of Hanoi/
β”‚ β”œβ”€β”€ toh_train_1_7.csv
β”‚ └── toh_test_8_10.csv
β”œβ”€β”€ River Crossing/
β”‚ β”œβ”€β”€ rc_train_1_7.csv
β”‚ └── rc_test_8_10.csv
└── README.md (this file)
```
---
## 🧩 Puzzles
RecurrReason contains four diverse logic puzzles with different structural properties:
| Puzzle | Difficulty | Solution Length | Transition Locality | Puzzles | Moves |
|--------|-----------|-----------------|---------------------|---------|-------|
| **[Block World](BLOCK_WORLD.md)** | ⭐⭐ | O(N) | O(1) | 849 | 5,827 |
| **[Checkers Jumping](CHECKERS_JUMPING.md)** | ⭐⭐⭐ | (N+1)Β²βˆ’1 | O(N) | 5,700 | 242,494 |
| **[Tower of Hanoi](TOWER_OF_HANOI.md)** | ⭐⭐⭐⭐⭐ | 2^Nβˆ’1 | O(N) | 60 | 12,216 |
| **[River Crossing](RIVER_CROSSING.md)** | ⭐⭐⭐⭐ | Variable | O(N) global | 4,208 | 25,396 |
Click on each puzzle name for detailed documentation including:
- Puzzle rules and constraints
- State representation format
- Example trajectories
- Column descriptions
### Quick Puzzle Descriptions
<details>
<summary><b>Block World</b> - Rearrange blocks in stacks</summary>
**Goal:** Move blocks from initial configuration to target configuration.
**Rules:**
- Only top block of a stack can be moved
- Can place on empty stack or on top of another block
**Why interesting:** O(1) transition locality makes it learnable and tests dependency reasoning.
[β†’ Full documentation](BLOCK_WORLD.md)
</details>
<details>
<summary><b>Checkers Jumping</b> - Swap red and blue checkers</summary>
**Goal:** Swap N red and N blue checkers on a 1D board with one empty space between them.
**Rules:**
- Red moves only right, blue only left (and vice versa based on starting configuration)
- Can slide to adjacent empty space or jump over opposite color
**Why interesting:** Quadratic solution length and tests avoiding dead-end configurations.
[β†’ Full documentation](CHECKERS_JUMPING.md)
</details>
<details>
<summary><b>Tower of Hanoi</b> - Transfer disks between pegs</summary>
**Goal:** Move N disks from source peg to target peg across 3 pegs.
**Rules:**
- Move one disk at a time
- Only topmost disk can be moved
- Larger disk cannot be on top of a smaller disk
**Why interesting:** Exponential solution length (2^Nβˆ’1). It is a classic recursive problem.
[β†’ Full documentation](TOWER_OF_HANOI.md)
</details>
<details>
<summary><b>River Crossing</b> - Transport agents safely</summary>
**Goal:** Transport N actor-agent pairs across river using boat with capacity k.
**Rules:**
- Boat holds at most k individuals
- Actor aᡒ cannot be with agent Aⱼ (j≠i) unless agent Aᡒ is present
**Why interesting:** Global O(N) constraint verification and tests constraint satisfaction.
[β†’ Full documentation](RIVER_CROSSING.md)
</details>
---
## πŸš€ Quick Start
### Installation
```bash
pip install datasets
```
### Loading the Dataset
```python
from datasets import load_dataset
# Load a specific puzzle
dataset = load_dataset("gmannem/RecurrReason", "block_world")
# Access splits
train_data = dataset["train"] # N=1-7
test_data = dataset["test"] # N=8-10 (OOD)
# Iterate over examples
for example in train_data:
print(f"Difficulty N={example['N']}")
print(f"Current state: {example['current_state']}")
print(f"Next state: {example['next_state']}")
print(f"Move: {example['move']}")
print("---")
break
```
### Loading All Puzzles
```python
from datasets import load_dataset
puzzles = ["block_world", "checkers_jumping", "tower_of_hanoi", "river_crossing"]
datasets = {
puzzle: load_dataset("gmannem/RecurrReason", puzzle)
for puzzle in puzzles
}
# Access specific puzzle
bw_train = datasets["block_world"]["train"]
```
### Example: Evaluating a Model
```python
from datasets import load_dataset
# Load test data (OOD, N=8-10)
test_data = load_dataset("gmannem/RecurrReason", "block_world", split="test")
def evaluate_model(model, test_data):
"""
Evaluate model on RecurrReason benchmark.
Metrics:
- Success rate: % of puzzles solved correctly
- Move validity: % of generated moves that are legal
- Optimality gap: (model_length - optimal_length) / optimal_length
"""
success_count = 0
for example in test_data:
# Your model prediction logic here
predicted_next_state = model.predict(
current_state=example['current_state'],
goal_state=example['goal_state']
)
# Check if prediction matches ground truth
if predicted_next_state == example['next_state']:
success_count += 1
success_rate = success_count / len(test_data)
print(f"Success Rate: {success_rate:.2%}")
return success_rate
```
---
## πŸ“„ Paper & Code
**"Recurrent Reasoning on Symbolic Puzzles with Sequence Models"**
Gowrav Mannem, Chowdhury Marzia Mahjabin, Jason Chen, Shivank Garg, Kevin Zhu
*ICLR 2026 Workshop on Logical Reasoning of Large Language Models*
πŸ”— [Read on OpenReview](https://openreview.net/forum?id=ErgAON9dOW)
πŸ“„ [PDF](https://openreview.net/pdf?id=ErgAON9dOW)
πŸ”— [GitHub Repository](https://github.com/gowravmannem/Recurrent-Reasoning-on-Puzzles)
---
## πŸ“– Citation
If you use RecurrReason in your research, please cite the following papers. This benchmark extends the puzzles introduced by Shojaee et al. (2025) with BFS-optimal trajectories, permutation augmentations, and systematic difficulty scaling.
```bibtex
@inproceedings{mannem2026recurrent,
title={Recurrent Reasoning on Symbolic Puzzles with Sequence Models},
author={Gowrav Mannem and Chowdhury Marzia Mahjabin and Jason Chen and Shivank Garg and Kevin Zhu},
booktitle={ICLR 2026 Workshop on Logical Reasoning of Large Language Models},
year={2026},
url={https://openreview.net/forum?id=ErgAON9dOW}
}
@article{shojaee2025illusion,
title={The illusion of thinking: Understanding the strengths and limitations of reasoning models via the lens of problem complexity},
author={Shojaee, Parshin and Mirzadeh, Iman and Alizadeh, Keivan and Horton, Maxwell and Bengio, Samy and Farajtabar, Mehrdad},
journal={arXiv preprint arXiv:2506.06941},
year={2025}
}
```
---
## πŸ“œ License
This dataset is licensed under the **Creative Commons Attribution 4.0 International License (CC BY 4.0)**.
**You are free to:**
- Share β€” copy and redistribute the dataset
- Adapt β€” remix, transform, and build upon the dataset
- For any purpose, even commercially
**Under the following terms:**
- **Attribution** β€” You must give appropriate credit by citing our paper
Full license text: https://creativecommons.org/licenses/by/4.0/
---
## 🀝 Contributing
Found an issue or have suggestions? Please:
1. Open an issue on [GitHub](https://github.com/gowravmannem/Recurrent-Reasoning-on-Puzzles/issues)
2. Use the "Discussions" tab on HuggingFace
3. Contact us at: gowravmannem@gmail.com
---
<div align="center">
**Built with ❀️ for the AI reasoning research community**
</div>