arXiv:2505.08783cs.LGcs.AI2025-05被引 36

用大模型生成微分方程求解器,提升科学计算自动化水平

CodePDE: An Inference Framework for LLM-driven PDE Solver Generation

  • 将求解偏微分方程转化为代码生成任务,利用大模型推理生成代码
  • 在多种典型方程上实现强性能,验证了推理时算法的有效性
  • 揭示了模型可靠性与复杂度的权衡,适合科研自动化场景

偏微分方程(PDE)是建模物理系统的基础,但求解仍具挑战。传统数值求解器依赖专家知识且计算成本高,而基于神经网络的求解器需要大量训练数据且可解释性差。本文将PDE求解视为代码生成任务,提出首个基于大语言模型(LLM)的推理框架CodePDE,用于生成PDE求解器。通过全面评估LLM在推理阶段的推理、调试、自优化和测试时扩展能力,结果表明:结合先进推理算法与缩放策略,LLM可在多种代表性PDE问题上实现优异表现。研究还发现新见解,如求解器可靠性与复杂度之间的权衡、基于LLM的求解代理设计原则,以及模型在困难任务中的失败模式。这些发现为构建更强大可靠的科学计算型大模型系统提供指导。

原文摘要 · Abstract (English)

Partial differential equations (PDEs) are fundamental to modeling physical systems, yet solving them remains a complex challenge. Traditional numerical solvers rely on expert knowledge to implement and are computationally expensive, while neural-network-based solvers require large training datasets and often lack interpretability. In this work, we frame PDE solving as a code generation task and introduce CodePDE, the first inference framework for generating PDE solvers using large language models (LLMs). With CodePDE, we present a thorough evaluation on critical capacities of LLM for PDE solving: reasoning, debugging, self-refinement, and test-time scaling. CodePDE shows that, with advanced inference-time algorithms and scaling strategies, LLMs can achieve strong performance across a range of representative PDE problems. We also identify novel insights into LLM-driven solver generation, such as trade-offs between solver reliability and sophistication, design principles for LLM-powered PDE solving agents, and failure modes for LLM on hard tasks. These insights offer guidance for building more capable and reliable LLM-based scientific engines.

大模型科学计算代码生成偏微分方程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。