Symbolic Regression (SR) is often considered the "holy grail" of scientific machine learning. Given a dataset, the goal is to find the simplest closed-form mathematical equation (e.g., $f(x) = \sin(x) + x^2$) that explains it. Unlike opaque neural networks, these equations are inherently interpretable and generalize well outside their training distribution.
However, SR faces a massive hurdle: combinatorial explosion. The space of possible equations grows exponentially as you add more variables or operators. Traditional methods like Genetic Programming (GP) or Reinforcement Learning (RL) often fail when the number of input variables exceeds three or four. They are also computationally expensive because they must "re-learn" how to write math for every new dataset. Recent deep learning approaches (like Transformers) are faster but often rely on Cross-Entropy loss, which fails to understand that mathematically equivalent strings (like $a+b$ and $b+a$) represent the same reality.
To address this, researchers have introduced Deep Generative Symbolic Regression (DGSR), a framework that scales SR to high-dimensional datasets by combining pre-trained generative models with gradient-based refinement.
The DGSR Approach
DGSR treats symbolic regression as a probabilistic inference problem. By learning the structural invariances of mathematical equations (like commutativity) during pre-training, DGSR provides a powerful "warm start" that outperforms traditional methods. The framework consists of three main components:
- Invariant Architecture: DGSR uses a Set Transformer encoder to process the input data. This ensures the model is "permutation invariant"—the order of the data points doesn't change the underlying representation.
- End-to-End NMSE Loss: Instead of standard Cross-Entropy (which predicts the next token in a sequence), DGSR is pre-trained using a Normalized Mean Squared Error (NMSE) loss via policy gradients. This allows the model to learn that mathematically equivalent equations are equally "correct," even if their string representations differ.
- Gradient Refinement at Inference: When presented with a new, unseen dataset, DGSR doesn't just blindly sample equations. It performs gradient-based refinement on its decoder weights. This allows the model to "fine-tune" its search for the specific dataset at hand, enabling it to discover equations with more variables than it saw during pre-training.
Key Insights
- Math has a "Grammar": Equations aren't random strings; they have structural regularities (e.g., distributivity: $a(b+c) = ab + ac$). By pre-training on millions of equations, DGSR captures this "latent grammar," allowing it to navigate the search space much more effectively than a model starting from scratch.
- Refinement Beats Pure Sampling: Purely generative models are limited by what they can sample in a few tries. By allowing the model to update its weights during inference (gradient refinement), DGSR bridges the gap between a "good guess" and the exact "true equation."
- Generalizing to Unseen Dimensions: Because the model learns a general representation of how variables interact, it can successfully find equations with 5 or 12 variables even if it was primarily pre-trained on simpler 2-variable equations.
Performance and Results
The authors evaluated DGSR on rigorous benchmarks, including the Feynman Symbolic Regression Database, SRBench, and a custom high-dimensional synthetic dataset.
- Higher Recovery Rates: On the Feynman $d=5$ dataset, DGSR achieved a 69.69% recovery rate, significantly higher than the state-of-the-art RL method (NGGP) at 63.44%. On SRBench, DGSR achieved a 63.25% true equation recovery rate, surpassing the previous best of 52.65%.
- Scaling to High Dimensions: In a challenging $d=12$ synthetic test, DGSR recovered 37.86% of true equations. In contrast, traditional RL methods managed only 28.57%, and previous pre-trained models failed entirely (0%).
- Efficiency: DGSR is highly computationally efficient at inference time. For the Feynman $d=2$ set, it required roughly 66,000 equation evaluations to find the truth, compared to over 112,000 for RL-based solutions.
Limitations and Future Work
While DGSR represents a significant leap forward, challenges remain. Extremely "deep" or highly nested equations still pose a difficulty for the search process. Additionally, optimizing specific floating-point constants (like finding exactly $2.718$ instead of $e$) can get stuck in local optima. Future iterations may involve the model predicting initial guesses for these constants to further streamline discovery. Finally, the current framework assumes all variables in the true equation are present in the dataset and cannot yet "invent" hidden variables to explain the data.
Summary updated