arXiv:2610.20685cs.AIOct 2026

Manuscript Offprint

arXiv:2610.20685

L2G-SR: Learning to Guide LLM-based Symbolic Regression

Letian Huang, Xiangyu Wang, Haowei Lin, Di He

ABSTRACT

Symbolic regression searches for an equation that explains observed data. Numerical error is commonly used to guide the search, but it alone can favor an accurate surrogate over a candidate with the right structure. We propose L2G-SR, a framework for LLM-based symbolic regression that guides search with a learned structural verifier. We construct structural supervision signal using tree edit distance (TED), accounting for commutative operators and alternative expression forms. A verifier first aligns numerical observations with the formulas, then learns to score a candidate's structural similarity to the target formula. At search time, the target formula is hidden and the verifier complements numerical error in parent selection. An analyst then uses verifier feedback and diagnostic tools to propose revisions, which a generator converts into refined expressions. On LLM-SRBench, L2G-SR achieves state-of-the-art numerical fit, equation level accuracy and TED across the evaluated LLM backbones and domains. L2G-SR demonstrates the value of learned structural guidance for LLM-based symbolic regression.

1 INTRODUCTION

Symbolic regression discovers both the structure and constants of an expression that explains observed variables, making it useful for interpretable modeling and the discovery of candidate scientific laws (Schmidt & Lipson, 2009; Cranmer, 2023). However, finding an optimal expression is NP-hard in general (Virgolin & Pissis, 2022), and the combinatorial growth of possible structures makes efficient exploration essential. Existing approaches include search-based methods that evolve candidate expressions (Koza, 1992; Cranmer, 2023), neural methods that learn to map observations to symbolic expressions (Biggio et al., 2021; Kamienny et al., 2022), and methods based on large language models (LLMs) that combine scientific priors with numerical feedback to propose and refine equations (Shojaee et al., 2025a; Grayeli et al., 2024; Wang et al., 2025; Pang et al., 2026; Li & Pan, 2026).

Despite these advances, existing methods still rely heavily on numerical fit to guide search and evaluate recovered formulas using metrics such as normalized mean squared error (NMSE) and accuracy at a 1% relative-error tolerance (Acc 0.01_{0.01}). It is essential feedback, but it need not identify the most useful structure to revise: near the origin, x−x3/6x - x^3/6 approximates sin⁡x\sin x despite using different operators, while exp⁡(1.05x)\exp(1.05x) shares the form of exp⁡(x)\exp(x) yet can accumulate substantial error. Numerical metrics alone are therefore insufficient to reliably guide formula discovery, motivating a complementary structural score.

To address this gap, we introduce L2G-SR through three connected components, which guides LLM-based SR with a learned structural verifier (Figure 1). A modified tree edit distance (TED) abstracts constants, matches commutative operands, and compares selected algebraic views to label structural similarity. A learned verifier first aligns observations with their generating formulas, then learns to predict a candidate's structural similarity. A two-signal search combines verifier output and numerical error to select parents, suggest edits, and retain candidates.

On 240 LLM-SRBench equations, L2G-SR achieves the highest or the second highest performance on all metrics and LLM backbones, showing the strong performance of our method. Replacing its structural channel with validation MSE substantially lowers the performance.

Stage 2

A. Verifier

Stage 1

Figure

B. Agent

Figure 1: Overview of L2G-SR. (A) A verifier learns TED with two-stage training. (B) During search, numerical error and predicted TED guide candidate selection and retention.

Our contributions are threefold:

• We propose a modified TED that measures structural similarity between formulas while accommodating common simplifications and equivalent forms, providing structural supervision beyond numerical fit alone.

• We develop a multimodal TED verifier that predicts a candidate’s structural distance to an unseen target formula from the candidate and its observations, making structural feedback available during symbolic regression.

• We integrate this learned feedback into an LLM-guided search agent, enabling it to prioritize and revise formulas that are structurally promising as well as numerically accurate.