--- 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 [![GitHub](https://img.shields.io/badge/Code-GitHub-blue)](https://github.com/ml-research/ScalableLogicalReasoning) [![arXiv](https://img.shields.io/badge/arXiv-2506.15787-b31b1b.svg)](https://arxiv.org/abs/2506.15787) [![Original SLR-Bench](https://img.shields.io/badge/SLR--Bench-Original-orange)](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.