Symbolic regression via MDLformer-guided search: from minimizing prediction error to minimizing description length

Zihan Yu, Jingtao Ding, Yong Li · DOI

Introduction

Symbolic Regression (SR) aims to discover concise mathematical expressions that describe observed data. Traditionally, SR algorithms rely on minimizing Mean Squared Error (MSE) through heuristic searches like Genetic Programming. However, the authors identify a critical limitation: the MSE landscape is often "bumpy" and non-monotonic. A formula that is symbolically close to the target may exhibit high MSE, while a symbolically distant one might overfit and show low MSE. This lack of "optimal substructure" makes the search for the true formula difficult.

Methodology

The proposed approach shifts the search objective from prediction error to Minimum Description Length (MDL).

MDLformer Architecture

The core of this method is MDLformer, a Transformer-based model trained to estimate the MDL of a dataset. The architecture consists of an encoder that processes numeric $(x, y)$ pairs, followed by attention pooling and an MLP to predict the complexity of the underlying formula.

MDLformer architecture showing the numeric encoder and symbolic alignment process.

The model was pre-trained on 131 million synthetic symbolic-numeric pairs using a cross-modal strategy. It aligns the latent spaces of numeric data and symbolic prefix notation via contrastive loss before regressing the formula length.

SR4MDL Framework

MDLformer is integrated into a Monte Carlo Tree Search (MCTS) framework called SR4MDL. Instead of searching for candidates with low MSE, SR4MDL uses MDLformer’s output as a "compass" to guide the search toward simpler, more structurally correct subformulas. To bridge the gap between a discovered subformula and the target, a linear transformation layer maps candidate outputs to the target $y$.

Key Insights: The Monotonicity of MDL

A central finding is that while MSE fluctuates wildly during the search process, the estimated MDL decreases monotonically as correct mathematical operators are added. This provides a reliable gradient for discovering the target formula.

Comparison of MSE and MDL during the discovery process. While MSE is non-monotonic, MDL provides a clear path to the target formula.

By viewing SR as a sequence of transformations, the task gains an optimal substructure, meaning the best solution for the whole problem is built from the best solutions to its sub-parts.

Experimental Results

The method was evaluated on several benchmarks, including the Strogatz and Feynman datasets.

  • Recovery Rate: SR4MDL outperformed the state-of-the-art AIFeynman2 by nearly 44%, successfully recovering ~50 formulas across 133 problems. On the Strogatz dataset, it improved the recovery rate from 15.27% to 66.78%.
  • Robustness: The method demonstrated significant resilience to noise. Even with 10% added noise, it maintained recovery rates comparable to other methods on clean data.
  • Generalization: On the Penn Machine Learning Benchmark (PMLB), SR4MDL consistently achieved Pareto dominance, finding the optimal trade-off between accuracy and complexity.

Conclusion

By replacing prediction error with description length as the primary search objective, MDLformer provides a more stable and monotonic landscape for symbolic regression. This approach effectively addresses the "bumpy" search problem and significantly improves the discovery of ground-truth mathematical laws from data. Future work will focus on improving robustness to non-linear transformations and optimizing search efficiency.

Summary updated

Abstract

Symbolic regression, a task discovering the formula best fitting the given data, is typically based on the heuristical search. These methods usually update candidate formulas to obtain new ones with lower prediction errors iteratively. However, since formulas with similar function shapes may have completely different symbolic forms, the prediction error does not decrease monotonously as the search approaches the target formula, causing the low recovery rate of existing methods. To solve this problem, we propose a novel search objective based on the minimum description length, which reflects the distance from the target and decreases monotonically as the search approaches the correct form of the target formula. To estimate the minimum description length of any input data, we design a neural network, MDLformer, which enables robust and scalable estimation through large-scale training. With the MDLformer's output as the search objective, we implement a symbolic regression method, SR4MDL, that can effectively recover the correct mathematical form of the formula. Extensive experiments illustrate its excellent performance in recovering formulas from data. Our method successfully recovers around 50 formulas across two benchmark datasets comprising 133 problems, outperforming state-of-the-art methods by 43.92%.
BibTeX
@inproceedings{yu2025symbolic,
  author = {Zihan Yu and Jingtao Ding and Yong Li},
  title = {{Symbolic regression via MDLformer-guided search: from minimizing prediction error to minimizing description length}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=ljAS7cPAU0},
}
Figure