FormalScience: 基于代理代码生成的可扩展人类在环科学自动形式化
FormalScience: Scalable Human-in-the-Loop Autoformalisation of Science with Agentic Code Generation in Lean
AI总结:
FormalScience通过人类在环的代理流程,使非专业领域专家以低成本生成形式化证明,构建了包含200个大学物理问题及解决方案的FormalPhysics数据集,并探讨了现代LLM在自动形式化中的局限性。
摘要:
将非正式数学推理形式化为可验证代码是大型语言模型的重大挑战。在物理学等科学领域,特定领域的机器(例如Dirac符号、向量微积分)带来了额外的形式化挑战,现代LLM和代理方法尚未解决。为了帮助科学领域的自动形式化,我们提出了FormalScience;一个领域无关的人类在环代理流程,使单个领域专家(无需深入形式语言经验)能够以低成本生成非正式推理的形式化证明。在物理学中应用FormalScience,我们构建了FormalPhysics,包含200个大学级别(LaTeX)物理问题和解决方案(主要为量子力学和电磁学),及其Lean4形式化表示。与现有形式化数学基准相比,FormalPhysics实现了完美的形式化有效性,并表现出更高的语句复杂性。我们通过零样本提示、自我改进与错误反馈以及一种新的多阶段代理方法,在我们的数据集上评估开源模型和专有系统在语句自动形式化任务上的表现,并探索现代基于LLM的自动形式化方法的局限性。我们首次系统地描述了物理自动形式化中的语义漂移,以诸如符号坍塌和抽象提升等概念来揭示当完全语义保持不可行时,形式语言验证了什么。我们发布了代码库和一个基于交互式UI的FormalScience系统,该系统有助于在物理学之外的科学领域进行自动形式化和定理证明。
英文摘要:
Formalising informal mathematical reasoning into formally verifiable code is a significant challenge for large language models. In scientific fields such as physics, domain-specific machinery (\textit{e.g.} Dirac notation, vector calculus) imposes additional formalisation challenges that modern LLMs and agentic approaches have yet to tackle. To aid autoformalisation in scientific domains, we present FormalScience; a domain-agnostic human-in-the-loop agentic pipeline that enables a single domain expert (without deep formal language experience) to produce \textit{syntactically correct} and \textit{semantically aligned} formal proofs of informal reasoning for low economic cost. Applying FormalScience to physics, we construct FormalPhysics, a dataset of 200 university-level (LaTeX) physics problems and solutions (primarily quantum mechanics and electromagnetism), along with their Lean4 formal representations. Compared to existing formal math benchmarks, FormalPhysics achieves perfect formal validity and exhibits greater statement complexity. We evaluate open-source models and proprietary systems on a statement autoformalisation task on our dataset via zero-shot prompting, self-refinement with error feedback, and a novel multi-stage agentic approach, and explore autoformalisation limitations in modern LLM-based approaches. We provide the first systematic characterisation of semantic drift in physics autoformalisation in terms of concepts such as notational collapse and abstraction elevation which reveals what formal language verifies when full semantic preservation is unattainable. We release the codebase together with an interactive UI-based FormalScience system which facilitates autoformalisation and theorem proving in scientific domains beyond physics.https://github.com/jmeadows17/formal-science
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。