arXiv:2609.03352cs.NESep 2026

Manuscript Offprint

arXiv:2609.03352

Efficient Constant Optimization for Symbolic Regression with GPU-Accelerated Tree-Based Genetic Programming

Hao Mao, Xu Tony Liu, Shuai Lu, Peng Zhao, Wenzheng Jiang, Yuntian Chen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Hao Mao* Xu T. Liu†‡ Shuai Lu§ Peng Zhao¶ Wenzheng Jiang|| Yuntian Chen**

*The Hong Kong Polytechnic University, Hong Kong SAR, China †University of Washington, USA

‡Amazon Web Services, USA §Jiangxi University of Finance and Economics, China ¶EEO Education Technology, China

||Chongqing Medical University, China **Eastern Institute of Technology, Ningbo, China

Abstract—Constant optimization refines the numerical coefficients of candidate expressions in tree-based genetic programming for symbolic regression. But its per-generation cost has led modern GPU-accelerated frameworks to omit it or restrict it to lightweight forms. We present a GPU-resident, batched Levenberg–Marquardt solver that optimizes constants across a structurally heterogeneous population of expression trees using a fixed number of population-wide CUDA launches per iteration. Reverse-mode automatic differentiation assembles the per-tree Jacobian in one backward sweep, making the dominant per-iteration cost independent of the number of constants per tree, and a double-precision delivery guard guarantees that returned constants are never worse than their initial values. On early-generation populations, the solver sustains up to 5.1×1055.1\times10^5 trees per second on an NVIDIA A100; at a GPU-saturated benchmark configuration it delivers roughly 9.9×9.9\times the throughput of Peron running on a 64-core EPYC 7763, while matching fp64-reference quality. Integrated in-process into EvoGP, the solver enables end-to-end search to recover governing equations on 10 of 18 constructed problems versus 0 for stock EvoGP. Our code is at https://github.com/TensorConv/CuSR.

I. INTRODUCTION

Symbolic regression (SR) discovers closed-form expressions from data by jointly searching over both the structure and the numerical parameters of candidate models. The dominant approach is tree-based genetic programming (TGP), which evolves a population of expression trees through fitness-based selection and genetic operators such as subtree crossover and mutation. However, genetic operators modify tree topology and are ineffective at fine-tuning real-valued constants; consequently, a structurally correct expression may receive poor fitness because its numerical coefficients are suboptimal. Constant optimization (CO) addresses this by solving, for each fixed tree, a continuous nonlinear least-squares subproblem via local optimization, typically Levenberg–Marquardt (LM).

The tension between the benefit of CO and its computational cost is reflected in the design of modern SR systems. PySR, a Julia-based framework on CPU, applies BFGS optimization with a restricted iteration budget per generation to control overhead [1]. Peron, a high-performance C++ library, integrates LM constant optimization but operates within CPU-bound throughput constraints [2]. EvoGP, a GPU-based TGP framework, achieves population-level parallelism through tensorized tree representations and GPU-resident evolutionary op-

erators, yielding substantial gains in evaluation throughput [3]. Critically, however, EvoGP does not natively support constant optimization, leaving a gap between its structural search and the precision needed to recover governing equations with inner constants: coefficients that sit inside a nonlinear function.

Closing this gap is not a straightforward port of existing CPU solvers. In a GPU-resident evolutionary loop, off-GPU constant optimization would incur repeated host-device data transfers that negate the throughput advantage of GPU acceleration. The workload is further complicated by structural heterogeneity: different expression trees contain different numbers of constants and may require different numbers of optimization iterations, which is incompatible with the uniform batched execution model that GPU architectures demand.

In this paper, we address these challenges by designing a GPU-resident, batched LM solver purpose-built for the heterogeneous CO workload in TGP-based symbolic regression, and integrating it directly into EvoGP so that constant optimization runs entirely on the GPU within each generation. Our method co-designs the optimization kernels with the tree evaluation pipeline. A reverse-mode automatic differentiation pass builds the per-tree Jacobian in a single backward sweep. The LM loop executes as a fixed number of population-wide CUDA kernel launches per iteration, and a double-precision delivery guard certifies that the resulting constants are never worse than their initial values. In end-to-end searches on problems constructed to require nonlinear inner-constant fitting, EvoGP with in-loop constant optimization recovers the true governing equations that stock EvoGP does not. To the best of our knowledge, this is the first work to bring batched, second-order constant optimization fully onto the GPU for tree-based symbolic regression. Below are our main contributions.

  1. We present a GPU-resident batched second-order LM primitive that optimizes the constants of a structurally heterogeneous population in a fixed number of population-wide CUDA launches per iteration; reverse-mode automatic differentiation keeps the dominant per-iteration cost independent of per-tree constant count, and a double-precision delivery guard certifies that constants are never worse than their initial values (Section III).

  2. We integrate this primitive in-process into EvoGP, eliminating per-generation subprocess launches and CUDA-context rebuilds so that constant optimization runs inside the search loop; applying it every fifth generation is statistically indistinguishable from applying it every generation (Sections III-E and IV-E).

  3. We build a controlled benchmark for constant optimization (heterogeneous populations calibrated to real GP runs, with known near-optimal targets, solved identically on CPU and GPU), and on constructed inner-constant problems we show that the in-loop GPU solver recovers governing equations that structural evolution alone does not (Sections IV-B and IV-E).

References (25)