arXiv:2411.01829cs.LG2024-11被引 24

让大模型学会自主拆解定理、提出新引理,提升形式化证明能力。

Formal Theorem Proving by Rewarding LLMs to Decompose Proofs Hierarchically

  • 用强化学习鼓励模型分层拆解定理,自动生成并证明相关引理。
  • 在AFP数据集上,通过率从40.8%提升至45.5%,外分布测试集也提高至39.5%。
  • 适合研究形式化验证、大模型推理的学者,尤其关注自动证明框架设计。

数学定理证明是检验大语言模型深层抽象推理能力的重要场景。本文旨在提升大模型在形式语言下撰写可自动化验证/评估证明的能力。以往方法通常预先提供人类编写的引理,这种设定过于简化,无法充分测试模型的规划与分解能力。为此,本文采用更自然的设置:测试时不提供与定理直接相关的引理。我们设计了一种基于强化学习的训练算法,鼓励模型将定理分解为引理,证明引理,并利用引理完成主定理的证明。奖励机制借鉴数学家自我训练方式:即使主定理无法完全证明,只要提出了正确且新颖的引理并成功证明,仍给予正向奖励。训练中,模型生成了未出现在训练数据集中的新引理,这些新引理占训练重放缓冲区的37.7%(在从Archive of Formal Proofs提取的数据集上)。使用该强化学习算法训练的模型优于监督微调模型,在AFP测试集上通过率从40.8%提升至45.5%,在外分布测试集上从36.5%提升至39.5%。

原文摘要 · Abstract (English)

Mathematical theorem proving is an important testbed for large language models' deep and abstract reasoning capability. This paper focuses on improving LLMs' ability to write proofs in formal languages that permit automated proof verification/evaluation. Most previous results provide human-written lemmas to the theorem prover, which is an arguably oversimplified setting that does not sufficiently test the provers' planning and decomposition capabilities. Instead, we work in a more natural setup where the lemmas that are directly relevant to the theorem are not given to the theorem prover at test time. We design an RL-based training algorithm that encourages the model to decompose a theorem into lemmas, prove the lemmas, and then prove the theorem by using the lemmas. Our reward mechanism is inspired by how mathematicians train themselves: even if a theorem is too challenging to be proved by the current model, a positive reward is still given to the model for any correct and novel lemmas that are proposed and proved in this process. During training, our model proposes and proves lemmas that are not in the training dataset. In fact, these newly-proposed correct lemmas consist of 37.7% of the training replay buffer when we train on the dataset extracted from Archive of Formal Proofs (AFP). The model trained by our RL algorithm outperforms that trained by supervised finetuning, improving the pass rate from 40.8% to 45.5% on AFP test set, and from 36.5% to 39.5% on an out-of-distribution test set.

形式证明强化学习大模型推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。