LegoSR: A Unified Framework for Self-improving Agent-Guided Scientific Discovery
Organizations: The Hong Kong Polytechnic University, Hong Kong SAR, China · Eastern Institute of Technology, Ningbo, China · Amazon Web Services, Seattle, USA · University of Washington, Seattle, USA ·
Abstract
Equation discovery solvers often use different data interfaces, equation representations and evaluation criteria, making their results difficult to compare. We present LegoSR, a unified framework for algebraic symbolic regression and differential equation discovery. LegoSR integrates seven solvers through a common equation representation and evaluation process, and supports searches constrained by partially known equations. Researchers can run solvers directly or use LegoSR Agent, which selects solvers and adapts searches based on solver knowledge, intermediate results and lessons from earlier tasks. On noisy ordinary and partial differential equation benchmarks, LegoSR Agent recovers nearly as many equations as the union of seven expert-tuned solvers and outperforms a generic agent with the same model, tools and budget by up to 29 percentage points. Three examples demonstrate basic use, adaptive solver selection and discovery guided by partial physical knowledge.
Figures & tables
| Method | Approach | Key characteristics |
|---|---|---|
| SINDy/PySINDy [ 2 , 3 , 15 ] | Sparse regression | Sparse selection from a user-defined library of candidate terms |
| DLGA-PDE [ 4 ] | Neural network and genetic algorithm | Neural-network derivative estimation and evolutionary construction of candidate terms |
| SGA-PDE [ 5 ] | Genetic programming | Open-form discovery of compound and fractional terms using expression trees |
| PySR [ 6 ] | Evolutionary symbolic regression | Joint search over expression structures and numerical constants, balancing accuracy and complexity |
| DISCOVER [ 7 ] | Reinforcement learning | Symbol-by-symbol equation generation with constraints on the search space |
| LLM4ED [ 9 ] | Large language model | Generation and refinement of candidate equations using prompts and evaluation feedback |
| Noise | UNION | Generic Agent | LegoSR Agent |
|---|---|---|---|
| 0% | 52.2% (70) | 50.0% (67) | 48.5% (65) |
| 1% | 49.3% (66) | 48.5% (65) | 50.0% (67) |
| 5% | 44.8% (60) | 44.0% (59) | 45.5% (61) |
| Task | Noise | UNION | Generic Agent | LegoSR Agent |
|---|---|---|---|---|
| ODE (40) | 0% | 70.0% (28) | 65.0% (26) | 67.5% (27) |
| 1% | 55.0% (22) | 47.5% (19) | 52.5% (21) | |
| 5% | 42.5% (17) | 30.0% (12) | 40.0% (16) | |
| PDE (17) | 0% | 100.0% (17) | 94.1% (16) | 94.1% (16) |
| 1% | 94.1% (16) | 58.8% (10) | 88.2% (15) | |
| 5% | 82.4% (14) | 52.9% 0 (9) | 82.4% (14) |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| System | Equations |
|---|---|
| Harmonic oscillator | , |
| Damped harmonic oscillator | , |
| Damped pendulum | , |
| Duffing oscillator | , |
| Van der Pol oscillator | , |
| Lorenz system | , , |
| Problem | Equation | Domain | Grid |
|---|---|---|---|
| Burgers (sine initial state) [ 5 ] | |||
| Burgers (Gaussian initial state) [ 3 ] | |||
| Burgers (shock) [ 46 ] | |||
| 2D Burgers [ 10 ] | |||
| KdV [ 5 ] | |||
| Kuramoto–Sivashinsky [ 47 ] |
AI Agents for Scientific Discovery
AI agents for scientific discovery use language models, tools, and experiments to generate, test, and refine scientific knowledge.
See all 288 papers