Skip to main content
QUICK REVIEW

[Paper Review] LEGO-Prover: Neural Theorem Proving with Growing Libraries

Haiming Wang, Huajian Xin|arXiv (Cornell University)|Oct 1, 2023
Topic ModelingComputer Science9 citations
TL;DR

LEGO-Prover introduces a modular, growing skill library that lets an LLM-based prover retrieve and evolve lemmas to prove theorems. It improves miniF2F pass rates by leveraging newly created and evolved lemmas.

ABSTRACT

Despite the success of large language models (LLMs), the task of theorem proving still remains one of the hardest reasoning tasks that is far from being fully solved. Prior methods using language models have demonstrated promising results, but they still struggle to prove even middle school level theorems. One common limitation of these methods is that they assume a fixed theorem library during the whole theorem proving process. However, as we all know, creating new useful theorems or even new theories is not only helpful but crucial and necessary for advancing mathematics and proving harder and deeper results. In this work, we present LEGO-Prover, which employs a growing skill library containing verified lemmas as skills to augment the capability of LLMs used in theorem proving. By constructing the proof modularly, LEGO-Prover enables LLMs to utilize existing skills retrieved from the library and to create new skills during the proving process. These skills are further evolved (by prompting an LLM) to enrich the library on another scale. Modular and reusable skills are constantly added to the library to enable tackling increasingly intricate mathematical problems. Moreover, the learned library further bridges the gap between human proofs and formal proofs by making it easier to impute missing steps. LEGO-Prover advances the state-of-the-art pass rate on miniF2F-valid (48.0% to 57.0%) and miniF2F-test (45.5% to 47.1%). During the proving process, LEGO-Prover also manages to generate over 20,000 skills (theorems/lemmas) and adds them to the growing library. Our ablation study indicates that these newly added skills are indeed helpful for proving theorems, resulting in an improvement from a success rate of 47.1% to 50.4%. We also release our code and all the generated skills.

Motivation & Objective

  • Motivate automating formal reasoning with modular lemma reuse to tackle increasingly complex theorems.
  • Enable dynamic growth of a verified skill library through prover and evolver components.
  • Bridge informal and formal proofs by enabling LLMs to reuse and evolve lemmas in Isabelle/Lean-like environments.

Proposed method

  • Prover decomposes a theorem into subgoals and retrieves relevant lemmas from a growing skill library to construct a modular Isabelle proof.
  • Evolver transforms existing lemmas into more general and reusable forms and solves unresolved requests to generate new lemmas.
  • Three vector stores (lemma, request, problem) encode and retrieve skills via embeddings and k-NN search to inform prompting.
  • LLMs draft informal proofs, which are formalized into Isabelle proof scripts with retrieved lemmas and verifier feedback.
  • Isabelle/sledgehammer-based verification plus heuristic tactics auto-corrects proofs when needed, adding validated lemmas to the library.
  • A growth loop: new lemmas from prover/evolver are verified and added, expanding the library for future proofs.
Figure 1: (a) Comparison between plain provers and LEGO-Prover. Unlike plain provers that prove the theorem sequentially, LEGO-Prover constructs the proof in a modular paradigm. Useful lemmas can be directly retrieved from the skill library and used as part of the proof. A newly constructed lemma ca
Figure 1: (a) Comparison between plain provers and LEGO-Prover. Unlike plain provers that prove the theorem sequentially, LEGO-Prover constructs the proof in a modular paradigm. Useful lemmas can be directly retrieved from the skill library and used as part of the proof. A newly constructed lemma ca

Experimental results

Research questions

  • RQ1Can a growing, modular skill library improve neural theorem proving when integrated with LLMs?
  • RQ2Do evolved lemmas generalize beyond their original problems to aid other proofs?
  • RQ3How does modular proof construction compare with single-block proofs in terms of proof success and efficiency?
  • RQ4What is the impact of removing the skill library on proving performance?
  • RQ5How large and diverse is the resulting skill library, and how is it utilized?

Key findings

  • LEGO-Prover achieves 57.0% miniF2F-valid and 50.0% miniF2F-test pass rates (with human informal proofs) and 52.4%/45.5% (model informal proofs).
  • LEGO-Prover outperforms previous approaches on miniF2F by approximately 6.75 percentage points on average.
  • A growing skill library enables sustained improvements: ablation without the library drops from 50.4% to 47.1% on validation within 50 attempts.
  • The library eventually contains 22,532 skills, with contributions from prover (10.8%), request-driven evolver (38.2%), and directional transformer evolver (51.1%).
  • Skills can be used directly or as references to inspire new lemmas, boosting LLM proof generation.
Figure 2: Overview of LEGO-Prover. (a) The prover takes three consecutive steps to prove the problem. The informal solver produces an informal solution for the problem statement, followed by using the decomposer to decompose it into step-by-step proof and propose useful sub-goals in the form of lemm
Figure 2: Overview of LEGO-Prover. (a) The prover takes three consecutive steps to prove the problem. The informal solver produces an informal solution for the problem statement, followed by using the decomposer to decompose it into step-by-step proof and propose useful sub-goals in the form of lemm

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.