TL;DR
AutoPDE is an LLM-based coding agent designed to solve partial differential equations (PDEs) by explicitly managing the underlying mathematical solver strategy as an independent, inspectable object. Unlike traditional code agents that jump straight from a PDE specification to code, AutoPDE separates strategy from implementation, allowing it to diagnose and correct high-level numerical errors based on empirical evidence. This approach achieves a 54.5% pass rate on the PDE Agent Bench, outperforming the strongest baseline by 14.2 percentage points.
What Problem Does This Paper Address?
When engineers and scientists build numerical solvers for PDEs, writing syntactically correct code is only half the battle. The real challenge lies in designing a sound numerical solver strategy—making the right choices regarding discretization, stabilization, linear solvers, and resolution control to match the specific algebraic structure of the PDE.
Recent LLM-based coding agents can generate and debug code, but they treat the solver strategy as an implicit byproduct of the implementation details. If a solver fails due to a fundamental mathematical mismatch (for example, applying a Conjugate Gradient solver to an indefinite Helmholtz system, or omitting stabilization in a convection-dominated problem), standard agents attempt local code patches. They fail to realize that the underlying numerical strategy itself is broken.
Methods
To bridge this gap, the authors introduce AutoPDE, an agent that maintains an explicit, auditable Solver Strategy Record throughout the entire solving process. Before writing a single line of code, AutoPDE executes a three-stage workflow:
- PDE Analysis: The agent inspects the problem specification to determine the equation family, linearity, boundary conditions, and dominant physical mechanisms, documenting these in a
DIAGNOSIScard. - Numerical Method Selection: Guided by the diagnosis, the agent queries a text-based PDE Skill Library (covering 10 core equation families) to select an appropriate variational formulation, finite-element space, stabilization technique, and linear solver/preconditioner combination, saving these to a
METHODcard. - Adaptive Tuning: Once an initial script (
solver.py) is generated, AutoPDE runs low-cost pilot solves to measure empirical error and wall-clock time. It uses a rule-based profiling guide to iteratively adjust mesh resolution ($h$), polynomial degree ($p$), time steps ($dt$), or solver tolerances until the solution satisfies the target accuracy and runtime budgets.
The architecture decouples high-level mathematical reasoning from low-level code generation and refinement, mimicking the workflow of a human expert.
Datasets
The authors evaluated AutoPDE using PDE Agent Bench, a comprehensive benchmark suite containing 191 cases across eight challenging classical PDE families:
- Heat equation
- Convection–diffusion
- Stokes
- Navier–Stokes
- Helmholtz
- Biharmonic
- Linear elasticity
- Reaction–diffusion
An additional 50-case Poisson dataset was used as a supplementary sanity check. Each case provides specific accuracy and runtime constraints, and solutions are evaluated against high-fidelity reference oracle solutions.
Key Insights and Ideas
- Algorithm Choice Beats Mesh Refinement: A common pitfall for naive agents is trying to fix high errors by simply refining the mesh resolution ($N$). For delicate regimes like convection-dominated transport, a poor baseline strategy (like first-order upwind) hits an error ceiling that refinement cannot cheaply overcome. Choosing a superior algorithm (like fifth-order WENO) yields drastically better accuracy at a fraction of the computational cost.
- The Danger of "Implicit" Consistency: Analysis of baseline agents revealed they often included correct keywords (like "SUPG stabilization") because they copied textbook templates, yet still failed. This happened because their choices for mesh size, polynomial degree, and stabilization parameters were internally inconsistent. AutoPDE avoids this by explicitly constraining these parameters together during the strategy phase.
- Flattening Backbone Dependence: Remarkably, AutoPDE achieved the exact same overall pass rate (54.5%) regardless of whether it used Claude Opus 4.6 or GPT 5.1 as its underlying LLM. This indicates that structured scaffolding and explicit strategy representation can compensate for variations in raw code-generation capabilities.
Key Results
- Superior Pass Rate: AutoPDE achieved an overall pass rate of 54.5% on PDE Agent Bench, outperforming the best non-strategy-explicit baseline (OpenHands on GPT 5.1) by 14.2 percentage points.
- Robustness Across Families: While baseline agents completely collapsed to a 0% pass rate on highly sensitive problem types like convection-diffusion or Stokes equations, AutoPDE maintained non-trivial pass rates across all eight equation families.
Limitations and Future Work
Currently, AutoPDE’s benchmark and skill library are tightly coupled to the FEniCSx / dolfinx finite-element stack. All experiments evaluated the agent within this single ecosystem. The authors note that extending AutoPDE to support other major computational mathematics libraries (such as Firedrake or deal.II) and alternative numerical paradigms (like finite-difference or spectral methods) is a vital next step for making the tool generally applicable.
Summary updated