jableable commited on
Commit
653b2d6
·
1 Parent(s): a41c2d0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +176 -3
README.md CHANGED
@@ -1,3 +1,176 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ---
18
+
19
+ # Metamath Proof Graphs
20
+
21
+ Graph-structured representations of Metamath theorem proofs designed for reasoning-focused Graph Neural Networks.
22
+ Each example contains node features, directed edges, and theorem labels suitable for proof-step prediction and symbolic reasoning research.
23
+
24
+ ## Dataset Summary
25
+
26
+ This dataset converts Metamath’s human-verified formal proofs into directed graphs:
27
+
28
+ - **Nodes** represent logical statements (proof steps or hypotheses)
29
+ - **Edges** represent inference dependencies
30
+ - **Node features** are 512-dimensional Universal Sentence Encoder embeddings
31
+ - **Labels** represent the proven theorem, normalized into a compact integer space
32
+
33
+ Ideal for research on GNN-based symbolic reasoning, proof-step prediction, and theorem classification.
34
+
35
+ ## Dataset Structure
36
+
37
+ Each proof instance includes:
38
+
39
+ - **Proof Graph** — logical inference steps represented as a directed graph
40
+ - **Statement Graph** — hypotheses and conclusion as a compact graph
41
+ - **Node Features** — 512-dimensional USE embeddings
42
+ - **Label** — integer id for the target theorem (with UNK handling below)
43
+
44
+ ## Label Normalization (UNK)
45
+
46
+ To reduce extreme class imbalance:
47
+
48
+ - Labels appearing **five times or fewer** are mapped to a single `UNK` class
49
+ - Remaining labels are reindexed into a **dense, contiguous integer space**
50
+ - A reverse mapping is provided for converting predictions back to theorem names
51
+
52
+ ## Label Mapping
53
+
54
+ Each theorem label is mapped to an integer via a fixed index derived from the Metamath label list.
55
+ A reverse index is included for interpretability.
56
+
57
+ ## Node Embeddings
58
+
59
+ Node representations use **Universal Sentence Encoder (USE v4)**:
60
+
61
+ - 512-dimensional embeddings
62
+ - Computed once during preprocessing
63
+ - Applied to both proof-step nodes and statement-graph nodes
64
+
65
+ ## Data Splits
66
+
67
+ A fixed-seed 80/10/10 split is used in reference experiments:
68
+
69
+ | Split | Examples |
70
+ |-------|----------|
71
+ | Train | ~8,000 |
72
+ | Validation | ~1,000 |
73
+ | Test | ~1,000 |
74
+
75
+ ## Dataset Size (approx.)
76
+
77
+ - **10,000** proof graphs
78
+ - **50–200** nodes per graph
79
+ - **512-dimensional** node features
80
+ - **~829** normalized labels (including `UNK`)
81
+
82
+ ## Example Data Structure
83
+
84
+ ```json
85
+ {
86
+ "x": [...], // Node features [num_nodes, 512]
87
+ "edge_index": [...], // Directed edges (COO format)
88
+ "graph_features": [...],
89
+ "label": 42
90
+ }
91
+ ```
92
+
93
+ ## Intended Use
94
+
95
+ Designed for:
96
+
97
+ - Proof-step prediction
98
+ - Symbolic reasoning research
99
+ - Theorem classification tasks
100
+ - Benchmarking GNN architectures (GIN, GAT, Graph Transformers)
101
+
102
+ Not intended for:
103
+
104
+ - End-to-end automated theorem proving
105
+ - Non-graph ML tasks without graph conversion
106
+
107
+ ## Usage
108
+
109
+ ### Hugging Face Datasets
110
+
111
+ ```python
112
+ from datasets import load_dataset
113
+ ds = load_dataset("jableable/metamath-proof-graphs")
114
+ sample = ds["train"][0]
115
+ ```
116
+
117
+ ### PyTorch Geometric (loader included)
118
+
119
+ ```python
120
+ from proofgraphs import ProofDataset
121
+ dataset = ProofDataset(root="data/")
122
+ ```
123
+
124
+ ## Limitations
125
+
126
+ - USE embeddings are fixed; domain-specific encoders may yield better performance
127
+ - Some theorem classes remain imbalanced even after `UNK` grouping
128
+ - The dataset targets step-level reasoning, not full theorem proving
129
+ - Logical structure is encoded via graph topology + text embeddings, not explicit grammar
130
+
131
+ ## Baseline Performance
132
+
133
+ **Reference GNN (GIN, 3 layers):**
134
+ - **Top-5 Accuracy:** 70 percent
135
+ - (Link to training code to be added)
136
+
137
+ ## Dataset Creation
138
+
139
+ ### Source
140
+
141
+ Derived from the public-domain **Metamath** proof database.
142
+ Graph extraction, embedding generation, normalization, and preprocessing were performed by the dataset author.
143
+
144
+ ### Preprocessing (brief)
145
+
146
+ 1. Convert proofs to directed graphs
147
+ 2. Generate USE embeddings for each node
148
+ 3. Normalize labels and collapse rare ones into `UNK`
149
+ 4. Reindex labels contiguously
150
+ 5. Generate fixed-seed train/val/test splits
151
+
152
+ Scripts are provided in the repository.
153
+
154
+ ### Acknowledgments
155
+
156
+ This dataset builds on earlier code and extraction work developed in collaboration with Hongyi Shen and Evgeniya Lagoda.
157
+ Their contributions to the initial graph-processing pipeline informed the final dataset.
158
+ All packaging, normalization, and Hugging Face dataset preparation were performed by the dataset author.
159
+
160
+ ## Citation
161
+
162
+ If you use this dataset, please cite:
163
+
164
+ ```bibtex
165
+ @misc{able2025proofgraphs,
166
+ author = {Able, Jared},
167
+ title = {Metamath Proof Graphs Dataset},
168
+ year = {2025},
169
+ publisher = {Hugging Face},
170
+ howpublished = {\url{https://huggingface.co/datasets/jableable/metamath-proof-graphs}}
171
+ }
172
+ ```
173
+
174
+ ## Contact
175
+
176
+ For questions or issues, please open an issue on the GitHub repo.