CodePDE: An Inference Framework for LLM-driven PDE Solver Generation
By: Shanda Li , Tanya Marwah , Junhong Shen and more
Potential Business Impact:
Computers write code to solve hard math problems.
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). Leveraging advanced inference-time algorithms and scaling strategies, CodePDE unlocks critical capacities of LLM for PDE solving: reasoning, debugging, selfrefinement, and test-time scaling -- all without task-specific tuning. CodePDE achieves superhuman performance across a range of representative PDE problems. We also present a systematic empirical analysis of LLM generated solvers, analyzing their accuracy, efficiency, and numerical scheme choices. Our findings highlight the promise and the current limitations of LLMs in PDE solving, offering a new perspective on solver design and opportunities for future model development. Our code is available at https://github.com/LithiumDA/CodePDE.
Similar Papers
Generalizing PDE Emulation with Equation-Aware Neural Operators
Machine Learning (CS)
AI learns to solve many math problems faster.
From Equations to Insights: Unraveling Symbolic Structures in PDEs with LLMs
Machine Learning (CS)
AI finds hidden math rules in science problems.
Towards Reasoning for PDE Foundation Models: A Reward-Model-Driven Inference-Time-Scaling Algorithm
Machine Learning (CS)
Makes computer simulations of science problems smarter.