Language models guide symbolic equation discovery by controlling search
For researchers in scientific equation discovery, this work demonstrates that using language models to guide search rather than propose equations yields superior results, offering a practical hybrid approach.
The authors propose LLM-PySR, where a language model controls search parameters (variables, operators, transformations, depth) while symbolic regression enumerates and fits expressions, achieving the best balance of accuracy, complexity, stability, and cost across 74 AI-Feynman equations and seven complex tasks, and identifying a compact piecewise-linear relation in a battery dataset.
Scientific equation discovery must combine broad domain priors with strict numerical testing. Symbolic regression supplies numerical grounding but faces a combinatorial search space, whereas many language-model systems ask the model to propose or select formulas directly. We test a different division of labour. We compare role specifications in which the language model acts as equation author, candidate decider or search controller, alongside end-to-end language-model and purely numerical baselines. In the controller setting we propose here, implemented as LLM-PySR, language models specify variables, operators, transformations and search depth; symbolic regression enumerates and fits expressions; and deterministic metrics govern retention. Across 74 AI-Feynman equations and seven complex formula-recovery tasks, search control achieved the strongest observed balance of accuracy, complexity, stability and cost. On an independent battery dataset, LLM-PySR identified a compact piecewise-linear relation between early voltage-curve displacement and cycle life. The results suggest that language models should shape hypothesis exploration rather than decide which equations survive.