PDE-Controller: LLMs for Autoformalization and Reasoning of PDEs

Mauricio Soroco, Jialin Song, Mengzhou Xia, Kye Emond, Weiran Sun, Wuyang Chen

Introduction: The Challenge of PDE Control

Partial Differential Equations (PDEs) serve as the mathematical foundation for describing physical phenomena, ranging from heat dissipation in materials to the structural vibrations of engineering components. Controlling these systems—adjusting external inputs like heat sources or mechanical forces to maintain specific states—is a critical yet complex task.

Traditionally, PDE control requires domain experts to manually translate high-level human objectives (e.g., "ensure the rod's temperature does not exceed 330K") into precise mathematical constraints. While Large Language Models (LLMs) excel at following natural language instructions, they often struggle with the rigorous spatiotemporal reasoning and physical grounding required for scientific applications. They frequently propose solutions that, while linguistically plausible, are physically impossible or mathematically inconsistent. This paper introduces PDE-Controller, a framework designed to bridge the gap between informal human intent and rigorous physical control.

The PDE-Controller Framework

The authors propose a modular architecture that decomposes the control task into three specialized stages, leveraging the strengths of LLMs while mitigating their tendency to hallucinate mathematical details.

The PDE-Controller framework architecture, featuring the Translator, Controller, and Coder modules integrated with an external solver.
  1. The Translator: This module uses Supervised Fine-Tuning (SFT) to convert informal natural language into Signal Temporal Logic (STL). STL provides a formal syntax for expressing spatiotemporal constraints, ensuring that vague instructions are grounded in a mathematically verifiable format.
  2. The Controller: Acting as the strategic layer, the Controller proposes intermediate subgoals. Using Reinforcement Learning from Human Feedback (RLHF) via Direct Preference Optimization (DPO), it identifies favorable intermediate states that simplify the path toward the final objective.
  3. The Coder: The Coder translates the formal STL specifications and problem descriptions into executable Python code. This code interfaces with the Gurobi optimizer, an industrial-grade solver that handles the underlying numerical optimization.

By using STL as an intermediate representation, the system decouples linguistic understanding from numerical computation, allowing each component to specialize.

Data and Benchmarking

To train and evaluate the framework, the researchers developed a comprehensive dataset:

  • Synthetic Training Set: A massive collection of over 2.13 million samples involving 1D Heat and Wave equations. Each sample includes natural language instructions, corresponding STL specifications, and ground-truth Python code.
  • Instruction Augmentation: To ensure robustness against varied phrasing, the team used GPT-4o-mini to generate five diverse paraphrases for every problem.
  • Real-World Benchmark: A high-variance test set consisting of 34 manually written problems from graduate students in STEM fields. These "noisy" human instructions provide a realistic assessment of the system's ability to handle informal scientific communication.

Strategic Reasoning via Subgoals

A key innovation of PDE-Controller is its ability to perform multi-step reasoning through subgoals. Standard LLMs often attempt to solve complex control problems in a single step, which can lead to failure if the target state is significantly distant from the initial condition. The Controller LLM instead plans a sequence of states, proposing "subgoal" STL constraints that guide the system into more manageable configurations before attempting the final goal. This approach mirrors human engineering intuition, where complex problems are broken down into achievable milestones.

Performance and Generalization

The PDE-Controller framework demonstrates significant improvements over existing state-of-the-art models across several metrics:

  • Utility Gain: On heat equation problems, the framework achieved a 62% improvement in control utility compared to GPT-4o.
  • Autoformalization Accuracy: The Translator reached over 64% Intersection over Union (IoU) on human-written tasks, outperforming specialized models like MathCoder2.
  • Code Executability: The Coder generated valid, executable optimization programs with over 82% accuracy, even for complex scenarios with multiple constraints.
  • Generalization: Remarkably, the model successfully handled problems with four constraints despite being trained on a maximum of three, indicating strong zero-shot generalization capabilities.
Visualization of the control process for Heat and Wave equations, comparing initial conditions, anchor states, and the improved reasoning step.

Future Directions

While PDE-Controller represents a major advancement in applying LLMs to scientific reasoning, several challenges remain. The current implementation is limited to 1D systems; extending the framework to 2D and 3D environments (e.g., fluid dynamics) will require more complex discretization and increased computational resources. Additionally, the system currently operates in an open-loop fashion, planning the entire control sequence at once. Future iterations could incorporate closed-loop control, allowing the LLM to dynamically adjust its strategy based on real-time feedback from the physical system. Finally, expanding the framework to support a wider variety of open-source solvers would increase its utility for the broader scientific community.

Summary updated

BibTeX
@inproceedings{soroco2025pde,
  author = {Mauricio Soroco and Jialin Song and Mengzhou Xia and Kye Emond and Weiran Sun and Wuyang Chen},
  title = {{PDE-Controller: LLMs for Autoformalization and Reasoning of PDEs}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=7epYTVsWEI},
}
Figure