NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Deep Generative Symbolic Regression

Samuel Holt, Zhaozhi Qian, Mihaela van der Schaar · DOI

Abstract: Deep Generative Symbolic Regression (DGSR) is a novel framework that leverages pre-trained generative models to discover mathematical equations from data. By using a Bayesian-inspired end-to-end loss function rather than standard cross-entropy, DGSR learns the functional invariances of mathematics (like commutativity and distributivity), allowing it to scale to high-dimensional problems ($d=12$) and outperform state-of-the-art reinforcement learning methods in both accuracy and inference speed.

Introduction

Symbolic Regression (SR) is the task of finding a concise, closed-form equation (e.g., $f(x) = \sin(x_1) + x_2^2$) that best fits a dataset. Unlike linear regression or neural networks, the output is human-interpretable and amenable to scientific analysis.

However, SR faces two massive hurdles: the combinatorial explosion of the search space as variables increase, and the high computational intensity of traditional heuristic searches that start from scratch for every new dataset. Existing deep learning approaches often treat equations like text sequences using cross-entropy loss, which fails to recognize that mathematically identical expressions (e.g., $x_1 + x_2$ and $x_2 + x_1$) are functionally the same.

Methodology

DGSR introduces a deep conditional generative framework consisting of an encoder-decoder setup designed to capture mathematical intuition.

  • The Architecture: The encoder uses a Set Transformer, which is permutation-invariant, to map a dataset of $(X, y)$ points into a latent vector. The decoder is an autoregressive Transformer that generates the equation as a sequence of tokens in prefix notation.
  • Functional Loss: Instead of training the model to predict the "correct" next token, DGSR minimizes the Normalized Mean Squared Error (NMSE) of the generated equation's predictions. Because the process of turning tokens into an executable function is non-differentiable, the framework uses Policy Gradients (specifically Risk-Seeking Policy Gradients and Priority Queue Training) for optimization.
  • Gradient Refinement: At inference time, DGSR performs "gradient refinement" on the decoder weights, allowing the model to specialize its pre-trained mathematical knowledge to the specific dataset it is processing.
The DGSR architecture featuring a Set Transformer encoder and a Transformer decoder optimized via functional loss and policy gradients.

Key Insights

By using an end-to-end NMSE loss, the model learns functional equivalence, such as $x_1(x_2 + x_3) = x_1x_2 + x_1x_3$. This allows the model to navigate the search space much more effectively than models that treat equations as mere text. Furthermore, pre-training on a synthetic dataset of 100,000 equations provides a "warm-start" for the search, where the encoder identifies the general form of the relationship (e.g., trigonometric or polynomial) before the decoder begins generation. Finally, the Set Transformer encoder allows the model to generalize to unseen input dimensions, providing a useful prior even for high-dimensional problems.

Results

DGSR demonstrates significant improvements over existing benchmarks in recovery rate, scalability, and efficiency.

  • State-of-the-Art Recovery: On the SRBench ground-truth datasets, DGSR achieved a recovery rate of 63.25%, a significant jump from the previous best of 52.65% held by AI Feynman.
  • Scalability: In high-dimensional settings ($d=12$), DGSR achieved a 37.86% recovery rate, while leading competitors like NGGP sat at 28.57% and standard Genetic Programming failed entirely.
  • Inference Efficiency: DGSR finds the correct equation using significantly fewer function evaluations, often performing 2-5x faster than pure reinforcement learning methods.
Performance metrics for DGSR compared to baselines: (a) discovery rate of unique equations, (b) percentage of valid equations generated, and (c) recovery rate across varying input dimensions $d$.

Conclusion

DGSR represents a major advancement in Symbolic Regression by integrating deep generative models with a functional understanding of mathematics. While it can still struggle with extremely nested structures and relies on secondary optimizers for numeric constants, its ability to scale to high dimensions and its superior inference speed make it a powerful tool for scientific discovery. Future work may focus on integrating constant prediction directly into the generative process and handling unobserved variables.

Summary updated

BibTeX
@inproceedings{holt2023deep,
  author = {Samuel Holt and Zhaozhi Qian and Mihaela van der Schaar},
  title = {{Deep Generative Symbolic Regression}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=o7koEEMA1bR},
}
Figure