Technical Summary: LLM-Based Scientific Equation Discovery via Physics-Informed Token-Regularized Policy Optimization
1. Problem Statement
Symbolic Regression (SR) aims to distill interpretable mathematical equations from observational data, serving as a cornerstone for uncovering physical laws. While recent approaches leverage Large Language Models (LLMs) to generate equation hypotheses by capitalizing on pre-trained scientific priors, existing frameworks suffer from two critical limitations:
- Static Generation: Current methods treat LLMs as static generators, relying on prompt-level guidance (in-context learning) to steer evolutionary search. This paradigm fails to update the model's internal representations based on search feedback, preventing the model from internalizing evaluation signals or adapting its generation strategy to specific problem structures.
- Physics-Agnostic Search: Existing frameworks often prioritize syntactic correctness over physical validity. Without rigorous constraints, LLMs frequently produce equations that fit data numerically but violate fundamental physical principles (e.g., dimensional homogeneity) or contain mathematically redundant structures, leading to overfitting and practical unusability.
The challenge is to transform the LLM from a static proposer into an adaptive generator that can dynamically align its generative distribution with the structural and physical characteristics of the target system.
2. Methodology: PiT-PO
The authors propose PiT-PO (Physics-informed Token-Regularized Policy Optimization), a unified framework that bridges LLM-driven evolutionary exploration with rigorous verification. The framework operates through a closed-loop evolutionary process driven by two synergistic mechanisms:
2.1 In-Search LLM Evolution
Unlike standard approaches that keep the LLM frozen, PiT-PO employs Group Relative Policy Optimization (GRPO) to update the LLM's parameters during the evolutionary search.
- Mechanism: The LLM is treated as a policy πθ generating token sequences. GRPO samples a group of outputs, evaluates them, and updates the policy parameters to maximize a surrogate loss.
- Advantage: This "in-search" fine-tuning allows the model to consolidate effective symbolic patterns and guide subsequent exploration more efficiently, transforming general scientific priors into domain-specific expertise on the fly.
2.2 Dual-Constraint Learning Signals
To ensure the generated equations are both scientifically valid and structurally parsimonious, PiT-PO introduces a dual-constraint mechanism that generates fine-grained, token-level feedback.
A. Hierarchical Physical Constraints
A reward system enforces scientific validity through a hierarchical filter:
- General-Level Constraints: Penalties for Dimensional Homogeneity (Pdim) and Differentiability (Pdiff) to prune physically impossible structures (e.g., unit mismatches).
- Domain-Specific Constraints: Expert knowledge is injected as inductive biases. For turbulence modeling, this includes constraints on Realizability (positive eigenvalues of Reynolds stress), Boundary Condition Consistency (stress decay at walls), Asymptotic Scaling (cubic scaling in viscous sublayers), and Energy Consistency.
- Gated Activation: Physical penalties are activated only after a candidate equation reaches a baseline fitting accuracy threshold, allowing for "free" exploration in early stages before enforcing strict compliance.
B. Theorem-Guided Mathematical Constraints
To address mathematical redundancy, the authors introduce the Support Exclusion Theorem.
- Theory: This theorem provides a theoretical guarantee to identify false discoveries (redundant terms) based on the magnitude of fitted coefficients relative to internal and external interference from other basis functions.
- Token-Level Penalty: If a term is identified as redundant (its coefficient magnitude falls below a derived threshold), a token-level penalty (Ptok) is applied to the specific tokens constituting that term. This penalty is logarithmic, imposing stronger penalties on terms with smaller coefficients.
2.3 Token-Aware Policy Update
Standard GRPO assigns a uniform advantage to all tokens in a sequence. PiT-PO refines this by synthesizing the global reward with the token-level penalty.
- Token-Aware Advantage (A^i,k): The advantage for the k-th token is calculated by standardizing the global reward and subtracting the local token penalty if the token belongs to a redundant term.
- Effect: This creates a "dual-pressure" landscape where global rewards guide the policy toward physically consistent equations, while local penalties surgically excise redundant terms, ensuring the policy learns to suppress theoretically redundant structures explicitly.
2.4 Training Pipeline
The framework utilizes a multi-island topology to prevent premature convergence:
- Island-Based Exploration: Multiple isolated islands evolve distinct lineages of equations to maintain search diversity.
- In-Search Evolution: Trajectories from all islands are aggregated to perform policy optimization using LoRA (Low-Rank Adaptation) for efficiency.
- Hierarchical Selection: A survival-of-the-fittest mechanism retains top-performing candidates and resets underperforming islands with high-fitness seeds.
3. Key Results
3.1 Benchmark Performance
PiT-PO was evaluated on the LLM-SR Suite and LLM-SRBench against state-of-the-art baselines (including GPlearn, PySR, uDSR, RAG-SR, and LLM-SR).
- Accuracy: PiT-PO achieved state-of-the-art performance, recovering the highest number of ground-truth equations. On the LLM-SR Suite, it achieved 100% accuracy on Oscillation 1 and 99.99% on Oscillation 2 (using the 8B backbone). It significantly outperformed baselines on E. coli Growth and achieved competitive results on Stress-Strain, though it did not surpass the 4o-mini baseline on the latter.
- Symbolic Accuracy: On LLM-SRBench (239 tasks), PiT-PO achieved the highest Symbolic Accuracy (SA) across all categories (Chemistry, Biology, Physics, Material Science), demonstrating superior ability to recover the correct symbolic form rather than just fitting numerically.
- Efficiency: PiT-PO demonstrated faster convergence and the ability to escape stagnation regimes where baseline methods (like LLM-SR) plateaued at low-MSE but incorrect structures.
3.2 Empowerment of Small Models
A significant finding is that PiT-PO enables small-scale, open-source models to rival or outperform large, closed-source models in specific contexts.
- Using a quantized Llama-3.2-1B model, PiT-PO achieved performance competitive with or superior to LLM-SR using Mixtral 8x7B and 4o-mini on Oscillation tasks and E. coli Growth. However, on the Stress-Strain task, the 1B model (76.91% accuracy) underperformed the 4o-mini baseline (85.33%), indicating that while the framework significantly bridges the capability gap, it does not universally surpass all proprietary giants across every metric.
- This suggests that the in-search policy optimization effectively enhances smaller models, democratizing access to high-performance scientific discovery tools on consumer-grade hardware, particularly for tasks where structural discovery is paramount.
3.3 Real-World Application: Turbulence Modeling
The framework was applied to discover non-linear constitutive relations for Reynolds stress anisotropy in Flow over Periodic Hills.
- Performance: The discovered model improved upon traditional RANS approaches (specifically the k−ω SST model) by producing anisotropic Reynolds stresses closer to Direct Numerical Simulation (DNS) references.
- Physical Fidelity: The learned model showed enhanced physical consistency, reducing non-physical extremes and providing more accurate predictions of flow separation bubbles and skin friction coefficients compared to standard RANS and other SR-based methods.
3.4 Ablation Studies
Ablation studies confirmed the necessity of both components:
- Removing physical constraints (w/o Phy) led to a substantial deterioration in NMSE and generalization.
- Removing token regularization (w/o TokenReg) resulted in the persistence of redundant terms and a larger generalization gap between In-Distribution (ID) and Out-Of-Distribution (OOD) data.
4. Significance and Claims
The paper claims that PiT-PO fundamentally shifts the role of LLMs in scientific discovery from static proposers to adaptive, physics-aware generators.
- Scientific Consistency: By integrating hierarchical physical constraints and theorem-guided token regularization, PiT-PO aligns generation with numerical fitness, scientific consistency, and parsimony simultaneously.
- Democratization: The ability of PiT-PO to empower small models (e.g., 1B parameters) to rival closed-source giants on key discovery tasks establishes a practical methodology for automated scientific discovery that does not rely on massive compute resources or proprietary APIs, though performance varies by task complexity.
- Practical Utility: The successful application to turbulence modeling demonstrates that the discovered symbolic corrections have tangible value in real-world engineering workflows, improving flow-field predictions beyond what is possible with standard linear models.
The authors conclude that this approach establishes a new state-of-the-art for SR benchmarks and offers a robust pathway for integrating domain-specific physical knowledge into the learning dynamics of LLMs.