arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.40707cs.AIcs.LO
收藏

OPAL:通过度量驱动的编码智能体实现库规模的证明优化

OPAL: Optimizing Proofs at Library Scale via Metric-Driven Coding Agents

Peking University(北京大学);Huawei Technologies Co., Ltd.(华为技术有限公司);Georgia Institute of Technology(佐治亚理工学院)

Chengwu Liu, Zijin Feng, Ye Yuan, Yifang Qin, Botao Li, Jiaxuan Xie, Siqi Li, Pu Suo, Haoli Bai, Yichun Yin, Lifeng Shang, Ming Zhang

AI总结:

该研究提出首个仓库级证明优化任务OPAL,基于6个度量实例化,发布含162个实例的OPAL-Bench,实验显示编码智能体可实现超人类提交的优化,且语义保留契约可保障改进有效性。

摘要:

受自动形式化和自动定理证明快速进展的驱动,形式数学正在扩大规模:数学家通常借助AI协助,围绕Lean蓝图推进大型形式化项目,这些项目将LaTeX证明计划与Lean代码库紧密关联。随着mathlib和证明自动化的发展,已完成的证明积累了优化机会。然而即使在成熟的mathlib库中,41%的提交未添加新数学内容,而是改进现有证明(缩短长度、消除重复、加快编译),且其中62%的提交涉及多个文件,超出了定理级方法的处理范围。我们提出OPAL,这是首个仓库级、度量驱动的证明优化任务,其中智能体可自由重构蓝图仓库以达成仓库级目标。我们基于从人类维护倾向中经验挖掘出的6个度量实例化OPAL,包括证明长度、导入闭包、mathlib重复度和精化成本。然而,自由优化这些度量会引发奖励黑客行为,例如删除定理以缩短代码,因此评估需要关于必须保留内容的契约。我们的关键观察是蓝图结构本身提供了该契约:Lean链接确定了构成项目最终目标的定理(占所有声明的5-19%),其语句必须保留,而其余81-95%的辅助代码可自由重构。我们将该契约实现为可执行的语义保留检查器。在此基础上,我们发布OPAL-Bench,包含来自18个真实Lean蓝图项目的162个任务实例,以及一个沙箱智能体工具。实验表明,编码智能体可提供超出单个人类提交水平的真实优化收益,而 ablation 研究显示,若智能体的环境中缺少该契约,近一半被接受的改进无法通过语义验证。

英文摘要:

Driven by rapid progress in autoformalization and automated theorem proving, formal mathematics is scaling up: mathematicians, often with AI assistance, advance large formalization projects around Lean blueprints, which tightly link a LaTeX proof plan to the Lean codebase. As mathlib and proof automation evolve, finished proofs accumulate optimization opportunities. Yet even in the mature mathlib library, 41% of commits add no new mathematics but improve existing proofs (shortening, deduplication, faster compilation), and 62% of these span multiple files, beyond the reach of theorem-level methods. We introduce OPAL, the first repository-level, metric-driven proof-optimization task, where an agent freely refactors a blueprint repository toward repository-level objectives. We instantiate OPAL with six metrics grounded in empirically mined human maintenance tendencies, including proof length, import closure, mathlib duplication, and elaboration cost. Optimizing these metrics freely, however, invites reward hacking, such as deleting a theorem to shorten the code, so evaluation needs a contract on what must stay intact. Our key observation is that blueprint structure itself supplies this contract: \lean{} links pin down which theorems constitute a project's final targets (5-19% of all declarations), whose statements must be preserved, while the remaining 81-95% of auxiliary code may be freely refactored. We implement this contract as an executable semantic-preservation checker. Building on it, we release OPAL-Bench, comprising 162 task instances from 18 real-world Lean blueprint projects, together with a sandboxed agent harness. Experiments show that coding agents can deliver genuine optimization gains beyond the level of single human commits, while ablations show that with the contract absent from the agent's world nearly half of accepted improvements do not survive semantic verification.

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

↑