arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.11944cs.CLcs.AI
收藏

TopoAlign:通过拓扑分解将代码对齐至数学的框架

TopoAlign: A Framework for Aligning Code to Math via Topological Decomposition

Imperial College London(帝国学院伦敦分校);Huawei Noah’s Ark Lab(华为诺亚方舟实验室)

Yupei Li, Philipp Borchert, Gerasimos Lampouras

AI总结:

本文提出TopoAlign框架,利用代码仓库作为训练资源,通过分解重组代码适配形式化数学,在DeepSeek-Math等模型上评估,显著提升了自动形式化基准性能。

摘要:

大型语言模型(LLMs)在非形式化与形式化(如Lean 4)数学推理方面表现出色,但仍难以完成自动形式化任务,即把非形式化数学语句转化为形式化数学语句。当前数学LLMs的性能受限于大规模语料库的稀缺性,尤其是包含非形式化与形式化语句对的语料库。值得注意的是,自动形式化所用的形式语言与编程语言存在结构相似性,且代码数据规模庞大。然而,基于代码训练的现有模型因二者结构与句法差异,无法有效迁移至形式化数学领域。为解决该问题,本文提出TopoAlign框架,将广泛可用的代码仓库作为数学LLMs的训练资源。TopoAlign将代码分解为文档字符串、主函数与依赖函数,并将这些组件重新组合为在结构上与形式化语句相似的对应物。本文在DeepSeek-Math、Qwen-3和Herald三种最先进的模型上进行训练,并在MiniF2F、Putnam和ProofNet基准上评估。TopoAlign为DeepSeek-Math带来显著提升,使BEq@10性能提高17.77%,typecheck@10性能提高68.82%;尽管未引入新的数学知识,也使Herald的BEq@10性能提高0.12%,typecheck@10性能提高1.09%。

英文摘要:

Large Language Models (LLMs) excel at both informal and formal (e.g. Lean 4) mathematical reasoning but still struggle with autoformalisation, the task of transforming informal into formal mathematical statements. Yet, the performance of current Math LLMs is constrained by the scarcity of large-scale corpora, particularly those containing pairs of informal and formal statements. Interestingly, the formal languages used in autoformalisation share structural similarities with programming languages, and code data is available at scale. However, current models trained on code do not transfer effectively to formal math, due to structural and syntactic differences between them. To address this, we propose TopoAlign, a framework that unlocks widely available code repositories as training resources for Math LLMs. TopoAlign decomposes code into docstrings, main functions, and dependency functions, and reassembles these components into analogues that structurally mirror formal statements. We train three state-of-the-art models, DeepSeek-Math, Qwen-3 and Herald, and evaluate them on the MiniF2F, Putnam, and ProofNet benchmarks. TopoAlign provides substantial gains for DeepSeek-Math, improving performance by 17.77% on BEq@10 and 68.82% on typecheck@10, and also measurably improves Herald by 0.12% on BEq@10 and 1.09% on typecheck@10 despite introducing no new mathematical knowledge.

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

↑