Introduction
Uncovering the governing equations—concise mathematical formulas such as $F=ma$—that describe physical systems is a fundamental goal of scientific inquiry. Traditionally, this process has relied on human expertise or automated Symbolic Regression (SR) algorithms. However, existing SR methods face significant challenges. Library-based methods, like SINDy, are computationally efficient but limited by the predefined terms provided by researchers. Conversely, Genetic Programming offers flexibility but often requires complex, handcrafted code and is prone to "bloat," generating unnecessarily convoluted equations that lack physical interpretability.
The LLM4ED Framework
To address these limitations, researchers have introduced LLM4ED (Large Language Models for Equation Discovery). This framework leverages the latent mathematical knowledge and reasoning capabilities of Large Language Models (LLMs) to act as both a creative hypothesis generator and an intelligent optimizer.
The system operates in a continuous loop consisting of four primary stages:
- Initialization: The LLM is prompted with a basic symbol library (operators like $+$, $\sin$, $\exp$ and variables like $u, u_x$) to generate diverse candidate equations.
- Evaluation: Candidate strings are parsed into mathematical expression trees. The framework then optimizes the constants within these equations to fit observed data.
- Iterative Optimization: The core of the system alternates between "Self-Improvement" (reasoning about redundant terms) and "Evolutionary Search" (performing crossover and mutation via natural language instructions).
- Selection: High-performing equations are stored in a priority queue to seed subsequent iterations.
Evaluation and Coefficient Optimization
A critical component of LLM4ED is its ability to bridge symbolic generation with numerical precision. For Partial Differential Equations (PDEs), the framework decomposes the LLM-generated expression into subtrees. It then employs sparse regression to determine the optimal coefficients for these terms, ensuring the resulting equation is both accurate and parsimonious.
Iterative Optimization Strategies
LLM4ED distinguishes itself by using LLMs as "parametric-free" optimizers. Unlike traditional genetic algorithms that require rigid, hard-coded mutation rules, LLM4ED performs these operations using natural language. This allows for more context-aware refinements. The framework alternates between two strategies:
- Self-Improvement: The LLM analyzes previous performance scores to identify and remove redundant terms.
- Evolutionary Search (GA): The LLM follows instructions to combine high-scoring equations (crossover) or introduce random variations (mutation).
This alternating approach prevents the search from getting trapped in local optima while maintaining the stability necessary for convergence.
Experimental Results
The framework was rigorously tested on canonical nonlinear systems, including Burgers’ equation and the 2D Navier-Stokes equation, as well as the ODEBench benchmark. Key findings include:
- High Accuracy: LLM4ED successfully identified the exact structure of all six target PDEs. For the Navier-Stokes equation, it achieved a coefficient error of just 0.15%.
- Robust Success Rates: The combined evolutionary and improvement strategy achieved success rates consistently above 80%, significantly outperforming single-strategy baselines.
- Superior Generalization: Equations discovered by the LLM were often more physically meaningful than those from traditional tools like PySR, performing better on unseen test data with different initial conditions.
- Intelligence Hierarchy: Performance scaled with model capability; GPT-4 significantly outperformed GPT-3.5 and smaller open-source models like Llama2-7B.
Conclusion and Future Work
LLM4ED demonstrates that LLMs can effectively automate the discovery of complex physical laws from raw data. While the approach currently faces challenges regarding computational latency and sensitivity to data noise, it opens new avenues for scientific discovery. Future research may involve incorporating prior physics knowledge—such as dimensional analysis or conservation laws—directly into the prompts to further refine the search space and improve robustness.
Summary updated