jableable commited on
Commit
0098dd7
·
verified ·
1 Parent(s): 14b2356

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -247
README.md CHANGED
@@ -1,266 +1,41 @@
1
  ---
2
  license: mit
3
- language:
4
- - en
5
- pretty_name: Metamath Proof Graphs
6
- size_categories:
7
- - 10K<n<100K
8
  task_categories:
9
  - graph-ml
10
  tags:
11
  - graphs
12
  - gnn
13
- - theorem-proving
14
- - reasoning
15
  - metamath
16
  - pytorch-geometric
17
- configs:
18
- - config_name: default
19
- data_files:
20
- - split: train
21
- path: data/train-*
22
- - split: validation
23
- path: data/validation-*
24
- - split: test
25
- path: data/test-*
26
- - config_name: raw
27
- data_files:
28
- - split: train
29
- path: raw/train-*
30
- - split: validation
31
- path: raw/validation-*
32
- - split: test
33
- path: raw/test-*
34
- dataset_info:
35
- - config_name: default
36
- features:
37
- - name: theorem_index
38
- dtype: int64
39
- - name: theorem_label
40
- dtype: string
41
- - name: graph_type
42
- dtype: string
43
- - name: nodes
44
- list:
45
- - name: label
46
- dtype: string
47
- - name: node_index
48
- dtype: int64
49
- - name: num
50
- dtype: int64
51
- - name: statement
52
- dtype: string
53
- - name: edge_index
54
- list:
55
- list: int64
56
- - name: edge_attr
57
- list:
58
- list: int64
59
- splits:
60
- - name: train
61
- num_bytes: 496594530
62
- num_examples: 76489
63
- - name: validation
64
- num_bytes: 27586060
65
- num_examples: 4249
66
- - name: test
67
- num_bytes: 27592552
68
- num_examples: 4250
69
- download_size: 92724290
70
- dataset_size: 551773142
71
- - config_name: raw
72
- features:
73
- - name: theorem_index
74
- dtype: int64
75
- - name: theorem_label
76
- dtype: string
77
- - name: graph_type
78
- dtype: string
79
- - name: nodes
80
- list:
81
- - name: label
82
- dtype: string
83
- - name: node_index
84
- dtype: int64
85
- - name: num
86
- dtype: int64
87
- - name: statement
88
- dtype: string
89
- - name: edge_index
90
- list:
91
- list: int64
92
- - name: edge_attr
93
- list:
94
- list: int64
95
- splits:
96
- - name: train
97
- num_bytes: 496594530
98
- num_examples: 76489
99
- - name: validation
100
- num_bytes: 27586060
101
- num_examples: 4249
102
- - name: test
103
- num_bytes: 27592552
104
- num_examples: 4250
105
- download_size: 92724290
106
- dataset_size: 551773142
107
  ---
108
 
109
- # Metamath Proof Graphs
110
-
111
- Graph-structured representations of Metamath theorem proofs designed for reasoning-focused Graph Neural Networks.
112
- Each example contains node features, directed edges, and theorem labels suitable for proof-step prediction and symbolic reasoning research.
113
-
114
- ## Dataset Summary
115
-
116
- This dataset converts Metamath’s human-verified formal proofs into directed graphs:
117
-
118
- - **Nodes** represent logical statements (proof steps or hypotheses)
119
- - **Edges** represent inference dependencies
120
- - **Node features** are 512-dimensional Universal Sentence Encoder embeddings
121
- - **Labels** represent the proven theorem, normalized into a compact integer space
122
-
123
- Ideal for research on GNN-based symbolic reasoning, proof-step prediction, and theorem classification.
124
-
125
- ## Dataset Structure
126
-
127
- Each proof instance includes:
128
-
129
- - **Proof Graph** — logical inference steps represented as a directed graph
130
- - **Statement Graph** — hypotheses and conclusion as a compact graph
131
- - **Node Features** — 512-dimensional USE embeddings
132
- - **Label** — integer id for the target theorem (with UNK handling below)
133
-
134
- ## Label Normalization (UNK)
135
-
136
- To reduce extreme class imbalance:
137
-
138
- - Labels appearing **five times or fewer** are mapped to a single `UNK` class
139
- - Remaining labels are reindexed into a **dense, contiguous integer space**
140
- - A reverse mapping is provided for converting predictions back to theorem names
141
-
142
- ## Label Mapping
143
-
144
- Each theorem label is mapped to an integer via a fixed index derived from the Metamath label list.
145
- A reverse index is included for interpretability.
146
-
147
- ## Node Embeddings
148
-
149
- Node representations use **Universal Sentence Encoder (USE v4)**:
150
-
151
- - 512-dimensional embeddings
152
- - Computed once during preprocessing
153
- - Applied to both proof-step nodes and statement-graph nodes
154
-
155
- ## Data Splits
156
-
157
- A fixed-seed 80/10/10 split is used in reference experiments:
158
-
159
- | Split | Examples |
160
- |-------|----------|
161
- | Train | ~8,000 |
162
- | Validation | ~1,000 |
163
- | Test | ~1,000 |
164
-
165
- ## Dataset Size (approx.)
166
 
167
- - **10,000** proof graphs
168
- - **50–200** nodes per graph
169
- - **512-dimensional** node features
170
- - **~829** normalized labels (including `UNK`)
171
 
172
- ## Example Data Structure
173
 
174
- ```json
175
- {
176
- "x": [...], // Node features [num_nodes, 512]
177
- "edge_index": [...], // Directed edges (COO format)
178
- "graph_features": [...],
179
- "label": 42
180
- }
181
- ```
182
 
183
- ## Intended Use
184
-
185
- Designed for:
186
-
187
- - Proof-step prediction
188
- - Symbolic reasoning research
189
- - Theorem classification tasks
190
- - Benchmarking GNN architectures (GIN, GAT, Graph Transformers)
191
-
192
- Not intended for:
193
-
194
- - End-to-end automated theorem proving
195
- - Non-graph ML tasks without graph conversion
196
-
197
- ## Usage
198
-
199
- ### Hugging Face Datasets
200
 
201
  ```python
202
- from datasets import load_dataset
203
- ds = load_dataset("jableable/metamath-proof-graphs")
204
- sample = ds["train"][0]
205
- ```
206
-
207
- ### PyTorch Geometric (loader included)
208
-
209
- ```python
210
- from proofgraphs import ProofDataset
211
- dataset = ProofDataset(root="data/")
212
- ```
213
-
214
- ## Limitations
215
-
216
- - USE embeddings are fixed; domain-specific encoders may yield better performance
217
- - Some theorem classes remain imbalanced even after `UNK` grouping
218
- - The dataset targets step-level reasoning, not full theorem proving
219
- - Logical structure is encoded via graph topology + text embeddings, not explicit grammar
220
-
221
- ## Baseline Performance
222
-
223
- **Reference GNN (GIN, 3 layers):**
224
- - **Top-5 Accuracy:** 70 percent
225
- - (Link to training code to be added)
226
-
227
- ## Dataset Creation
228
-
229
- ### Source
230
-
231
- Derived from the public-domain **Metamath** proof database.
232
- Graph extraction, embedding generation, normalization, and preprocessing were performed by the dataset author.
233
-
234
- ### Preprocessing (brief)
235
-
236
- 1. Convert proofs to directed graphs
237
- 2. Generate USE embeddings for each node
238
- 3. Normalize labels and collapse rare ones into `UNK`
239
- 4. Reindex labels contiguously
240
- 5. Generate fixed-seed train/val/test splits
241
-
242
- Scripts are provided in the repository.
243
-
244
- ### Acknowledgments
245
-
246
- This dataset builds on earlier code and extraction work developed in collaboration with Hongyi Shen and Evgeniya Lagoda.
247
- Their contributions to the initial graph-processing pipeline informed the final dataset.
248
- All packaging, normalization, and Hugging Face dataset preparation were performed by the dataset author.
249
-
250
- ## Citation
251
-
252
- If you use this dataset, please cite:
253
-
254
- ```bibtex
255
- @misc{able2025proofgraphs,
256
- author = {Able, Jared},
257
- title = {Metamath Proof Graphs Dataset},
258
- year = {2025},
259
- publisher = {Hugging Face},
260
- howpublished = {\url{https://huggingface.co/datasets/jableable/metamath-proof-graphs}}
261
- }
262
- ```
263
 
264
- ## Contact
265
 
266
- For questions or issues, please open an issue on the GitHub repo.
 
 
 
 
 
1
  ---
2
  license: mit
3
+ pretty_name: Metamath Proof Graphs (10k)
 
 
 
 
4
  task_categories:
5
  - graph-ml
6
  tags:
7
  - graphs
8
  - gnn
 
 
9
  - metamath
10
  - pytorch-geometric
11
+ - topobench
12
+ size_categories:
13
+ - 10K<n<100K
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ---
15
 
16
+ # Metamath Proof Graphs (10k)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
+ This repository hosts a single PyTorch Geometric dataset file used for the TAG-DS TopoBench challenge.
 
 
 
19
 
20
+ ## Contents
21
 
22
+ - `data.pt`
23
+ A serialized object with the following keys:
24
+ - `data` (PyG `Data` object with collated node features, edges and labels)
25
+ - `slices` (index information for reconstructing individual graphs)
26
+ - `train_idx` (tensor of graph indices for training)
27
+ - `val_idx` (tensor of graph indices for validation)
28
+ - `test_idx` (tensor of graph indices for testing)
 
29
 
30
+ ## Basic usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  ```python
33
+ import torch
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
+ obj = torch.load("data.pt", weights_only=False)
36
 
37
+ data = obj["data"]
38
+ slices = obj["slices"]
39
+ train_idx = obj["train_idx"]
40
+ val_idx = obj["val_idx"]
41
+ test_idx = obj["test_idx"]