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

Zihan Yu, Jingtao Ding, Yong Li, Depeng Jin

TL;DR

Symbolic regression (SR) often fails because minimizing prediction error (MSE) doesn't necessarily lead you to the correct mathematical formula. This paper introduces SR4MDL, a search method guided by MDLformer, a Transformer that estimates the "Minimum Description Length" (MDL) of data to provide a monotonic, reliable path toward the ground-truth symbolic expression.

What Problem Does This Paper Address?

The goal of symbolic regression is to find the exact mathematical formula (e.g., $f(x) = \sin(x) + x^2$) that generated a set of observed data. Traditionally, researchers use heuristic searches (like Genetic Programming) to find formulas that minimize Mean Squared Error (MSE).

However, MSE is a deceptive guide. As shown in Figure 1, two formulas can have very similar shapes (low MSE) but completely different symbolic structures. Conversely, a formula that is symbolically "close" to the target might have a massive MSE. This lack of optimal substructure means that small improvements in prediction error don't always mean you are getting closer to the "correct" formula, leading to low recovery rates for complex laws.

Figure 1: Comparison of the two search objectives. In the searching route leading to the target, f ∗, the prediction error (measured by the mean square error, MSE) does not decrease monotonically as the candidate formula’s form gets closer to the target one, whereas the minimum description length (MDL) does. Here, ϕi denotes the function f ∗= ϕi(x, fi) and C[ϕi] is its complexity.

Methods

The authors propose shifting the search objective from minimizing error to minimizing Minimum Description Length (MDL). In this context, MDL represents the number of symbols required to transform the input $x$ into the output $y$.

To make this practical, they developed two core components:

  1. MDLformer: A Transformer-based neural network designed to estimate the MDL of any given dataset. It encodes numeric $(x, y)$ pairs into a latent space. To ensure the network understands the relationship between numbers and symbols, it is trained using a two-step strategy: first aligning numeric data with symbolic prefix notation in a shared latent space, then fine-tuning to predict the actual symbol count (MDL).
  2. SR4MDL: A symbolic regression framework that uses Monte Carlo Tree Search (MCTS). Unlike standard MCTS that uses MSE to reward the search, SR4MDL uses the MDLformer’s predictions to guide the selection of subformulas. It essentially asks: "Which mathematical operation, when applied to my current variables, results in a new dataset with the shortest remaining description length?"
Figure 2: The architecture of MDLformer, showing how it tokenizes numeric data and aligns it with symbolic representations to predict formula complexity.

Datasets

  • Training Data: A massive synthetic corpus of 131 million symbolic-numeric pairs generated on the fly to ensure diversity in formula length and operator types.
  • Ground-Truth Benchmarks: Evaluated on 133 problems from the Strogatz (dynamics) and Feynman (physics) datasets, where the underlying formulas are known.
  • Black-Box Benchmarks: 122 real-world problems from the Penn Machine Learning Benchmark (PMLB) to test generalization on data where a simple "closed-form" solution might not exist.

Key Insights and Ideas

  • MDL as a "Distance" Metric: The most profound insight is that MDL acts as a monotonic distance to the target. If you have a subformula of the target, the "complexity" of the remaining transformation needed to reach the target is strictly less than the complexity of the whole formula.
  • Theoretical Incomputability vs. Practical Estimation: While Kolmogorov complexity (the basis for MDL) is technically incomputable, the authors demonstrate that a large-scale Transformer can approximate it well enough to guide a search effectively.
  • Robustness to Noise: Because MDLformer looks at the "pattern" or "complexity" of the data rather than just fitting points perfectly, the search is remarkably robust. The method's recovery rate with 10% noise is actually higher than many state-of-the-art methods' performance on clean data.

Key Results

  • Superior Recovery: SR4MDL successfully recovered ~50 formulas across the Strogatz and Feynman datasets, outperforming the best baseline (AIFeynman2) by 43.92%.
  • Strogatz Dataset Leap: On the challenging Strogatz dataset, the recovery rate jumped from 15.27% (baseline) to 66.78%.
  • Pareto Efficiency: On black-box problems, SR4MDL consistently found formulas on the "Rank 1" Pareto front, meaning it found the best balance between high accuracy and low formula complexity compared to 20+ other algorithms.

Limitations and Future Work

The authors identify a specific "failure mode" related to non-linear operators like squares and square roots. As seen in Figure 14 (right), these operators can drastically change the numerical distribution of the data, which sometimes confuses the MDLformer and leads the search down incorrect paths.

Future work will likely focus on improving the robustness of the MDL estimation for these specific transformations and further optimizing the search speed to compete with purely generative (but less accurate) end-to-end Transformer models.

Figure 6: A case study showing how MDLformer successfully identifies the correct search path for a complex Feynman equation.

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%. Experiments on 122 unseen black-box problems further demonstrate its generalization performance. We release our code at https://github.com/tsinghua-fib-lab/SR4MDL .
BibTeX
@inproceedings{yu2025symbolic,
  author = {Zihan Yu and Jingtao Ding and Yong Li and Depeng Jin},
  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