Neural-Guided Equation Discovery

Jannis Brugger, Mattia Cerrato, David Richter, Cedric Derstroff, Daniel Maninger, Mira Mezini, Stefan KramerarXiv 2025 · DOI

TL;DR

This paper introduces MGMT, a novel system for discovering mathematical equations from data using a neural-guided Monte Carlo Tree Search (MCTS). MGMT effectively integrates domain knowledge through grammars and explores various neural network architectures for data embedding, demonstrating that supervised learning and grammar-based search spaces outperform reinforcement learning and token-based approaches, respectively.

What Problem Does This Paper Address?

Equation discovery (ED) and symbolic regression (SR) aim to find mathematical equations that best fit observed data. Traditional methods often struggle with vast search spaces, leading to time-consuming processes and uncertain outcomes. While neural networks have shown promise in guiding this search, it remains unclear how to best leverage them, whether through direct application, supervised learning, or MCTS. Furthermore, the utility of grammars in defining the search space and incorporating domain knowledge in these neural-guided approaches is an open question. This paper addresses these challenges by proposing and evaluating a modular system, MGMT, designed to systematically investigate these aspects.

Methods

The core of MGMT is a neural-guided Monte Carlo Tree Search (MCTS). This approach frames equation discovery as a game where a neural network provides guidance on which "moves" (grammar rules) to make in the search tree. The system integrates:

  • Context-Free Grammars: Used to define the structure of possible equations and incorporate domain knowledge, restricting the search space to syntactically valid expressions.
  • Neural Network Guidance: A neural network predicts the probability of applying each grammar rule and estimates the value of a given state (partial equation and data). This guidance is learned through a combination of MCTS results and rewards.
  • Modular Architecture: Allows for experimentation with different neural network architectures for embedding tabular data and different MCTS variants.
  • Contrastive Learning: Used as an auxiliary task to pre-train and evaluate neural network architectures for embedding tabular data in isolation.
  • MCTS Adaptations: The paper explores two adaptations of MCTS: AmEx-MCTS (which avoids revisiting fully explored subtrees) and Risk-seeking MCTS (which prioritizes finding well-matching equations).

Datasets

The paper uses datasets generated from Grammar A, B, and C for training and evaluation. Grammar A is used for comparing data set embedding architectures and for general equation discovery experiments. Grammars B and C are specifically designed to generate equations in the style of the Nguyen equations, used for comparing different MCTS variants and token-based approaches.

Key Insights and Ideas

  • Grammars are Powerful: Using grammars to define the search space is highly effective, allowing for the incorporation of domain knowledge and leading to more efficient and structured searches compared to token-based approaches.
  • Supervised Learning Dominates: For training the guiding neural network, supervised learning consistently outperforms reinforcement learning across various configurations. This suggests that learning from "ground truth" syntax trees is more effective than learning from MCTS rollouts in this context.
  • MCTS Benefits from More Simulations: While MCTS-based training can be effective, it requires a sufficient number of simulations per step to provide meaningful guidance for the neural network. Low simulation counts lead to poor guidance and can trap the search in local optima.
  • Simpler Embeddings Can Be Better: Surprisingly, simpler neural network architectures like CNNs, MLPs, and LSTMs often outperform more complex ones (like NPTs or Text Transformers) for tabular data embedding when integrated into the MGMT system, despite NPTs showing the best performance on the contrastive learning auxiliary task.
  • AmEx-MCTS Offers Efficiency: The AmEx-MCTS adaptation shows a tendency to find equations with fewer simulations compared to classic MCTS, suggesting it's more efficient for this task.

Key Results

  • Grammar vs. Tokens: Experiments show that using grammars as the action space is significantly more effective than token-based approaches, with the latter requiring prohibitively high numbers of simulations or failing to learn.
  • Supervised vs. Reinforcement Learning: In most experimental setups, supervised training of the guiding neural network leads to finding equations with fewer simulations and better overall performance compared to reinforcement learning.
  • Data Set Embeddings Improve Search: Integrating tabular data set embeddings consistently improves the search process, reducing the number of simulations required to find a good equation.
  • Architecture Performance: For tabular data embedding, NPT performed best on the contrastive learning task, but for the overall equation discovery task within MGMT, simpler architectures like CNN, MLP, and LSTM yielded better results.
  • MCTS Simulation Count: The number of MCTS simulations per step significantly impacts performance. 250 simulations generally led to better results than 10 or 50, especially when the prior guidance was poor.

Limitations and Future Work

  • Running Time: The current MCTS-based training can be time-consuming due to the sequential nature of simulations. Future work could explore parallelizing simulations and optimizing the neural network inference.
  • Data Set Embeddings: While embeddings improve performance, the reasons for the superior performance of simpler architectures over more complex ones (like NPT) require further investigation, potentially related to overfitting or hyperparameter tuning.
  • Generalizability: The paper notes that the current system is primarily focused on equation discovery for scientific problems. Extending its applicability to other domains and improving its performance on noisy data are future directions.
  • Meta-Learning: The authors suggest exploring meta-learning approaches to learn how to fit data sets, rather than just fitting individual ones, and to automatically derive known concepts like symmetry or energy conservation.
  • High-Dimensional Tables: Investigating how embedding architectures capture underlying mathematical functions and how they can be applied to high-dimensional tables is also a future research avenue.

Summary updated

BibTeX
@misc{brugger2025neural,
  author = {Jannis Brugger and Mattia Cerrato and David Richter and Cedric Derstroff and Daniel Maninger and Mira Mezini and Stefan Kramer},
  title = {{Neural-Guided Equation Discovery}},
  year = {2025},
  eprint = {2503.16953},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.16953},
}
Figure