arXiv:2410.10878cs.CLcs.AI2024-10ICLR被引 60

构建首个自然语言标注的Lean 4数学形式化数据集,助力大模型自动证明。

Herald: A Natural Language Annotated Lean 4 Dataset

  • 将Mathlib4库翻译为自然语言,结合策略与非正式方法增强数据
  • 在miniF2F测试中形式化准确率达93.2%(Pass@128),超越现有模型
  • 适用于数学形式化、自动化推理研究者,支持研究生级文献自动转化

形式化语言如Lean在数学推理中影响深远,尤其借助大语言模型实现自动化推理。训练此类模型的一大挑战是缺乏自然语言与形式化证明对齐的平行语料。本文提出新框架,将Mathlib4(Lean 4统一数学库)翻译为自然语言,采用基于策略与非正式的双重增强策略,利用Lean-jixia分析系统。由此生成的数据集名为Herald(Hierarchy and Retrieval-based Translated Lean Dataset)。我们进一步提出微调后的Herald Translator,在miniF2F测试中达93.2%准确率(Pass@128),在内部研究生教材数据集上达22.5%,优于InternLM2-Math-Plus-7B(74.0%、7.5%)和TheoremLlama(50.1%、4.0%)。还提出面向真实应用的章节级翻译框架,成功应用于Stack项目模板,推动研究生级数学文献的自动形式化。模型与数据集均已开源。

原文摘要 · Abstract (English)

Verifiable formal languages like Lean have profoundly impacted mathematical reasoning, particularly through the use of large language models (LLMs) for automated reasoning. A significant challenge in training LLMs for these formal languages is the lack of parallel datasets that align natural language with formal language proofs. To address this challenge, this paper introduces a novel framework for translating the Mathlib4 corpus (a unified library of mathematics in formal language Lean 4) into natural language. Building upon this, we employ a dual augmentation strategy that combines tactic-based and informal-based approaches, leveraging the Lean-jixia system, a Lean 4 analyzer. We present the results of this pipeline on Mathlib4 as Herald (Hierarchy and Retrieval-based Translated Lean Dataset). We also propose the Herald Translator, which is fine-tuned on Herald. Herald translator achieves a 93.2% accuracy (Pass@128) on formalizing statements in the miniF2F-test and a 22.5% accuracy on our internal graduate-level textbook dataset, outperforming InternLM2-Math-Plus-7B (74.0% and 7.5%) and TheoremLlama (50.1% and 4.0%). Furthermore, we propose a section-level translation framework for real-world applications. As a direct application of Herald translator, we have successfully translated a template section in the Stack project, marking a notable progress in the automatic formalization of graduate-level mathematical literature. Our model, along with the datasets, are open-sourced to the public.

形式化验证自然语言翻译Lean 4数学推理

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