[Paper Review] End-to-end symbolic regression with transformers
This paper proposes an end-to-end symbolic regression method using Transformers that directly predict full mathematical expressions, including numerical constants, by employing a hybrid symbolic-numeric vocabulary. The approach achieves state-of-the-art accuracy on SRBench benchmarks—approaching genetic programming performance—while delivering orders of magnitude faster inference, especially effective in low-noise and extrapolation scenarios with refinement via BFGS.
Symbolic regression, the task of predicting the mathematical expression of a function from the observation of its values, is a difficult task which usually involves a two-step procedure: predicting the "skeleton" of the expression up to the choice of numerical constants, then fitting the constants by optimizing a non-convex loss function. The dominant approach is genetic programming, which evolves candidates by iterating this subroutine a large number of times. Neural networks have recently been tasked to predict the correct skeleton in a single try, but remain much less powerful. In this paper, we challenge this two-step procedure, and task a Transformer to directly predict the full mathematical expression, constants included. One can subsequently refine the predicted constants by feeding them to the non-convex optimizer as an informed initialization. We present ablations to show that this end-to-end approach yields better results, sometimes even without the refinement step. We evaluate our model on problems from the SRBench benchmark and show that our model approaches the performance of state-of-the-art genetic programming with several orders of magnitude faster inference.
Motivation & Objective
- To overcome the limitations of two-step symbolic regression, where skeleton prediction and constant fitting are decoupled and error-prone.
- To enable direct, end-to-end prediction of complete mathematical expressions, including numerical constants, using deep learning.
- To improve inference speed and robustness compared to state-of-the-art genetic programming (GP) methods while maintaining high accuracy.
- To demonstrate scalability to problems with up to 10 input features, extending beyond prior deep learning-based SR models limited to D ≤ 3.
- To evaluate the method’s robustness to noise and extrapolation, and to show that informed initialization via model prediction enhances non-convex optimization.
Proposed method
- The model uses a hybrid symbolic-numeric vocabulary that includes tokens for operators, variables, and numeric constants, enabling end-to-end sequence generation of mathematical expressions.
- A Transformer-based architecture is trained on synthetic datasets to predict full expressions directly from input-output pairs, bypassing skeleton prediction.
- After prediction, the model’s output is refined using BFGS optimization with the predicted constants as an informed initial guess, improving convergence and accuracy.
- The method employs specialized tokenization and generation techniques to scale to higher-dimensional problems (up to D=10), unlike prior models limited to D≤3.
- The training data is synthesized by sampling from a predefined grammar of mathematical expressions, ensuring diverse and realistic training examples.
- Inference is accelerated by a single forward pass of the Transformer, followed by a single BFGS call, enabling real-time deployment.
Experimental results
Research questions
- RQ1Can a Transformer model directly predict full mathematical expressions—including numerical constants—without intermediate skeleton prediction, and achieve competitive performance?
- RQ2Does end-to-end prediction with joint constant estimation improve accuracy and robustness compared to two-step skeleton-based methods?
- RQ3Can the predicted constants serve as an effective initialization for BFGS, reducing optimization failure in non-convex landscapes?
- RQ4How does the model perform in terms of inference speed, accuracy, and generalization across diverse symbolic regression problems, including noisy and out-of-distribution settings?
- RQ5To what extent can the model generalize to higher-dimensional problems (D > 3) compared to prior deep learning-based SR methods?
Key findings
- The end-to-end model achieves test accuracy within 2% of state-of-the-art genetic programming (e.g., Operon) on the SRBench benchmark, with significantly faster inference—up to 1000× faster than GP-based methods.
- On Feynman problems, the model ranks fourth in average accuracy (R² > 0.99) but produces formulas with substantially lower complexity than top-performing GP models.
- With BFGS refinement, the model achieves strong robustness to label noise, outperforming skeleton-only models under high noise conditions.
- The model generalizes well to extrapolation, maintaining reasonable performance even at test input scales up to σ = 32, far beyond training distribution.
- The model demonstrates scalability to 10 input features, a significant improvement over prior deep learning-based SR models limited to D ≤ 3.
- Ablations confirm that end-to-end training with constant prediction yields better results than skeleton-based approaches, even without refinement.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.