Datasets:
Update README.md
Browse files123---license: mit---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176---license: mitlanguage:- enpretty_name: Metamath Proof Graphssize_categories:- 10K<n<100Ktask_categories:- graph-mltags:- graphs- gnn- theorem-proving- reasoning- metamath- pytorch-geometric---# Metamath Proof GraphsGraph-structured representations of Metamath theorem proofs designed for reasoning-focused Graph Neural Networks.Each example contains node features, directed edges, and theorem labels suitable for proof-step prediction and symbolic reasoning research.## Dataset SummaryThis dataset converts Metamath’s human-verified formal proofs into directed graphs:- **Nodes** represent logical statements (proof steps or hypotheses)- **Edges** represent inference dependencies- **Node features** are 512-dimensional Universal Sentence Encoder embeddings- **Labels** represent the proven theorem, normalized into a compact integer spaceIdeal for research on GNN-based symbolic reasoning, proof-step prediction, and theorem classification.## Dataset StructureEach proof instance includes:- **Proof Graph** — logical inference steps represented as a directed graph- **Statement Graph** — hypotheses and conclusion as a compact graph- **Node Features** — 512-dimensional USE embeddings- **Label** — integer id for the target theorem (with UNK handling below)## Label Normalization (UNK)To reduce extreme class imbalance:- Labels appearing **five times or fewer** are mapped to a single `UNK` class- Remaining labels are reindexed into a **dense, contiguous integer space**- A reverse mapping is provided for converting predictions back to theorem names## Label MappingEach theorem label is mapped to an integer via a fixed index derived from the Metamath label list.A reverse index is included for interpretability.## Node EmbeddingsNode representations use **Universal Sentence Encoder (USE v4)**:- 512-dimensional embeddings- Computed once during preprocessing- Applied to both proof-step nodes and statement-graph nodes## Data SplitsA fixed-seed 80/10/10 split is used in reference experiments:| Split | Examples ||-------|----------|| Train | ~8,000 || Validation | ~1,000 || Test | ~1,000 |## Dataset Size (approx.)- **10,000** proof graphs- **50–200** nodes per graph- **512-dimensional** node features- **~829** normalized labels (including `UNK`)## Example Data Structure```json{"x": [...], // Node features [num_nodes, 512]"edge_index": [...], // Directed edges (COO format)"graph_features": [...],"label": 42}```## Intended UseDesigned for:- Proof-step prediction- Symbolic reasoning research- Theorem classification tasks- Benchmarking GNN architectures (GIN, GAT, Graph Transformers)Not intended for:- End-to-end automated theorem proving- Non-graph ML tasks without graph conversion## Usage### Hugging Face Datasets```pythonfrom datasets import load_datasetds = load_dataset("jableable/metamath-proof-graphs")sample = ds["train"][0]```### PyTorch Geometric (loader included)```pythonfrom proofgraphs import ProofDatasetdataset = ProofDataset(root="data/")```## Limitations- USE embeddings are fixed; domain-specific encoders may yield better performance- Some theorem classes remain imbalanced even after `UNK` grouping- The dataset targets step-level reasoning, not full theorem proving- Logical structure is encoded via graph topology + text embeddings, not explicit grammar## Baseline Performance**Reference GNN (GIN, 3 layers):**- **Top-5 Accuracy:** 70 percent- (Link to training code to be added)## Dataset Creation### SourceDerived from the public-domain **Metamath** proof database.Graph extraction, embedding generation, normalization, and preprocessing were performed by the dataset author.### Preprocessing (brief)1. Convert proofs to directed graphs2. Generate USE embeddings for each node3. Normalize labels and collapse rare ones into `UNK`4. Reindex labels contiguously5. Generate fixed-seed train/val/test splitsScripts are provided in the repository.### AcknowledgmentsThis dataset builds on earlier code and extraction work developed in collaboration with Hongyi Shen and Evgeniya Lagoda.Their contributions to the initial graph-processing pipeline informed the final dataset.All packaging, normalization, and Hugging Face dataset preparation were performed by the dataset author.## CitationIf you use this dataset, please cite:```bibtex@misc{able2025proofgraphs,author = {Able, Jared},title = {Metamath Proof Graphs Dataset},year = {2025},publisher = {Hugging Face},howpublished = {\url{https://huggingface.co/datasets/jableable/metamath-proof-graphs}}}```## ContactFor questions or issues, please open an issue on the GitHub repo.
README.md+176-3