DeepMath - Deep Sequence Models for Premise Selection

Geoffrey Irving, Christian Szegedy, Alexander A. Alemi, Niklas Eén, François Chollet, Josef Urban

Abstract

DeepMath represents the first large-scale application of deep learning to premise selection in automated theorem proving. By treating mathematical formulas as sequences and employing convolutional and recurrent neural networks, this approach outperforms traditional models that rely on hand-engineered features, ultimately helping automated systems prove more complex mathematical theorems.

The Challenge of Premise Selection

Formalizing mathematics—translating human proofs into a format a computer can verify—is a grueling, labor-intensive process. While Automated Theorem Provers (ATPs) exist to assist, they face a severe "combinatorial explosion" problem. If an ATP is given a library of 50,000 known theorems (premises) and asked to prove a new conjecture, it will likely get lost in the massive search space and fail.

To make ATPs practically useful, we need premise selection: a mechanism to filter the vast library down to the 10–100 most relevant facts for a specific proof. Historically, this was achieved using simple machine learning algorithms (like k-Nearest Neighbors) based on hand-crafted features, such as counting specific symbols or sub-terms. This paper explores whether deep learning can learn these intricate mathematical relationships directly from the raw text of the formulas.

Methodology: Neural Sequence Models

The authors propose a two-stage approach using neural sequence models to bypass manual feature engineering:

  1. Stage 1: Character-level Models: Formulas are treated as raw strings of characters. The team tested several architectures:
  2. CNNs: Pure convolutional networks utilizing global max-pooling.
  3. RNNs: Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs).
  4. CRNNs: A hybrid architecture where a CNN first reduces the sequence length before an LSTM processes it.
  5. Stage 2: Word-level Models & Definition Embeddings: To handle rare mathematical symbols, the authors introduced "definition-embeddings." Instead of initializing a random vector for a rare symbol, they used the Stage 1 embedding of that symbol's formal definition. This allows the model to "understand" a novel symbol by examining its constituent parts.

Training Strategy: The models were trained on "pairwise relevance." Given a (Conjecture, Axiom) pair, the network predicts the probability that the axiom is useful for proving the conjecture. They employed negative mining, specifically targeting "hard negatives" (axioms the model incorrectly deemed relevant) to sharpen the network's discriminative power.

Dataset Characteristics

The models were trained and evaluated on the Mizar Mathematical Library (MML), a massive corpus of formalized mathematics containing over 50,000 lemmas.

  • Training Set: 32,524 theorems already known to be provable by the "E prover" (a state-of-the-art ATP).
  • Evaluation Set: A holdout set of 2,742 theorems used to test how many new proofs the system could facilitate.
Dataset statistics showing the distribution of formula lengths in characters and words, word occurrences, and dependencies.

As illustrated above, the dataset contains highly variable sequence lengths, with some formulas extending well beyond typical natural language sentence lengths, posing unique challenges for sequence modeling.

Key Insights

  • CNNs Outperform RNNs: Surprisingly, simple CNNs handled long mathematical formulas better than LSTMs or GRUs. The authors suggest this is because mathematical formulas possess deep, nested structures where local patterns (sub-terms) are highly informative. CNNs efficiently capture these without the vanishing gradient issues that plague RNNs on very long sequences (some formulas exceeded 80,000 characters).
  • The Power of Definitions: Mathematical symbols are not arbitrary; they build upon one another. By using the embedding of a symbol's definition as its representation, the model generalized significantly better to infrequent symbols.
  • Complementary Strengths: Neural models and traditional k-NN models make different types of mistakes. When the researchers ensembled their deep learning models with traditional methods, they achieved results superior to either approach alone.

Results and Impact

  • Proof Rate: Using the best neural model (a combination of definition-based and character-based CNNs), the system successfully proved 835 theorems at a cutoff of 16 premises. This is a significant jump over the 674 theorems proved by the k-NN baseline.
  • Total Coverage: The union of all neural methods proved 78.4% of the test set. When combined with traditional k-NN methods, the overall success rate reached 80.9%.
  • Ranking Quality: The neural models significantly improved the "average max relative rank," meaning the true premises needed for a proof were consistently ranked much higher in the list of suggestions compared to previous models.

Limitations and Future Directions

While highly effective at pattern matching, the authors acknowledge these models are still "relatively shallow" and do not capture the high-level logical "intent" of a proof in the way a human mathematician does. Furthermore, extremely long formulas remain a computational challenge for memory and batching, particularly for recurrent architectures.

Future work may involve applying these techniques to other major proof assistants like Coq, Isabelle, and HOL Light, and exploring optimization techniques like curriculum learning to better handle the extreme sequence lengths found in formalized mathematics.

Summary updated

BibTeX
@inproceedings{irving2016deepmath,
  author = {Geoffrey Irving and Christian Szegedy and Alexander A. Alemi and Niklas Eén and François Chollet and Josef Urban},
  title = {{DeepMath - Deep Sequence Models for Premise Selection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2016},
  url = {https://openreview.net/forum?id=Hy49WDZ_Zr},
}
Figure