Symbolic expression generation via variational auto-encoder

Sergei Popov, Mikhail Lazarev, Vladislav Belavin, Denis Derkach, Andrey Ustyuzhanin

TL;DR

This paper introduces SEGVAE, a novel deep learning framework that uses variational autoencoders (VAEs) to generate symbolic mathematical expressions from data. It addresses the challenge of finding interpretable scientific laws by incorporating prior knowledge through "fast-check predicates," leading to improved performance, especially in noisy conditions, and outperforming existing state-of-the-art methods.

What Problem Does This Paper Address?

In scientific discovery, particularly in fields like physics and biology, identifying the underlying mathematical laws that govern observed phenomena is crucial. While deep neural networks excel at fitting complex data, they often act as "black boxes," offering little insight into why they make certain predictions. Symbolic regression aims to bridge this gap by discovering interpretable mathematical expressions (formulas) that explain data. However, existing methods struggle with noisy data, lack interpretability, and don't effectively leverage prior scientific knowledge. This paper tackles the challenge of developing a robust and interpretable symbolic regression method that can handle noisy data and incorporate domain expertise.

Methods

The core of the proposed method is a Symbolic Expression Generation via Variational Auto-Encoder (SEGVAE). This approach adapts the VAE architecture, commonly used in natural language processing for generating sequences, to produce mathematical expressions.

Here's a breakdown of the key components:

  • Variational Auto-Encoder (VAE): SEGVAE uses a VAE with LSTM (Long Short-Term Memory) networks for both its encoder and decoder. The VAE learns a compressed, latent representation of mathematical expressions. By sampling from this latent space, the model can generate new, plausible expressions.
  • Polish Notation: Expressions are represented in Polish notation, which is unambiguous and doesn't require brackets, simplifying sequence generation.
  • Pre-training: Before tackling specific datasets, the VAE is pre-trained on a large set of syntactically valid formulas. This step helps the model learn the general structure of mathematical expressions and ensures that most generated formulas are valid.
  • Fast-Check Predicates: This is a crucial innovation. SEGVAE allows incorporating prior scientific knowledge in the form of "fast-check predicates." These predicates can enforce rules about formula structure, allowed operators, variable usage, or even physical constraints. During training, formulas that don't meet these predicates are discarded, significantly pruning the search space and guiding the model towards more relevant solutions.
  • Bank of Best Formulas (BBF): Formulas that best fit the data (measured by mean squared error) and satisfy certain validity checks (e.g., defined within the data domain) are stored in a "Bank of Best Formulas." The VAE is then fine-tuned on this bank, further refining its ability to generate accurate expressions.
  • Constants Handling: The paper discusses two methods for handling constants: either including them in the general library of tokens or using placeholders that are later optimized using algorithms like BFGS.

Datasets

The paper evaluates SEGVAE on two main benchmarks:

  • Nguyen Dataset: A commonly used benchmark for symbolic regression, consisting of 12 formulas. The authors used this dataset as is and also with added Gaussian noise proportional to the dependent variable to test robustness.
  • Livermore Dataset: A new benchmark introduced by the authors of related work (Mundhenk et al., 2021; Petersen et al., 2021). It comprises 22 formulas, with a subset used due to similarities with the Nguyen dataset.

Key Insights and Ideas

  • Prior Knowledge is Powerful: The ability to incorporate scientific intuition via "fast-check predicates" is a game-changer. It dramatically reduces the search space and helps the model find correct formulas, especially when domain knowledge is available.
  • Robustness to Noise: SEGVAE demonstrates significantly better performance on noisy datasets compared to other methods, a critical advantage for real-world experimental data.
  • Interpretability is Key: The paper strongly advocates for symbolic regression as a way to achieve interpretable models, contrasting it with the "black-box" nature of many deep learning approaches.
  • Library Size Matters: The choice of operators and functions in the library is critical. Too small a library limits expressiveness, while too large a library can exponentially increase the search space and hinder performance.

Key Results

  • Improved Recovery Rate: SEGVAE achieved a recovery rate of 65% on the Nguyen dataset with 10% noise, outperforming previous state-of-the-art by 20%.
  • Noise Stability: The model shows remarkable stability in recovery rates even with up to 10% noise, maintaining a 70% recovery rate on average across Nguyen formulas, while competitors' rates drop significantly.
  • Predicate Advantage: When using specific predicates tailored to certain formulas (from Table 3), SEGVAE demonstrated a superior recovery rate compared to DSO, especially on noiseless data.
  • Enhanced Formula Discovery: SEGVAE discovered formulas that were unreachable for DSO, highlighting the flexibility gained from predicates.

Limitations and Future Work

The authors acknowledge several limitations:

  • Dataset Dependence: The quality of the output formulas is dependent on the dataset's size and quality.
  • User Assistance: Obtaining the optimal formula might require user assistance in selecting predicates and choosing from the Pareto front of candidate solutions.
  • Computational Cost: The running time can be noticeable, potentially taking tens of minutes on a modern GPU.

Future work could explore:

  • Automated Predicate Discovery: Developing methods to automatically infer useful predicates from data or domain knowledge.
  • More Sophisticated Libraries: Expanding the operator and function library to cover a wider range of scientific phenomena.
  • Scalability: Further optimizing the algorithm for even larger datasets and more complex problems.

Summary updated

BibTeX
@article{popov2023symbolic,
  author = {Sergei Popov and Mikhail Lazarev and Vladislav Belavin and Denis Derkach and Andrey Ustyuzhanin},
  title = {{Symbolic expression generation via variational auto-encoder}},
  journal = {Peerj Comput. sci},
  year = {2023},
  doi = {10.7717/peerj-cs.1241},
}
Figure