File size: 10,488 Bytes
5ea1274 1ddd72b 5ea1274 48144e5 5ea1274 1ddd72b 5ea1274 48144e5 5ea1274 79437ef 2431a81 79437ef 2431a81 79437ef 2431a81 79437ef 2431a81 79437ef 2431a81 79437ef 2431a81 79437ef |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
---
dataset_info:
features:
- name: id
dtype: int64
- name: prompt
dtype: string
- name: ground-truth rule
dtype: string
- name: validation program
dtype: string
- name: level
dtype: int64
- name: num_houses
dtype: int64
- name: num_rooms
dtype: int64
- name: rule_length
dtype: int64
- name: kappa_positive
dtype: int64
- name: kappa_negative
dtype: int64
splits:
- name: test
num_bytes: 5077597
num_examples: 500
download_size: 929834
dataset_size: 5077597
configs:
- config_name: default
data_files:
- split: test
path: data/test-*
---
## Dataset Description
- **Language(s) (NLP):** English
- **Point of Contact:** [Ahmad Omar](mailto:ahmad.omar@example.com)
- **License:** [CC BY](https://creativecommons.org/licenses/by/4.0/)
# House-Classification-Benchmark: An Example Benchmark Created with SLR
[](https://github.com/ml-research/ScalableLogicalReasoning)
[](https://arxiv.org/abs/2506.15787)
[](https://huggingface.co/datasets/AIML-TUDA/SLR-Bench)
> **Demonstrate the flexibility of SLR:** This benchmark showcases how the [SLR framework](https://github.com/ml-research/ScalableLogicalReasoning) can be used to create custom logical reasoning benchmarks beyond the train classification domain.
**House-Classification-Benchmark** is an example benchmark demonstrating the capabilities of the SLR (Scalable Logical Reasoning) framework to generate domain-specific inductive logic programming tasks. Instead of classifying trains (as in the original SLR-Bench), this benchmark focuses on classifying houses as **modern** or **traditional** based on their room composition and attributes such as wall color, roof type, garden type, garage type, window type, and number of windows.
## About SLR
The [SLR framework](https://github.com/ml-research/ScalableLogicalReasoning) enables automatic generation of logical reasoning tasks with controllable complexity, making it easy to:
- 🔨 **Generate custom reasoning tasks** in any domain with your own predicates and constants
- 🧩 **Control task difficulty** through systematic complexity scaling
- 🧠 **Evaluate LLMs symbolically** using deterministic validation programs
- 📈 **Build curriculum learning benchmarks** tailored to your specific domain
This House-Classification-Benchmark serves as a practical example of how to use SLR for creating domain-specific benchmarks.
---
## Benchmark Overview
- **Domain:** House classification (modern vs. traditional)
- **Structure:** Houses composed of multiple Rooms with various attributes
- **Curriculum:** 10 complexity levels (level 1-10)
- **Tasks per level:** 50 test instances
- **Total tasks:** 500 instances
- **Predicates:** 7 room attributes (wall_color, roof_type, garden, garage, window type, window count, room number)
- **Application:** Evaluate LLMs on house classification logical reasoning tasks
---
## Benchmark Structure
### Levels 1-10
The benchmark progressively increases in complexity across 10 levels:
- **Level 1:** Simple rules with minimal predicates, small problem sizes (few rooms per house)
- **Levels 2-4:** Gradual increase in rule complexity and number of rooms per house
- **Levels 5-7:** Introduction of more complex logical combinations across multiple room attributes
- **Levels 8-10:** Advanced reasoning with longer rules, more rooms, and larger problem sizes
Each level systematically varies:
- **Rule length:** Number of predicates in the ground-truth rule
- **Problem size:** Number of positive and negative house examples
- **Room complexity:** Number of rooms per house and their attribute diversity
- **Background sampling:** Distribution strategy for room attributes
---
## Quick Start
### Loading the Dataset
```python
from datasets import load_dataset
# Load a specific level (e.g., level 1)
ds = load_dataset("ahmad21omar/House-Classification-Benchmark")
# Access the test split
test_data = ds["test"]
```
### Evaluate using SLR's Symbolic Judge
Requires the [`evaluate`](https://huggingface.co/docs/evaluate/) library and a Prolog interpreter (e.g., [SWI-Prolog](https://www.swi-prolog.org/)).
```bash
pip install evaluate
sudo apt-get install swi-prolog
```
#### Example Usage
```python
from evaluate import load
# Load the symbolic judge
symbolic_judge = load("AIML-TUDA/VerifiableRewardsForScalableLogicalReasoning")
# Example: evaluate ground-truth rules (replace with model predictions)
rules = test_data["ground-truth rule"] # Your model's predicted rules
references = [
{
"validation_program": p,
"evaluation_config": {
"positive_predicate": "modern",
"negative_predicate": "traditional"
}
} for p in test_data["validation program"]
]
results = symbolic_judge.compute(predictions=rules, references=references)
print(f"Accuracy: {results['accuracy']:.2%}")
```
## House Domain Predicates
The benchmark uses the following predicates to describe houses and their rooms:
- **has_room(House, Room):** Specifies that Room is part of the House. Room identifiers: room0_1, room0_2, room1_1, room1_2, etc.
- **room_num(Room, Room_number):** Position/number of the room within the house. Values: 1, 2, 3, ...
- **has_wall_color(Room, Color):** Wall color of the room. Values: 'red', 'blue', 'green', 'yellow', 'white'
- **has_roof_type(Room, Roof_type):** Type of roof. Values: 'flat', 'gabled', 'hipped', 'none'
- **has_garden(Room, Garden_type):** Garden type associated with the room. Values: 'flower', 'vegetable', 'herb', 'none'
- **has_garage(Room, Garage_type):** Garage type. Values: 'attached', 'detached', 'none'
- **has_window(Room, Window_type):** Window type. Values: 'bay', 'casement', 'sliding', 'none'
- **window_num(Room, Number_of_windows):** Number of windows in the room. Values: 0, 1, 2, 3, 4
---
## Example Task
### Prompt:
```
You are a classifier for a logical reasoning task. Each House is composed of one or more Rooms, and each Room is characterized by a set of properties, represented as ground atoms over a fixed set of predicates.
The label (modern or traditional) of a House is to be determined from its composition.
To describe the Houses we define a set of predicates and grounding domains:
- 'has_room(House, Room)': Room can be room0_1, room0_2, room1_1, room1_2.
- 'room_num(Room, Room_number)': Room_number can be 1, 2.
- 'has_wall_color(Room, Color)': Color can be red, blue, green, yellow, white.
- 'has_roof_type(Room, Roof_type)': Roof_type can be flat, gabled, hipped, none.
- 'has_garden(Room, Garden_type)': Garden_type can be flower, vegetable, herb, none.
- 'has_garage(Room, Garage_type)': Garage_type can be attached, detached, none.
- 'has_window(Room, Window_type)': Window_type can be bay, casement, sliding, none.
- 'window_num(Room, Number_of_windows)': Number_of_windows can be 0, 1, 2, 3, 4.
You are provided with positive and negative examples in the form of modern(t) or traditional(t) for each House t, together with background knowledge consisting of ground facts over the above predicates which describe its composition.
modern(house0).
has_room(house0, room0_1).
room_num(room0_1, 1).
has_wall_color(room0_1, red).
has_roof_type(room0_1, none).
has_garden(room0_1, flower).
has_garage(room0_1, none).
has_window(room0_1, none).
window_num(room0_1, 0).
has_room(house0, room0_2).
room_num(room0_2, 2).
has_wall_color(room0_2, green).
has_roof_type(room0_2, gabled).
has_garden(room0_2, none).
has_garage(room0_2, attached).
has_window(room0_2, sliding).
window_num(room0_2, 1).
traditional(house1).
has_room(house1, room1_1).
room_num(room1_1, 1).
has_wall_color(room1_1, red).
has_roof_type(room1_1, flat).
has_garden(room1_1, flower).
has_garage(room1_1, none).
has_window(room1_1, none).
window_num(room1_1, 0).
has_room(house1, room1_2).
room_num(room1_2, 2).
has_wall_color(room1_2, green).
has_roof_type(room1_2, gabled).
has_garden(room1_2, none).
has_garage(room1_2, attached).
has_window(room1_2, sliding).
window_num(room1_2, 1).
Your task is to formulate a hypothesis in form of a prolog rule of the form 'modern(T) :- Body.' that correctly distinguishes modern from traditional Houses. The hypothesis must be true for all positive examples (i.e., Houses labeled as modern) and false for all negative examples (i.e., Houses labeled as traditional). Aim to find the shortest correct rule, that is, one that uses the fewest possible body literals without loss of conditions. Your rule must use only the predicates defined in the grammar above and must perfectly separate modern from traditional Houses.
```
### Solution Example:
```prolog
modern(House):- has_room(House, Room1), has_roof_type(Room1, none).
```
---
## Creating Your Own Benchmark with SLR
This benchmark was generated using the [SLR framework](https://github.com/ml-research/ScalableLogicalReasoning). You can create your own domain-specific benchmarks by:
1. **Define your domain vocabulary:** Specify predicates and constants relevant to your task (e.g., houses, rooms, attributes)
2. **Configure complexity levels:** Set parameters for rule length, problem size, and sampling strategies
3. **Generate tasks:** Use SLR's automatic generation pipeline
4. **Evaluate models:** Apply the symbolic judge for deterministic evaluation
Visit the [SLR GitHub repository](https://github.com/ml-research/ScalableLogicalReasoning) for detailed instructions and code examples.
## Citation
If you use this benchmark, please cite the original SLR framework:
```bibtex
@incollection{helff2025slrautomatedsynthesisscalable,
title={SLR: Automated Synthesis for Scalable Logical Reasoning},
author={Lukas Helff and Ahmad Omar and Felix Friedrich and Antonia Wüst and Hikaru Shindo and Rupert Mitchell and Tim Woydt and Patrick Schramowski and Wolfgang Stammer and Kristian Kersting},
year={2025},
booktitle={Working Notes of the NeurIPS Workshop on Foundations of Reasoning in Language Models},
url={https://arxiv.org/abs/2506.15787},
}
```
---
## Acknowledgements
This benchmark was created using the [SLR framework](https://github.com/ml-research/ScalableLogicalReasoning) developed by the AIML Lab at TU Darmstadt. Special thanks to Lukas Helff for the original SLR-Bench inspiration.
|