Towards Large Language Models as Copilots for Theorem Proving in Lean
<|reference_start|>Towards Large Language Models as Copilots for Theorem Proving in Lean: Theorem proving is an important challenge for large language models (LLMs), as formal proofs can be checked rigorously by proof assistants such as Lean, leaving no room for hallucination. Existing LLM-based provers try to prove theorems in a fully autonomous mode without human intervention. In this mode, they struggle with novel and challenging theorems, for which human insights may be critical. In this paper, we explore LLMs as copilots that assist humans in proving theorems. We introduce Lean Copilot, a framework for running LLM inference in Lean. It enables programmers to build various LLM-based proof automation tools that integrate seamlessly into the workflow of Lean users. Using Lean Copilot, we build tools for suggesting proof steps (tactic suggestion), completing intermediate proof goals (proof search), and selecting relevant premises (premise selection) using LLMs. Users can use our pretrained models or bring their own ones that run either locally (with or without GPUs) or on the cloud. Experimental results demonstrate the effectiveness of our method in assisting humans and automating theorem proving process compared to existing rule-based proof automation in Lean. We open source all codes under a permissive MIT license to facilitate further research.<|reference_end|>
@article{song2024towards,
    title={Towards Large Language Models as Copilots for Theorem Proving in Lean},
    author={Peiyang Song, Kaiyu Yang, Anima Anandkumar},
    journal={arXiv preprint arXiv:2404.12534},
    year={2024},
    archivePrefix={arXiv},
    eprint={2404.12534},
    primaryClass={cs.AI cs.LG cs.LO stat.ML}
}