用知识图谱增强大模型,自动证明组合词论定理
LAMP: Lean-based Agentic framework with MCP and Proof Repair

- 用领域知识图谱在推理时注入专业信息,不靠微调模型
- 在90个组合词论定理中,96.7%生成可验证的证明
- 适合数学形式化、自动化证明方向的研究者
大型语言模型在数学推理方面能力不断增强,但其生成的证明常不可靠且难以验证。交互式定理证明器如Lean 4通过仅接受内核检查的证明来解决此问题,但其应用受限于已有形式化知识。尽管Mathlib涵盖广泛数学领域,组合词论(CoW)等专业领域仍缺乏足够支持。我们提出两项贡献:第一,构建了包含8个模块、93个核心定义与基础引理的Lean 4形式化库;第二,提出LAMP多智能体框架,通过领域特定的CoW知识图谱在推理时提供结构化知识,而非微调证明器。LAMP通过规划器、构建器和验证器协同工作,基于模型上下文协议访问知识图谱。在覆盖8个模块、三类难度共90个CoW定理的测试中,LAMP成功生成可验证证明的比例达96.7%,显著优于无引导基线和现有专用证明器。消融实验显示,移除工具驱动架构或规划/构建分离机制各导致约12个百分点性能下降。
原文摘要 · Abstract (English)
Large language models are increasingly capable of mathematical reasoning, but the proofs they generate are often unreliable and hard to verify. Interactive theorem provers such as Lean 4 address this by accepting only kernel-checked proofs; however, their reach is bounded by the formalized knowledge available. While Mathlib, a repository of formalized Lean 4 theorems that covers diverse mathematical areas, certain specialized areas remain underrepresented; notably, the domain of Combinatorics on Words (CoW). CoW studies sequences, exploring their properties such as periodicity, borders, conjugacy, and morphisms. As a result, specialized provers, trained on Mathlib-centered data, lack the lemmas to operate in CoW. We present two contributions. First, we introduce a Lean 4 formalization of CoW containing eight modules and \textbf{93} declarations of core definitions and foundational lemmas. Second, we present LAMP, a multi-agent framework that synthesizes kernel-verified Lean 4 proofs by providing explicit, structured domain knowledge at inference time through an ontology, rather than by fine-tuning a prover. LAMP coordinates a Planner, Builder, and Verifier with Model Context Protocol based access to a domain-specific CoW ontology. In a suite of 90 CoW theorems that span all eight modules and three difficulty levels, LAMP synthesizes verified proofs for 96.7% of theorems, substantially exceeding both an unscaffolded baseline and existing specialized provers. An ablation shows that removing LAMP's tool-grounded architecture or its Planner/Builder separation each cost roughly 12 percentage points, even with the backbone model held fixed.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。