Herald:一个自然语言标注的 Lean 4 数据集
Herald: A Natural Language Annotated Lean 4 Dataset
AI总结:
本文提出 Herald 数据集及基于其微调的翻译器,将 Lean 4 形式语言与自然语言对齐,在 miniF2F-test 上达到 93.2% 准确率,并成功应用于自动形式化数学文献。
摘要:
像 Lean 这样的可验证形式语言已深刻影响了数学推理,特别是通过使用大型语言模型(LLMs)进行自动推理。训练这些形式语言的 LLMs 面临的一个重大挑战是缺乏将自然语言与形式语言证明对齐的平行数据集。为解决这一挑战,本文提出了一种新颖的框架,用于将 Mathlib4 语料库(形式语言 Lean 4 中的统一数学库)翻译成自然语言。在此基础上,我们采用了一种结合基于策略和基于非正式方法的双重增强策略,利用 Lean-jixia 系统(一个 Lean 4 分析器)。我们将该流程在 Mathlib4 上的结果呈现为 Herald(基于层次和检索的翻译 Lean 数据集)。我们还提出了 Herald Translator,它在 Herald 上进行了微调。Herald Translator 在 miniF2F-test 上的形式化陈述准确率(Pass@128)达到 93.2%,在我们内部的 graduate-level 教科书数据集上达到 22.5%,优于 InternLM2-Math-Plus-7B(74.0% 和 7.5%)和 TheoremLlama(50.1% 和 4.0%)。此外,我们提出了一个用于实际应用的 section 级翻译框架。作为 Herald Translator 的直接应用,我们成功翻译了 Stack 项目中的一个模板 section,标志着在自动形式化 graduate-level 数学文献方面取得了显著进展。我们的模型以及数据集均已开源。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。