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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Li, Shanda, Marwah, Tanya, Shen, Junhong, Sun, Weiwei, Risteski, Andrej, Yang, Yiming, Talwalkar, Ameet
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915811535355904
author Li, Shanda
Marwah, Tanya
Shen, Junhong
Sun, Weiwei
Risteski, Andrej
Yang, Yiming
Talwalkar, Ameet
author_facet Li, Shanda
Marwah, Tanya
Shen, Junhong
Sun, Weiwei
Risteski, Andrej
Yang, Yiming
Talwalkar, Ameet
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2505_08783
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle CodePDE: An Inference Framework for LLM-driven PDE Solver Generation
Li, Shanda
Marwah, Tanya
Shen, Junhong
Sun, Weiwei
Risteski, Andrej
Yang, Yiming
Talwalkar, Ameet
Machine Learning
Artificial Intelligence
Computation and Language
Numerical Analysis
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.
title CodePDE: An Inference Framework for LLM-driven PDE Solver Generation
topic Machine Learning
Artificial Intelligence
Computation and Language
Numerical Analysis
url https://arxiv.org/abs/2505.08783