Paper Reading AI Learner

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

2025-10-13 21:09:36
Yupei Li, Philipp Borchert, Gerasimos Lampouras

Abstract

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. Autoformalisation helps pair the informal reasoning of LLMs with formal proof assistants which enable machine-verifiable generation and mitigate hallucinations. 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. Although current models are trained to generate code from natural language instructions, structural and syntactic differences between these and formal mathematics limit effective transfer learning. 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. This produces structurally aligned code data that can be used for training Math LLMs without requiring additional human annotation. We train two state-of-the-art models, DeepSeek-Math 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. Despite introducing no new mathematical knowledge, our framework achieves gains of 0.12% and 1.09% for Herald on BEq@10 and typecheck@10, respectively, demonstrating that training on aligned code data is beneficial even for specialized models.

Abstract (translated)

大型语言模型(LLMs)在非正式和正式数学推理(如Lean 4)方面表现出色,但它们仍然在自动形式化任务上遇到困难。自动形式化的目的是将非正式的数学陈述转换为正式的数学表述,这一过程有助于将LLM的非正式推理与证明辅助工具相匹配,从而实现机器可验证的生成并减少幻觉(错误信息)。然而,当前数学模型的表现受限于大规模语料库的稀缺性,尤其是包含非正式和正式声明配对的语料库。尽管现有的模型被训练从自然语言指令生成代码,但这些语言与正式数学之间的结构和语法差异限制了有效的迁移学习。 我们提出了一个名为TopoAlign的框架,该框架解锁了广泛可用的代码仓库作为数学LLM的培训资源。TopoAlign将代码分解为文档字符串、主函数和依赖函数,并重新组合成类似于正式声明的结构镜像体,从而生成可以用于训练数学模型且无需额外人工注释的结构对齐代码数据。 我们使用两个最先进的模型——DeepSeek-Math和Herald,在minif2f、Putnam和ProofNet基准测试上进行实验。TopoAlign框架为DeepSeek-Math带来了显著改善,在BEq@10上的性能提升了17.77%,在typecheck@10上的性能提高了68.82%。尽管我们的框架并未引入新的数学知识,但仍然使得Herald模型的BEq@10和typecheck@10分别获得了0.12%和1.09%的改进,这表明即使是专门化的模型也能够从对齐后的代码数据训练中受益。 该研究证明了通过结构化映射现有代码资源以适应数学LLM培训的有效性,并展示了利用这种资源改善模型性能的巨大潜力。

URL

https://arxiv.org/abs/2510.11944

PDF

https://arxiv.org/pdf/2510.11944.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot