arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.01829cs.LG
收藏

通过奖励大语言模型分层分解证明的形式定理证明

Formal Theorem Proving by Rewarding LLMs to Decompose Proofs Hierarchically

Stanford University(斯坦福大学)

Kefan Dong, Arvind Mahankali, Tengyu Ma

AI总结:

本文提出一种基于强化学习的训练算法,激励大语言模型在形式证明中分层分解定理为引理并逐一证明,显著提升了定理证明的通过率。

摘要:

数学定理证明是检验大型语言模型深层和抽象推理能力的重要试验场。本文聚焦于提升大语言模型在支持自动证明验证/评估的形式语言中编写证明的能力。以往多数研究将人工编写的引理提供给定理证明器,这可以说是一种过度简化的设置,未能充分测试证明器的规划和分解能力。相反,我们在更自然的设置下工作,即在测试时,与定理直接相关的引理不会提供给定理证明器。我们设计了一种基于强化学习的训练算法,鼓励模型将定理分解为引理,证明这些引理,然后利用这些引理证明定理。我们的奖励机制受到数学家自我训练方式的启发:即使当前模型难以证明某个定理,只要模型在此过程中提出并证明了任何正确且新颖的引理,仍会获得正奖励。在训练过程中,我们的模型提出并证明了训练数据集中不存在的引理。事实上,当我们在从形式证明档案库(AFP)提取的数据集上训练时,这些新提出的正确引理占训练回放缓冲区的37.7%。由我们的强化学习算法训练的模型优于通过监督微调训练的模型,在AFP测试集上的通过率从40.8%提升至45.5%,在分布外测试集上的通过率从36.5%提升至39.5%。

英文摘要:

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.

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

↑