arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.12534cs.AIcs.LGcs.LOstat.ML
收藏

Lean Copilot:作为 Lean 定理证明副驾驶的大型语言模型

Lean Copilot: Large Language Models as Copilots for Theorem Proving in Lean

California Institute of Technology(加州理工学院)

Peiyang Song, Kaiyu Yang, Anima Anandkumar

AI总结:

本文提出 Lean Copilot 框架,在 Lean 中原生运行 LLM 推理并构建证明建议、目标补全和前提选择工具,实验显示其显著优于 aesop。

摘要:

神经定理证明将大型语言模型(LLM)与 Lean 等证明助手结合起来;在这些证明助手中,形式化证明的正确性可以得到严格验证,因此没有幻觉的容身之地。现有的神经定理证明器在固定数据集上进行预训练,有时能够提供有价值的建议,但它们很难在完全自主模式下持续证明新颖定理,而在这种场景中,人类的洞见可能至关重要。本文探索将 LLM 作为协助人类证明定理的副驾驶。我们介绍了 Lean Copilot,这是一个在 Lean 中原生运行 LLM 推理的通用框架。它使程序员能够构建各种基于 LLM 的证明自动化工具,并将这些工具无缝集成到 Lean 用户的工作流中。Lean 用户可以使用我们的预训练模型,也可以使用自己的模型;这些模型可以在本地运行(使用或不使用 GPU),也可以在云端运行。借助 Lean Copilot,我们构建了基于 LLM 的工具,用于建议证明步骤、补全证明目标以及选择相关前提。在《Mathematics in Lean》教材上的实验结果表明,与 Lean 中现有的基于规则的证明自动化工具(aesop)相比,我们的方法具有有效性。在辅助人类时,Lean Copilot 平均只需要 2.08 个手动输入的证明步骤(aesop 需要 3.86 个);在自动化定理证明过程时,Lean Copilot 平均自动化 74.2% 的证明步骤,比 aesop(40.1%)高出 85%。我们以宽松的 MIT 许可证开源了所有代码和工件,以促进进一步研究。

英文摘要:

Neural theorem proving combines large language models (LLMs) with proof assistants such as Lean, where the correctness of formal proofs can be rigorously verified, leaving no room for hallucination. With existing neural theorem provers pretrained on a fixed collection of data and offering valuable suggestions at times, it is challenging for them to continually prove novel theorems in a fully autonomous mode, where human insights may be critical. In this paper, we explore LLMs as copilots that assist humans in proving theorems. We introduce Lean Copilot, a general framework for running LLM inference natively in Lean. It enables programmers to build various LLM-based proof automation tools that integrate seamlessly into the workflow of Lean users. Lean users can use our pretrained models or bring their own ones that run either locally (with or without GPUs) or on the cloud. Using Lean Copilot, we build LLM-based tools that suggest proof steps, complete proof goals, and select relevant premises. Experimental results on the Mathematics in Lean textbook demonstrate the effectiveness of our method compared to existing rule-based proof automation in Lean (aesop). When assisting humans, Lean Copilot requires only 2.08 manually-entered proof steps on average (3.86 required by aesop); when automating the theorem proving process, Lean Copilot automates 74.2% proof steps on average, 85% better than aesop (40.1%). We open source all code and artifacts under a permissive MIT license to facilitate further research.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑