Proof Automation with Large Language Models
Open Access
- 27 October 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 1509-1520
Abstract
Interactive theorem provers such as Coq are powerful tools to formally guarantee the correctness of software. However, using these tools requires significant manual effort and expertise. While Large Language Models (LLMs) have shown promise in automatically generating informal proofs in natural language, they are less effective at generating formal proofs in interactive theorem provers. In this paper, we conduct a formative study to identify common mistakes made by LLMs when asked to generate formal proofs. By analyzing 520 proof generation errors made by GPT-3.5, we found that GPT-3.5 often identified the correct high-level structure of a proof, but struggled to get the lower-level details correct. Based on this insight, we propose PALM, a novel generate-then-repair approach that first prompts an LLM to generate an initial proof and then leverages targeted symbolic methods to iteratively repair low-level problems. We evaluate PALM on a large dataset that includes more than 10K theorems. Our results show that PALM significantly outperforms other state-of-the-art approaches, successfully proving 76.6% to 180.4% more theorems. Moreover, PALM proves 1270 theorems beyond the reach of existing approaches. We also demonstrate the generalizability of PALM across different LLMs.Keywords
All Related Versions
Funding Information
- National Science Foundation (ITE-2333736, CCF-2340408, CCF-2321680)
This publication has 16 references indexed in Scilit:
- cvc5: A Versatile and Industrial-Strength SMT Solver2022
- Hammer for Coq: Automation for Dependent Type TheoryJournal of Automated Reasoning, 2018
- Random Forests for Premise Selection2015
- Verdi: a framework for implementing and formally verifying distributed systemsACM SIGPLAN Notices, 2015
- HOL(y)Hammer: Online ATP Service for HOL LightMathematics in Computer Science, 2014
- Overview and Evaluation of Premise Selection Techniques for Large Theory MathematicsLecture Notes in Computer Science, 2012
- seL42009
- Z3: An Efficient SMT Solver2008
- The Distance-Weighted k-Nearest-Neighbor RuleIEEE Transactions on Systems, Man, and Cybernetics, 1976
- A STATISTICAL INTERPRETATION OF TERM SPECIFICITY AND ITS APPLICATION IN RETRIEVALJournal of Documentation, 1972