HolStep: A Machine Learning Dataset for Higher-order Logic Theorem Proving

Cezary Kaliszyk, François Chollet, Christian Szegedy

Introduction

Interactive Theorem Proving (ITP) serves as the "gold standard" for verifying the correctness of complex software and mathematical proofs, such as the Kepler conjecture. However, these proofs are incredibly dense, often involving millions of intermediate logical steps. Currently, finding these steps relies heavily on human intuition or manually written heuristics that guide automated search tools. This creates a massive search space problem—there are simply too many possible logical inferences to check them all.

While deep learning has revolutionized computer vision and natural language processing, its application to the internal guidance of theorem provers has been limited by a lack of large, high-quality, standardized datasets. To address this, the authors introduce HolStep, a large-scale dataset of over 2 million logic steps designed to bridge the gap between machine learning and formal mathematical reasoning. By providing a standardized benchmark for Higher-Order Logic (HOL) theorem proving, HolStep enables the development of neural networks that can distinguish useful proof steps from logical dead ends.

The HolStep Dataset

The primary contribution of this work is the HolStep dataset, extracted from the HOL Light theorem prover (specifically focusing on its multivariate analysis libraries and the formal proof of the Kepler conjecture).

  • Size: 2,013,046 training examples and 196,030 testing examples derived from 11,400 proofs.
  • Structure: It is framed as a balanced two-class classification problem. Half of the examples are "useful" steps (those that actually appeared in a final, successful proof), and half are "non-useful" steps (generated during a search but ultimately discarded).
  • Formats: Each statement is provided in both human-readable text and a specialized tokenized format.

Methodology and Baseline Architectures

To make the data machine-learning-friendly, the authors implemented a custom tokenization scheme that simplifies complex logical expressions by reducing parentheses, using de Bruijn indices for consistent variable naming, and erasing specific type information to focus on structural patterns.

They tested three types of baseline models to establish a performance floor:

  1. Logistic Regression: To determine if simple token frequency is sufficient to classify steps.
  2. 1D Convolutional Neural Networks (CNN): To capture local patterns or "motifs" within logical statements.
  3. CNN-LSTM Hybrids: To evaluate if the sequential order of tokens provides additional useful information.
Baseline architectures for unconditioned classification

For "conditioned" tasks, they used Siamese network variants to compare a potential proof step against the target conjecture simultaneously.

Key Results and Insights

The most surprising finding was that simple 1D CNNs could achieve approximately 83% accuracy in identifying useful proof steps. This suggests that "useful" logic has a recognizable statistical signature that deep learning can detect without explicitly understanding the underlying rules of inference.

Validation accuracy of unconditioned models over training epochs
  • Unconditioned Classification: Models guessed if a step was useful without knowing the goal. The 1D CNN achieved 83% accuracy, significantly outperforming Logistic Regression (71%).
  • Conditioned Classification: Models were shown both the step and the conjecture. The Siamese 1D CNN achieved 82% accuracy, and the Siamese CNN-LSTM achieved 83%.
  • The "Conditioning" Paradox: Intuitively, a proof step's usefulness should depend heavily on the goal (the conjecture). However, the baseline models didn't perform significantly better when shown the conjecture. This indicates that these specific models are performing pattern matching rather than logical reasoning—finding generally useful lemmas rather than goal-specific steps.
  • Sequence vs. Structure: The fact that LSTMs didn't outperform CNNs suggests that the specific sequential order of tokens is less important than the presence of certain logical clusters. Furthermore, using character-level encoding performed nearly as well as specialized tokenization, highlighting the robustness of these models to different data representations.

Limitations and Future Work

The authors note that their baseline models are not "reasoning" in a human sense; rather, they are performing sophisticated n-gram matching. Because the models treat logic as a 1D sequence, they miss the inherent tree structure of mathematical expressions.

Future directions include moving from 1D sequences to Graph Neural Networks (GNNs) or Recursive Neural Networks that can better represent the hierarchical nature of logic. Additionally, researchers could use the dataset to generate new, valid intermediate lemmas rather than just classifying existing ones, and test whether models trained on HOL Light can generalize to help guide proofs in other systems like Coq or Isabelle.

Summary updated

BibTeX
@inproceedings{kaliszyk2017holstep,
  author = {Cezary Kaliszyk and François Chollet and Christian Szegedy},
  title = {{HolStep: A Machine Learning Dataset for Higher-order Logic Theorem Proving}},
  booktitle = {International Conference on Learning Representations},
  year = {2017},
  url = {https://openreview.net/forum?id=ryuxYmvel},
}
Figure