FormalVerse
收藏资源简介:
FormalVerse是由模基最佳有限公司和清华大学联合构建的大规模自动形式化数据集,旨在将自然语言数学语句转化为Lean 4可验证形式。该数据集包含约367,000条经过编译和语义一致性检查的定理声明,覆盖来自NuminaMath、Lean Workbook、DeepMath等十余个数学问题集,涉及代数、数论、组合学等多个数学领域。数据通过知识检索与迭代精炼管道生成,首先利用检索器从Mathlib中获取相关定义和已有形式化,再由生成器产出候选,经编译器诊断和语义一致性判断后,对失败案例进行最多三轮修正,最终保留通过所有检查的实例。该数据集专门用于训练自动形式化模型,旨在解决现有方法依赖模型参数记忆、难以处理复杂库知识和单次生成能力上限的问题,从而提升模型在各类数学领域中的形式化准确率。
FormalVerse is a large-scale automated formalization dataset jointly developed by Moji Zuijia Co., Ltd. and Tsinghua University, aiming to translate natural language mathematical statements into Lean 4-verifiable formalizations. This dataset contains approximately 367,000 theorem statements that have undergone compilation and semantic consistency checks, covering over ten mathematical problem collections including NuminaMath, Lean Workbook, DeepMath, and spanning multiple mathematical fields such as algebra, number theory, and combinatorics. The dataset is generated via a knowledge retrieval and iterative refinement pipeline: first, a retriever fetches relevant definitions and existing formalizations from Mathlib; then a generator produces candidate formalizations; after undergoing compiler diagnostics and semantic consistency verification, failed cases are revised for up to three rounds, and only instances passing all checks are finally retained. This dataset is specifically designed for training automated formalization models, aiming to address the shortcomings of existing methods that rely on model parameter memorization, struggle with complex library knowledge, and have a ceiling on single-pass generation capability, thereby improving the formalization accuracy of models across diverse mathematical domains.
数据集概述
FormalVerse 是一个经过验证的 Lean 4 自动形式化(autoformalization)数据集,由论文 MathForm: Scaling Mathematical Autoformalization with Knowledge Retrieval and Verification-Guided Refinement 发布,对应 arXiv 论文编号 2608.14221。
构建流程
数据集中每个样本均由 MathForm 流水线生成:生成前先检索相关的 Mathlib 数学知识,随后利用 Lean 编译器诊断信息和语义一致性反馈对候选结果进行迭代精炼。仅保留同时通过编译验证和语义验证的样本。
数据集规模与配置
- 规模类别:100K < n < 1M
- 配置:默认配置,包含单个训练集分割(train),数据文件为
data/FormalVerse.jsonl - 许可证:Apache License 2.0
- 任务类型:文本生成(text-generation)
- 语言:英语
数据字段
每个样本为 JSON 对象,包含以下字段:
| 字段 | 类型 | 描述 |
|---|---|---|
id |
string | 样本唯一标识符 |
informal_statement |
string | 自然语言形式的问题描述 |
formal_statement |
string | 经过验证的 Lean 4 形式化陈述 |
source |
string | 非形式化问题的来源 |
topic_label |
string | 问题的数学主题 |
messages |
list | 聊天格式的对话记录 |
model |
string | 用于生成轨迹的模型 |
其中 messages 字段包含用户请求将非形式化数学问题转换为 Lean 4 形式化陈述的指令,以及助手模型带有推理过程(reasoning_content)和最终 Lean 4 代码(content)的回复。
数据来源
数据集中的部分非形式化问题来源于以下开放集合:
- Lean-Workbook
- NuminaMath
- DeepMath
- DeepTheorem
- AceReason-Math
- OpenR1-Math
- Principia-Collection
使用方式
可通过 Hugging Face datasets 库加载数据:
python from datasets import load_dataset
dataset = load_dataset("openbmb/FormalVerse", split="train") assistant_message = dataset[0]["messages"][1] print(assistant_message["reasoning_content"]) print(assistant_message["content"])
关联资源
- 论文:https://arxiv.org/abs/2608.14221
- 代码仓库:https://github.com/OpenBMB/MathForm
- 配套模型(MathForm-8B):https://huggingface.co/openbmb/MathForm-8B




