HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

An In-Context Learning Agent for Formal Theorem-Proving

Amitayush Thakur George Tsoukalas Yeming Wen Jimmy Xin Swarat Chaudhuri

An In-Context Learning Agent for Formal Theorem-Proving

Abstract

We present an in-context learning agent for formal theorem-proving in environments like Lean and Coq. Current state-of-the-art models for the problem are finetuned on environment-specific proof data. By contrast, our approach, called COPRA, repeatedly asks a high-capacity, general-purpose large language model (GPT-4) to propose tactic applications from within a stateful backtracking search. Proposed tactics are executed in the underlying proof environment. Feedback from the execution is used to build the prompt for the next model query, along with selected information from the search history and lemmas retrieved from an external database. We evaluate our implementation of COPRA on the miniF2F benchmark for Lean and a set of Coq tasks from the CompCert project. On these benchmarks, COPRA significantly outperforms few-shot invocations of GPT-4. It also compares favorably against finetuning-based approaches, outperforming ReProver, a state-of-the-art finetuned approach for Lean, in terms of the pass@1 metric. Our code and data are available at https://github.com/trishullab/copra.

Code Repositories

trishullab/copra
Official
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
automated-theorem-proving-on-minif2f-testCOPRA + GPT-3.5
ITP: Lean
Pass@1: 11.9
cumulative: 11.9
automated-theorem-proving-on-minif2f-testCOPRA + GPT-4
ITP: Lean
Pass@1: 23.3
cumulative: 23.3
automated-theorem-proving-on-minif2f-testCOPRA + GPT-4-turbo
ITP: Lean
Pass@1: 30.7
cumulative: 30.7

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
An In-Context Learning Agent for Formal Theorem-Proving | Papers | HyperAI