Neural–Evolutionary Symbolic Regression with Global Constraints: Constraint-Aware Decoding and Reward Shaping
Abstract
Symbolic regression aims to discover compact, interpretable mathematical expressions from data, but neural generation is challenging because expressions are tree-structured. Existing neural methods often linearize expression trees into token sequences, facilitating autoregressive modeling but obscuring hierarchical relations and complicating structure-dependent constraint enforcement. We propose GCN-SR, a graph-based symbolic regression framework that generates expressions in an explicit tree-aligned form, making structural context available during decoding. To enable batched generation over variable-topology expressions, we introduce Symbolic Perfect Binary Trees (SPBTs), a fixed-topology scaffold that preserves tree hierarchy while supporting graph-based node-attribute prediction. We further introduce Similarity-Weighted Policy Gradient (SWPG) to incorporate genetic programming (GP) refinement without directly imitating GP-refined elites; instead, refined expressions construct similarity-weighted rewards for samples drawn by the current generator. Experiments on standard symbolic regression benchmarks and ablations show that GCN-SR consistently improves exact recovery over strong neural and hybrid baselines under matched evaluation budgets.
Lay Summary
Many scientific and engineering problems require finding mathematical formulas that explain observed data. These formulas are often easier for people to inspect, interpret, and reuse than black-box prediction models, but automatically discovering them is difficult because possible formulas can have many different tree-like structures. Existing neural methods often turn these structures into simple token sequences, which makes them easier to generate but hides important relationships between parts of the formula. This paper introduces GCN-SR, a method that keeps formulas in an explicit tree-aligned form while generating them, so the model can better use structural information and enforce useful rules during search. The method also combines neural generation with genetic programming: improved formulas found by search are used to guide learning through similarity-based rewards, rather than being copied directly. Experiments on standard benchmarks show that GCN-SR recovers correct formulas more reliably than several strong existing methods under the same evaluation budget.