ahmad21omar commited on
Commit
79437ef
·
verified ·
1 Parent(s): 1ddd72b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +203 -0
README.md CHANGED
@@ -33,3 +33,206 @@ configs:
33
  - split: test
34
  path: data/test-*
35
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  - split: test
34
  path: data/test-*
35
  ---
36
+ ## Dataset Description
37
+ - **Language(s) (NLP):** English
38
+ - **Point of Contact:** [Ahmad Omar](mailto:ahmad.omar@example.com)
39
+ - **License:** [CC BY](https://creativecommons.org/licenses/by/4.0/)
40
+
41
+ # House-Classification-Benchmark: An Example Benchmark Created with SLR
42
+
43
+ [![GitHub](https://img.shields.io/badge/Code-GitHub-blue)](https://github.com/ml-research/ScalableLogicalReasoning)
44
+ [![arXiv](https://img.shields.io/badge/arXiv-2506.15787-b31b1b.svg)](https://arxiv.org/abs/2506.15787)
45
+ [![Original SLR-Bench](https://img.shields.io/badge/SLR--Bench-Original-orange)](https://huggingface.co/datasets/AIML-TUDA/SLR-Bench)
46
+
47
+ > **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.
48
+
49
+ **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.
50
+
51
+ ## About SLR
52
+
53
+ The [SLR framework](https://github.com/ml-research/ScalableLogicalReasoning) enables automatic generation of logical reasoning tasks with controllable complexity, making it easy to:
54
+ - 🔨 **Generate custom reasoning tasks** in any domain with your own predicates and constants
55
+ - 🧩 **Control task difficulty** through systematic complexity scaling
56
+ - 🧠 **Evaluate LLMs symbolically** using deterministic validation programs
57
+ - 📈 **Build curriculum learning benchmarks** tailored to your specific domain
58
+
59
+ This House-Classification-Benchmark serves as a practical example of how to use SLR for creating domain-specific benchmarks.
60
+
61
+ ---
62
+
63
+ ## Benchmark Overview
64
+
65
+ - **Domain:** House classification (modern vs. traditional)
66
+ - **Structure:** Houses composed of multiple Rooms with various attributes
67
+ - **Curriculum:** 10 complexity levels (level 1-10)
68
+ - **Tasks per level:** 50 test instances
69
+ - **Total tasks:** 500 instances
70
+ - **Predicates:** 7 room attributes (wall_color, roof_type, garden, garage, window type, window count, room number)
71
+ - **Application:** Evaluate LLMs on house classification logical reasoning tasks
72
+
73
+ ---
74
+
75
+ ## Benchmark Structure
76
+
77
+ ### Levels 1-10
78
+ The benchmark progressively increases in complexity across 10 levels:
79
+
80
+ - **Level 1:** Simple rules with minimal predicates, small problem sizes (few rooms per house)
81
+ - **Levels 2-4:** Gradual increase in rule complexity and number of rooms per house
82
+ - **Levels 5-7:** Introduction of more complex logical combinations across multiple room attributes
83
+ - **Levels 8-10:** Advanced reasoning with longer rules, more rooms, and larger problem sizes
84
+
85
+ Each level systematically varies:
86
+ - **Rule length:** Number of predicates in the ground-truth rule
87
+ - **Problem size:** Number of positive and negative house examples
88
+ - **Room complexity:** Number of rooms per house and their attribute diversity
89
+ - **Background sampling:** Distribution strategy for room attributes
90
+
91
+ ---
92
+
93
+ ## Quick Start
94
+
95
+ ### Loading the Dataset
96
+ ```python
97
+ from datasets import load_dataset
98
+
99
+ # Load a specific level (e.g., level 1)
100
+ ds = load_dataset("ahmad21omar/House-Classification-Benchmark")
101
+
102
+ # Access the test split
103
+ test_data = ds["test"]
104
+
105
+ ```
106
+
107
+ ### Evaluate using SLR's Symbolic Judge
108
+ Requires the [`evaluate`](https://huggingface.co/docs/evaluate/) library and a Prolog interpreter (e.g., [SWI-Prolog](https://www.swi-prolog.org/)).
109
+
110
+ ```bash
111
+ pip install evaluate
112
+ sudo apt-get install swi-prolog
113
+ ```
114
+
115
+ #### Example Usage
116
+
117
+ ```python
118
+ from evaluate import load
119
+
120
+ # Load the symbolic judge
121
+ symbolic_judge = load("AIML-TUDA/VerifiableRewardsForScalableLogicalReasoning")
122
+
123
+ # Example: evaluate ground-truth rules (replace with model predictions)
124
+ rules = test_data["ground-truth rule"] # Your model's predicted rules
125
+ references = [
126
+ {
127
+ "validation_program": p,
128
+ "evaluation_config": {
129
+ "positive_predicate": "modern",
130
+ "negative_predicate": "traditional"
131
+ }
132
+ } for p in test_data["validation program"]
133
+ ]
134
+
135
+ results = symbolic_judge.compute(predictions=rules, references=references)
136
+ print(f"Accuracy: {results['accuracy']:.2%}")
137
+ ```
138
+
139
+ ## House Domain Predicates
140
+
141
+ The benchmark uses the following predicates to describe houses and their rooms:
142
+
143
+ - **has_room(House, Room):** Specifies that Room is part of the House. Room identifiers: room0_1, room0_2, room1_1, room1_2, etc.
144
+ - **room_num(Room, Room_number):** Position/number of the room within the house. Values: 1, 2, 3, ...
145
+ - **has_wall_color(Room, Color):** Wall color of the room. Values: 'red', 'blue', 'green', 'yellow', 'white'
146
+ - **has_roof_type(Room, Roof_type):** Type of roof. Values: 'flat', 'gabled', 'hipped', 'none'
147
+ - **has_garden(Room, Garden_type):** Garden type associated with the room. Values: 'flower', 'vegetable', 'herb', 'none'
148
+ - **has_garage(Room, Garage_type):** Garage type. Values: 'attached', 'detached', 'none'
149
+ - **has_window(Room, Window_type):** Window type. Values: 'bay', 'casement', 'sliding', 'none'
150
+ - **window_num(Room, Number_of_windows):** Number of windows in the room. Values: 0, 1, 2, 3, 4
151
+
152
+ ---
153
+
154
+ ## Example Task
155
+
156
+ ### Prompt:
157
+ ```
158
+ You are a classifier for a logical reasoning task. Each House is composed of one or more Rooms,
159
+ and each Room is characterized by a set of properties, represented as ground atoms over a fixed
160
+ set of predicates. The label (modern or traditional) of a House is to be determined from its composition.
161
+
162
+ To describe the Houses we define a set of predicates and grounding domains:
163
+ - 'has_room(House, Room)': Room can be room0_1, room0_2, room1_1, room1_2.
164
+ - 'room_num(Room, Room_number)': Room_number can be 1, 2.
165
+ - 'has_wall_color(Room, Color)': Color can be red, blue, green, yellow, white.
166
+ - 'has_roof_type(Room, Roof_type)': Roof_type can be flat, gabled, hipped, none.
167
+ - 'has_garden(Room, Garden_type)': Garden_type can be flower, vegetable, herb, none.
168
+ - 'has_garage(Room, Garage_type)': Garage_type can be attached, detached, none.
169
+ - 'has_window(Room, Window_type)': Window_type can be bay, casement, sliding, none.
170
+ - 'window_num(Room, Number_of_windows)': Number_of_windows can be 0, 1, 2, 3, 4.
171
+
172
+ You are provided with positive and negative examples in the form of modern(t) or traditional(t)
173
+ for each House t, together with background knowledge consisting of ground facts over the above
174
+ predicates which describe its composition.
175
+
176
+ modern(house0).
177
+ has_room(house0, room0_1).
178
+ room_num(room0_1, 1).
179
+ has_wall_color(room0_1, blue).
180
+ has_roof_type(room0_1, gabled).
181
+ has_garden(room0_1, flower).
182
+ has_garage(room0_1, none).
183
+ has_window(room0_1, bay).
184
+ window_num(room0_1, 3).
185
+
186
+ traditional(house1).
187
+ has_room(house1, room1_1).
188
+ room_num(room1_1, 1).
189
+ has_wall_color(room1_1, red).
190
+ has_roof_type(room1_1, flat).
191
+ has_garden(room1_1, none).
192
+ has_garage(room1_1, detached).
193
+ has_window(room1_1, casement).
194
+ window_num(room1_1, 2).
195
+
196
+ Your task: Formulate a hypothesis as a Prolog rule 'modern(House) :- Body.'
197
+ that correctly separates modern from traditional houses.
198
+ ```
199
+
200
+ ### Solution Example:
201
+ ```prolog
202
+ modern(House) :- has_room(House, Room), has_garden(Room, flower).
203
+ ```
204
+
205
+ ---
206
+
207
+ ## Creating Your Own Benchmark with SLR
208
+
209
+ This benchmark was generated using the [SLR framework](https://github.com/ml-research/ScalableLogicalReasoning). You can create your own domain-specific benchmarks by:
210
+
211
+ 1. **Define your domain vocabulary:** Specify predicates and constants relevant to your task (e.g., houses, rooms, attributes)
212
+ 2. **Configure complexity levels:** Set parameters for rule length, problem size, and sampling strategies
213
+ 3. **Generate tasks:** Use SLR's automatic generation pipeline
214
+ 4. **Evaluate models:** Apply the symbolic judge for deterministic evaluation
215
+
216
+ Visit the [SLR GitHub repository](https://github.com/ml-research/ScalableLogicalReasoning) for detailed instructions and code examples.
217
+
218
+
219
+ ## Citation
220
+
221
+ If you use this benchmark, please cite the original SLR framework:
222
+
223
+ ```bibtex
224
+ @incollection{helff2025slrautomatedsynthesisscalable,
225
+ title={SLR: Automated Synthesis for Scalable Logical Reasoning},
226
+ 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},
227
+ year={2025},
228
+ booktitle={Working Notes of the NeurIPS Workshop on Foundations of Reasoning in Language Models},
229
+ url={https://arxiv.org/abs/2506.15787},
230
+ }
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Acknowledgements
236
+
237
+ 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.
238
+