TL;DR
TSGP-2 improves Transformer-based Symbolic Regression by diversifying its training data to include non-linear functions, effectively neutralizing the "linearity bias" found in its predecessor. This allows the model to propose more meaningful non-linear candidate solutions earlier in the evolutionary search, leading to state-of-the-art performance on complex physics-based benchmarks.
What Problem Does This Paper Address?
Symbolic Regression (SR) is the task of finding a mathematical expression that best fits a given dataset. While standard Genetic Programming (GP) uses random syntactic changes (like swapping subtrees) to find solutions, these often result in "junk" offspring that behave nothing like their parents. Semantic GP tries to fix this by using variation operators that control the behavioral (semantic) change.
A recent breakthrough, Transformer Semantic GP (TSGP), replaced fixed rules with a learned model—a Transformer trained to propose semantically similar offspring. However, the original TSGP had a hidden flaw: it was trained primarily on programs evolved to fit linear target functions. This created a "linearity bias," where the model preferred proposing linear or nearly-linear expressions, causing it to struggle with complex, non-linear problems like those found in physics.
Methods
The authors introduce TSGP-2, which follows the same architecture as TSGP but fundamentally changes the training distribution.
- Measuring Linearity ($\lambda$): To quantify the bias, they define a linearity measure $\lambda$, which is the adjusted $R^2$ of a linear regression fit to a program's outputs. A $\lambda \geq 0.99$ is considered "linear," while $\lambda < 0.5$ is "strongly non-linear."
- Diverse Training Data: Unlike the original TSGP (trained on targets using only the $\{+\}$ operator), TSGP-2 is trained on a rich set of target functions generated using $\{+, -, \times, \div, \sin, \sqrt{\cdot}\}$.
- Exploitable Non-linearity: They introduce a metric to characterize benchmark difficulty: the difference between a Neural Network's fit ($R^2_{NN}$) and a linear fit ($\lambda$). This represents the non-linear structure that a model should be able to capture.
By changing the training targets, the share of linear programs in the training set dropped from 83% in TSGP to just 37% in TSGP-2, as shown below:
Datasets
The authors evaluated the models on 29 problems:
- Feynman Equations (16 problems): Synthetic, noise-free physical formulas. These are often highly non-linear and serve as the primary test for capturing complex structures.
- PMLB Real-World Datasets (13 problems): Datasets with unknown ground truths. Interestingly, the authors found that most of these are actually quite linear or dominated by noise, with only 4 showing significant "exploitable non-linearity."
Key Insights and Ideas
- The "Linearity Trap": Many real-world SR benchmarks are surprisingly linear. A search operator biased toward linearity might perform well on these by accident, but it will fail on fundamental physics problems (Feynman) that require non-linear building blocks.
- Relevance over Randomness: Standard GP produces the most non-linear offspring, but they are usually low quality and discarded by selection. TSGP-2 succeeds because it proposes meaningful non-linearities—changes that are likely to improve the fit rather than just adding complexity.
- Earlier Departure: TSGP-2 "leaves the linear region" much earlier in the search process (around generation 11 vs. generation 16 for TSGP). This early exploration of non-linear space is the key to its superior final accuracy.
Key Results
TSGP-2 achieved the best mean rank across both synthetic and real-world problem sets:
- Feynman Benchmarks: TSGP-2 earned a mean rank of 1.19, significantly outperforming TSGP (1.88) and standard GP (2.94). It was significantly better than TSGP on 7 of the 16 problems and never significantly worse.
- Real-World Benchmarks: TSGP-2 maintained a lead with a mean rank of 1.46 (vs. 1.92 for TSGP).
- Search Dynamics: As shown in Figure 3, TSGP-2 reduces training error faster by evolving non-linear solutions (lower $\lambda$) more rapidly than its competitors.
Limitations and Future Work
While TSGP-2 successfully addresses the linearity bias, the authors note that other forms of bias likely remain. For instance, a model might be biased toward certain "shapes" of functions (e.g., quadratic vs. sinusoidal) depending on its training set.
Future work should investigate how to create even more "comprehensive" training data that covers a wider variety of mathematical behaviors. Additionally, exploring how these learned operators scale to much higher-dimensional problems remains an open question.
Summary updated