arXiv:2610.16966cs.LGOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.16966

Learning to Design SR Solvers: Harness Optimization for Symbolic Regression

Qian Li, Yuxiao Hu, Qihao Duan, Jinyue Yan, Yuntian Chen

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

ABSTRACT

Symbolic regression (SR) seeks explicit equations that explain observed data, and recent methods increasingly employ large language models (LLMs) and agents for equation discovery. However, these systems typically rely on manually designed workflows and prompts. We argue that the SR agent harness should itself be an optimization target: its design shapes search priors and how numerical feedback guides subsequent equation refinement. We therefore propose HarnessSR, a framework for jointly optimizing prompts and workflows to construct reusable SR agents. During both harness optimization and agent execution, HarnessSR supports either PySR or an LLM-based equation generator through tool-specific interfaces, allowing the framework to optimize search guidance for different equation-discovery mechanisms. HarnessSR first optimizes role prompts through equation-discovery feedback in basic workflows, then jointly searches prompt assignments and workflows with brief adaptation to align the two. Finally, it refines role instructions through reflection on residual patterns, candidate equation structures, and search outcomes, improving how these signals guide subsequent equation search. On LSR-Synth in LLM-SRBench, HarnessSR achieves a mean ID Acc0.01Acc_{0.01} of 61.33% across three backbones, a 45.0% relative improvement over the next-best baseline.

1 INTRODUCTION

Symbolic regression (SR) seeks explicit mathematical relationships that explain observed data (Wang et al., 2023; Zhang et al., 2025b; Karniadakis et al., 2021; Krenn et al., 2022; Udrescu & Tegmark, 2020; Udrescu et al., 2020). The resulting equations can be inspected, interpreted, and manipulated, and related to conservation laws, dimensional constraints, and domain theories. SR thus goes beyond numerical prediction to turn observations into testable scientific hypotheses, supporting equation discovery across physics, biology, materials science, and other domains.

Recent advances in large language models (LLMs) and agents have introduced a new paradigm for SR. These methods combine the scientific knowledge and reasoning capabilities of LLMs with numerical search, evaluation, and feedback to iteratively propose, test, and revise equation hypotheses (Xia et al., 2025; Shojaee et al., 2025a; Yang et al., 2026; Zhao et al., 2026). Central to these systems is the solver harness: the executable layer of role instructions, tool interfaces, and control logic that governs interactions between the LLM, data, and numerical tools. The harness governs how scientific knowledge informs candidate proposals and how numerical feedback guides decisions to retain, revise, or replace them. These decisions shape whether subsequent computation explores alternative functional forms, addresses structural errors, or repeats attempts, thereby affecting the quality of equations recovered within a given budget.

However, recent SR solver largely focus on designing solver harnesses by hand, rather than treating the solver harness itself as an object of systematic optimization. Recent research shows that, even

∗^{*}Corresponding author with the base model fixed, harness choices can affect both task performance and inference resource use (Lee et al., 2026; Zhou et al., 2026). Solver harness optimization extends beyond adding new SR roles. Within a fixed workflow, different instructions and few-shot demonstrations can shift the model's output distribution. Conversely, with SR roles and prompts held fixed, changes in workflow topology—including invocation frequency and parallelism—can alter information flow, computational allocation, and final outcomes. These choices influence how data analysis informs equation search, how fitting and residual feedback guide candidate revision, and how finite computation is allocated between exploration and refinement. The SR agent harness is therefore not merely an execution scaffold, but a design variable to be optimized for equation discovery. This motivates us to develop a method for automatically optimizing the harness for reusable SR agent, aiming to improve both the quality and efficiency of equation discovery.

To this end, we introduce HarnessSR, a framework for optimizing reusable SR solver harnesses. We formulate harness design as the joint optimization of role instructions, demonstrations, and workflow organization to obtain an SR agent harness capable of discovering higher-quality equations. To address the strong coupling among these components and tailor their behavior to SR, we adopt a three-stage procedure. First, we optimize role prompts within basic workflows to establish strong starting points for joint search. Second, we jointly optimize workflows and prompt assignments, with brief adaptation to accommodate their interdependence. Third, we use a reflection model to diagnose failures in SR execution traces and refine role instructions, enabling the harness to translate residual patterns, candidate equation structures, and search outcomes into targeted search guidance. This guidance is applied through tool-specific interfaces that translate agent-generated search plans into parameters and inputs for two selectable base SR tools (we integrates PySR and an LLM-based equation generator as agent tools). These interfaces allow agents to steer the chosen tool during both harness optimization and deployment, while keeping its underlying search algorithm fixed. The top-performing harness is then frozen and reused across new SR tasks, with model weights and the underlying search algorithms held fixed. Across three backbones on LSR-Synth, HarnessSR achieves a mean ID Acc0.01Acc_{0.01} of 61.33%, a 45.0% relative improvement over the next-best baseline.

Our main contributions are: (1) We highlight that the solver agent harness can also be regarded as an optimization target for SR task. Its design shapes the LLM's reasoning process, influencing the priors that guide equation search, how search feedback is interpreted and used, and ultimately the quality of the discovered equations. (2) We propose HarnessSR, an SR agent optimization framework that jointly optimizes prompts and workflows and uses reflection on SR execution traces to adapt harness behavior to equation discovery. (3) We demonstrate a 45.0% relative improvement in mean ID Acc0.01Acc_{0.01} over the next-best baseline across three backbones on LSR-Synth.