Abstract
Sharpness-Aware Minimization (SAM) was recently introduced as a regularization procedure for training deep neural networks. It simultaneously minimizes the fitness (or loss) function and the so-called fitness sharpness. The latter serves as a measure of the nonlinear behavior of a solution and does so by finding solutions that lie in neighborhoods having uniformly similar loss values across all fitness cases. In this contribution, we adapt SAM for tree Genetic Programming (TGP) by exploring the semantic neighborhoods of solutions using two simple approaches. By capitalizing upon perturbing input and output of program trees, sharpness can be estimated and used as a second optimization criterion during the evolution. The experimental results demonstrate that using any of the two proposed SAM adaptations in TGP allows (i) a significant reduction of tree sizes in the population and (ii) a decrease in redundancy of the trees. When assessed on real-world benchmarks, the generalization ability of the elite solutions does not deteriorate.
Introduction
Genetic Programming (GP) is a powerful tool for symbolic regression, particularly effective when data is scarce. However, it traditionally struggles with two major issues: overfitting in interstitial spaces and bloat. Overfitting occurs when models fit training points perfectly but behave erratically in the gaps between them, while bloat refers to the evolution of massive, overly complex trees filled with redundant code (introns) that slow down computation without improving performance.
To address these, this research adapts Sharpness-Aware Minimization (SAM)—a popular regularization technique from Deep Learning—to the world of Tree Genetic Programming (TGP). By penalizing "sharp" solutions that change wildly with small perturbations, the authors aim to find "flat" minima where model performance remains stable even when parameters or inputs are slightly nudged.
Methodology: SAM-IN and SAM-OUT
The authors propose two computationally efficient ways to measure and minimize "sharpness" in tree-based GP:
- SAM-IN (Input-based): This method injects random noise into the terminals of the tree (input variables and constants). If a small change in input leads to a massive change in the fitness score, the model is considered "sharp" and is penalized during selection.
- SAM-OUT (Output-based): This method leverages Geometric Semantic Mutation (GSM) to create "semantic neighbors" by adding noise directly to the program's output vector. Sharpness is calculated as the variance of performance across these neighbors, offering a faster alternative to node-by-node perturbation.
Both methods utilize a double tournament selection process to balance accuracy with smoothness.
Key Insights and Results
One of the most significant findings is that smoothness acts as a proxy for simplicity. Penalizing sharpness naturally fights bloat because complex, overfit trees tend to be highly sensitive to noise. By selecting for smooth models, the algorithm implicitly favors smaller, more robust expressions.
The "Flat" Ackley Function
A compelling demonstration of SAM's power is seen in its application to the Ackley function, a standard optimization stress test known for its many local minima. SAM-IN successfully produced a smooth, convex approximation that captures the global minimum without the characteristic "spikes" of the original function.
Performance on Benchmarks
Across real-world regression tasks (such as Boston Housing and Concrete Compressive Strength) and synthetic functions, the results were consistent:
- Reduced Complexity: Both SAM variants led to a significant reduction in tree size and code redundancy.
- Maintained Generalization: Elite solutions found via SAM maintained or even improved their generalization ability on test sets compared to standard GP.
- Efficiency: SAM-OUT proved to be a lightweight practical alternative for large-scale runs by operating in the semantic space rather than re-evaluating tree structures.
Conclusion
Adapting SAM to Genetic Programming provides a robust mechanism for regularizing symbolic regression models. By prioritizing solutions in flat regions of the fitness landscape, researchers can evolve simpler, more stable programs that resist bloat and generalize better to unseen data. Future work will focus on automating hyperparameter tuning for noise magnitude and addressing potential instabilities in sharpness estimation.
Summary updated