lean-proof-compression
收藏资源简介:
LeanPolish 是一个包含 Lean 4 证明重写对的数据集,专为训练能够压缩、简化或选择证明策略的模型而设计。该数据集由 LeanPolish 工具生成,所有接受的 (原始, 替换) 对都经过 Lean 4.21.0 内核验证。数据集包含 7 个分片,总计 33,402 个接受的优化示例和 65,596 个被拒绝的对比示例。每个示例包含详细的元数据,如证明状态、目标类型、替换内容等。数据集适用于文本生成、定理证明、证明优化和强化学习等任务,特别适合用于对比学习或直接偏好优化 (DPO) 设置。数据以 gzipped JSONL 格式存储,包含严格语义分离的训练对和被拒对文件。
LeanPolish is a dataset containing Lean 4 proof rewrite pairs, specifically designed for training models capable of compressing, simplifying, or selecting proof strategies. The dataset is generated by the LeanPolish tool, and all accepted (original, replacement) pairs are validated by the Lean 4.21.0 kernel. The dataset consists of 7 shards, totaling 33,402 accepted optimization examples and 65,596 rejected contrastive examples. Each example includes detailed metadata such as proof state, goal type, replacement content, etc. The dataset is suitable for tasks like text generation, theorem proving, proof optimization, and reinforcement learning, and is particularly well-suited for contrastive learning or Direct Preference Optimization (DPO) setups. The data is stored in gzipped JSONL format, with strictly semantically separated files for training pairs and rejected pairs.
好的,这是对您提供的 LeanPolish 数据集详情页面的总结:
数据集概述:LeanPolish
核心内容
- 数据集名称: LeanPolish: A Kernel-Verified Dataset and Symbolic Compression Framework for Lean 4 Proofs
- 数据集描述: 这是一个由
LeanPolish工具生成的 Lean 4 证明重写对 数据集。该工具是一个经过内核验证的证明缩短工具。数据集中的每个(original, replacement)对都经过 Lean 4.21.0 和 Mathlib v4.21.0 的内核验证,并且重写后的文件由独立的进程外验证器进行了端到端重新编译。
数据集规模与构成
- 总数据量: 包含 33,402 个正向优化训练样本和 65,596 个经过去重的对比性拒绝样本。
- 许可协议: Apache-2.0
- 语言: 英语
- 数据用途: 文本生成、语言建模,以及定理证明优化、强化学习(RL)、直接偏好优化(DPO)等。
数据分割与文件结构
数据集包含 7 个分片(shard),每个分片下最多包含三个 gzip 压缩的 JSONL 文件:
training_pairs.jsonl.gz: 包含已验证的正面优化样本。rejected_pairs.jsonl.gz: 包含在同一个attempt_id下被更高排名候选方案取代的样本,可作为 DPO 的对比负样本。
| 分片名称 | 训练样本数 | 拒绝样本数 | 压缩后大小 |
|---|---|---|---|
mathlib |
6,695 | 26,912 | 42.5 MB |
goedel |
20,822 | 28,525 | 10.3 MB |
minif2f |
1,184 | 3,753 | 720 KB |
putnam_bench |
4,354 | 5,930 | 1.4 MB |
putnam_verified |
80 | 254 | 60 KB |
putnam2025_per_file |
142 | 147 | 83 KB |
putnam2025_pool |
125 | 75 | 91 KB |
| 总计 | 33,402 | 65,596 | 55.1 MB |
数据特征 (Schema version: 2)
每一行 JSON 数据包含多个字段,用于描述一次证明重写尝试,关键字段包括:
- 核心标识:
attempt_id,file,line,start_byte,end_byte - 原始与替换内容:
original,replacement,context,goal_pretty,goal_state - 质量指标:
bytes_original,bytes_shortened,tokens_original,tokens_shortened,lines_original,lines_shortened,savings,term_size,edit_width - 结果与状态:
outcome,type(例如tactic_replacement,dead_code_removal,rejected_attempt),kind,corpus,git_sha,mathlib_rev - 失败信息:
failed_tactics(数组),failed_attempts(数组,包含err,tac,wall_ms字段) - 其他:
content_sha256,schema_version,rank_in_attempt,wall_ms,err_msg
注意: 分片 minif2f, putnam2025_per_file, putnam_verified 的 Schema 略有不同,缺少 axis_orig, axis_repl, failed_attempts 等字段。
数据用途建议
该数据集适用于训练模型进行以下任务:
- 压缩与简化证明: 学习如何缩短或优化 Lean 4 的证明。
- 证明策略选择: 选择更优的证明策略。
- 对比学习/直接偏好优化 (DPO): 利用
rejected_pairs.jsonl.gz中的负样本进行训练。




