philippds commited on
Commit
b3aad44
·
verified ·
1 Parent(s): 87225fd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +137 -11
README.md CHANGED
@@ -68,20 +68,123 @@ configs:
68
 
69
  ![SPhyR](sources/thumbnail.png)
70
 
71
- # How to Evaluate
72
 
73
- - Evaluation code: https://github.com/philippds/SPhyR/blob/main/run_eval.py
74
- - Prompt template: https://github.com/philippds/SPhyR/blob/main/prompt_templates.py
 
75
 
76
- # Subjects
77
 
78
- Legend:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
  - `L` - Load
81
  - `S` - Support
82
  - `V` - Void
83
 
84
- ## Easy
 
 
85
 
86
  Note: Here we use 0 and 1 for material distribution
87
 
@@ -96,7 +199,7 @@ Note: Here we use 0 and 1 for material distribution
96
  full_easy
97
  ```
98
 
99
- ## Hard
100
 
101
  Note: Here we use floating point numbers 0-1 for material distribution
102
 
@@ -111,10 +214,33 @@ Note: Here we use floating point numbers 0-1 for material distribution
111
  full_hard
112
  ```
113
 
114
- ## 🔁 How to Re-Generate the Dataset
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
- Please refer to the dataset repository on GitHub if you want to re-generate the dataset or interested in how this has been done: https://github.com/philippds/SPhyR
117
 
118
- ## Paper
119
 
120
- https://arxiv.org/abs/2505.16048
 
68
 
69
  ![SPhyR](sources/thumbnail.png)
70
 
71
+ # 🧠 SPhyR-Quick-Start
72
 
73
+ 🦾 [Code](https://github.com/philippds/SPhyR)<br>
74
+ 📄 [Paper](https://arxiv.org/pdf/2505.16048)<br>
75
+ 🧰 [Prompt Template](https://github.com/philippds/SPhyR/blob/main/prompt_templates.py)<br>
76
 
77
+ ## Prompt Template:
78
 
79
+ <pre style="white-space: pre-wrap;">
80
+ You are given a structural material distribution represented as a grid. Each cell can have one of the following states:
81
+ - 'L' indicates applied load.
82
+ - 'V' indicates void.
83
+ - 'S' indicates support.
84
+
85
+ The goal is to predict the correct material distribution by filling in all <span style="font-weight: 1000;">{FILL_INSTRUCTION}</span>, based on the surrounding structure and implicit physical reasoning (such as load paths, supports, and forces).
86
+
87
+ Important: The completed structure should use as little material as possible while remaining stable and plausible for carrying the applied forces. Minimize material usage unless necessary for structural support.
88
+
89
+ Below is the input grid with masked regions:
90
+
91
+ <span style="font-weight: 1000;">{GRID}</span>
92
+
93
+ Please output the completed grid by replacing all <span style="font-weight: 1000;">{FILL_INSTRUCTION}</span>.
94
+ Maintain the same format as the input: one row per line, cells separated by spaces, and the total number of rows and columns unchanged.
95
+ Return only the completed grid without any additional explanation.
96
+ </pre>
97
+
98
+
99
+ For easy difficulty use <span style="font-weight: 1000;">{FILL_INSTRUCTION}</span>: `'V' cells with either '1' (solid) or '0' (empty)`<br>
100
+ or for hard difficulty use <span style="font-weight: 1000;">{FILL_INSTRUCTION}</span>: `'V' cells with a floating point number between 0 and 1, with one decimal place (e.g., 0.0, 0.1, 0.2, ..., 1.0)`<br>
101
+
102
+ Replace <span style="font-weight: 1000;">{GRID}</span> with data from the subject respective column in the dataset for example `1_random_cell_easy`:
103
+
104
+ ```python
105
+ L L L 0 0 0 0 0 0 0<br>
106
+ 0 1 0 0 0 0 0 0 0 V<br>
107
+ V 1 1 0 0 0 0 0 0 V<br>
108
+ 1 1 1 0 0 0 0 V 0 0<br>
109
+ 1 1 1 0 0 0 0 0 V 0<br>
110
+ 1 1 1 0 V 0 0 0 0 V<br>
111
+ 1 1 1 0 0 0 0 0 0 0<br>
112
+ 1 1 1 0 0 0 0 V 0 0<br>
113
+ 0 1 0 0 0 0 V 0 0 0<br>
114
+ V S S 0 0 0 0 0 0 0<br>
115
+ ```
116
+
117
+ ## Evaluation
118
+
119
+ Metric 1: EM (Exact match)<br>
120
+ Metric 2: Score<br>
121
+ Metric 3: Score (normalized)<br>
122
+
123
+ For Score and Score (normalized) we count the overlap between groundtruth and the completion by the model as shown in the code-snippet below:
124
+
125
+ ```python
126
+ ...
127
+ def count_differences(list1, list2) -> int:
128
+ count = 0
129
+ for row1, row2 in zip(list1, list2):
130
+ for cell1, cell2 in zip(row1, row2):
131
+ if cell1 != cell2:
132
+ count += 1
133
+ return count
134
+
135
+ raw_input_ground_truth_difference_count = count_differences(
136
+ raw_input_list, ground_truth_list
137
+ )
138
+
139
+ output_ground_truth_difference_count = count_differences(
140
+ output_text_list, ground_truth_list
141
+ )
142
+
143
+ if output_ground_truth_difference_count == 0:
144
+ exact_match = True
145
+ score = 1
146
+ normalized_score = 1
147
+ else:
148
+ exact_match = False
149
+ score = 1 - (
150
+ output_ground_truth_difference_count /
151
+ raw_input_ground_truth_difference_count
152
+ )
153
+ normalized_score = max(score, 0)
154
+ ...
155
+ ```
156
+
157
+ Please find code [here](https://github.com/philippds/SPhyR/blob/main/run_eval.py#L190).
158
+
159
+ ---
160
+
161
+ # SPhyR Dataset Card
162
+
163
+ TopoReason is a benchmark dataset for evaluating the physical and spatial reasoning capabilities of Large Language Models (LLMs) through topology optimization tasks. Given 2D design conditions—boundaries, loads, and supports—models must predict optimal material distributions without physics engines. Tasks include masked region completion and full-structure prediction, testing models’ ability to infer structural stability and material flow.
164
+
165
+ ## Dataset Details
166
+
167
+ ### Dataset Description
168
+
169
+ - **Curated by:** Philipp D. Siedler
170
+ - **Language(s) (NLP):** Any (prompt provided in English)
171
+
172
+ ### Dataset Sources
173
+
174
+ - **Repository:** https://github.com/philippds/SPhyR
175
+ - **Paper [optional]:** https://arxiv.org/pdf/2505.16048
176
+
177
+ ## Dataset Structure
178
+
179
+ ### Legend
180
 
181
  - `L` - Load
182
  - `S` - Support
183
  - `V` - Void
184
 
185
+ ### Subjects
186
+
187
+ #### Easy
188
 
189
  Note: Here we use 0 and 1 for material distribution
190
 
 
199
  full_easy
200
  ```
201
 
202
+ #### Hard
203
 
204
  Note: Here we use floating point numbers 0-1 for material distribution
205
 
 
214
  full_hard
215
  ```
216
 
217
+ ## Dataset Creation
218
+
219
+ Please refer to the dataset repository on GitHub if you want to re-generate the dataset or interested in how this has been done: https://github.com/philippds/SPhyR. We used [Rhinoceros with Grasshopper](https://www.rhino3d.com/) and [Milipede plugin](https://www.creativemutation.com/millipede) to design the structural scenarios and simulated topology optimization.
220
+
221
+ ## Citation
222
+
223
+ **BibTeX:**
224
+
225
+ @misc{siedler2025sphyr,
226
+ title = {SPhyR: Spatial-Physical Reasoning Benchmark on Material Distribution},
227
+ author = {Philipp D. Siedler},
228
+ year = {2025},
229
+ eprint = {2505.16048},
230
+ archivePrefix= {arXiv},
231
+ primaryClass = {cs.AI},
232
+ doi = {10.48550/arXiv.2505.16048},
233
+ url = {https://arxiv.org/abs/2505.16048}
234
+ }
235
+
236
+ **APA:**
237
+
238
+ Siedler, P. D. (2025). SPhyR: Spatial-Physical Reasoning Benchmark on Material Distribution. arXiv. https://doi.org/10.48550/arXiv.2505.16048
239
+
240
+ ## Dataset Card Authors
241
 
242
+ Philipp D. Siedler
243
 
244
+ ## Dataset Card Contact
245
 
246
+ p.d.siedler@gmail.com