Learning to Design SR Solvers: Harness Optimization for Symbolic Regression
Organizations: Shanghai Jiao Tong University, Shanghai, China · Eastern Institute of Technology, Ningbo, China · The Hong Kong Polytechnic University, Hong Kong, China · Epigenetics Laboratory, Max Planck Institute for Heart and Lung Research
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 of 61.33% across three backbones, a 45.0% relative improvement over the next-best baseline.
Figures & tables
| Parameter | Values | Effect on the workflow |
|---|---|---|
| Activates Analyst to examines observational evidence before initial planning. | ||
| Number of parallel search branches, each executing Planner PySR, or Planner PySR | ||
| Number of search-plan refinement rounds in each branch, following Diagnoser Repairer PySR. | ||
| Number of cross-branch discussion rounds; in each round, each branch uses the shared results to update its own search plan and run PySR. | ||
| Activates Synthesizer to integrate branch findings into a unified plan, followed by one additional PySR run. |
| Target | Initialization workflow | |
|---|---|---|
| Planner | Planner PySR Selection | (0,1,0,0,0) |
| Analyst | Analyst Planner PySR Selection | (1,1,0,0,0) |
| Diag–Re | Planner PySR Diagnoser Repairer PySR Selection | (0,1,1,0,0) |
| Synthesizer | Two parallel [Planner PySR] branches Synthesizer PySR Selection | (0,2,0,0,1) |
| Method | Overall | Physics | Chemistry | Biology | Materials | Time [-1pt]min/task | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Non-LLM methods | |||||||||||
| GPLearn | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 3.15 |
| E2E | 0.78 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 4.00 | 0.00 | 0.43 |
| NeSymReS | 4.65 | 1.29 | 0.00 | 0.00 | 4.63 | 0.00 | 5.56 | 0.00 | 12.00 | 6.67 | 15.84 |
| DSR | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 1.66 |
| Method | Optimized component | ID | ID |
|---|---|---|---|
| SR-Scientist | None | 32.30 | 16.02 |
| SR-Scientist+RL | Model weights | 40.92 | 20.69 |
| HarnessSR | Prompts and workflow | 57.36 | 37.73 |
| Stage | ID | ID | Solver executions |
|---|---|---|---|
| Initial harness | 5.43 | 1.55 | 0 |
| After Stage 1 | 27.91 | 16.54 | 1,792 |
| After Stage 2 | 43.41 | 32.82 | 2,752 |
| After Stage 3 (full) | 65.37 | 38.76 | 4,728 |
| Workflow search | Refinement feedback | ID | ID | LLM calls/task |
|---|---|---|---|---|
| Fixed-pool search | Execution traces | 49.35 | 28.17 | 37 |
| Full-space search | Execution traces | 53.49 | 33.07 | 22 |
| Fixed-pool search | SR diagnostics | 56.59 | 32.30 | 37 |
| Full-space search | SR diagnostics | 65.37 | 38.76 | 23 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Training tasks | Solver executions | Optimization GPUs | Final product |
|---|---|---|---|---|
| SR-Scientist+RL | 1,024 | 15,360 | H200 | Updated model weights |
| HarnessSR | 160 | 4,728 | H100 | Role prompts and solver workflow |
| Method | SA |
|---|---|
| uDSR | 0.52 |
| PySR | 5.17 |
| Domain | Typical problem | Observed variables and equation target | Tasks |
|---|---|---|---|
| Physics | Damped oscillators and other dynamics | Time , position , velocity ; acceleration relation | 44 |
| Chemistry | Reaction kinetics | Time , reactant concentration ; rate of concentration change | 36 |
| Biology | Population growth and dynamics | Time , population ; population growth rate | 24 |
| Materials science | Stress–strain relations | Strain and temperature ; stress | 25 |
| Total | 129 |
| Cumulative calls | ID | ID |
|---|---|---|
| 4 | 2.33 | 0.00 |
| 8 | 2.33 | 0.00 |
| 12 | 2.33 | 0.00 |
| 16 | 2.33 | 0.00 |
| 20 | 2.33 | 0.00 |
| 40 | 6.20 | 0.00 |
| Iteration | Mean cumulative calls | ID | ID |
|---|---|---|---|
| 1 | 12.40 | 9.30 | 5.43 |
| 5 | 54.69 | 21.71 | 11.63 |
| 10 | 103.37 | 29.46 | 13.95 |
| 15 | 149.98 | 33.33 | 17.83 |
| 20 | 196.41 | 37.21 | 19.38 |
| 25 | 240.91 | 42.64 | 21.71 |
| Iteration | Mean cumulative calls | ID | ID |
|---|---|---|---|
| 1 | 40.63 | 0.78 | 0.00 |
| 5 | 135.33 | 4.65 | 2.33 |
| 10 | 253.52 | 6.20 | 2.33 |
| 15 | 371.05 | 5.43 | 3.10 |
| 20 | 499.16 | 8.53 | 3.88 |
| 25 | 627.83 | 10.08 | 4.65 |
| SR backend | ID | ID |
|---|---|---|
| LLM | 59.43 | 34.11 |
| LLM + PySR | 66.67 | 40.05 |
| Method | Overall | Physics | Chemistry | Biology | Materials |
|---|---|---|---|---|---|
| Non-LLM methods | |||||
| PySR | 31.78 | 27.27 | 18.52 | 11.11 | 78.67 |
| Qwen3.6-35B-A3B | |||||
| LLM-SR | 34.88 | 29.55 | 25.00 | 12.50 | 80.00 |
| SR-Scientist | 44.19 | 31.82 | 25.00 | 50.00 | 88.00 |
| Case (domain) | ID NMSE | OOD NMSE | ID / OOD | ID / OOD |
|---|---|---|---|---|
| BPG10 (population growth) | Pass/Pass | Pass/Pass | ||
| PO18 (physical oscillator) | Pass/Pass | Pass/Pass | ||
| MatSci22 (materials science) | Pass/Pass | Pass/Pass |
| Training tasks | ID | ID | Solver executions |
|---|---|---|---|
| 80 | 52.71 | 28.94 | 2,648 |
| 160 | 65.37 | 38.76 | 4,728 |
| 320 | 68.48 | 41.34 | 9,016 |
| 640 | 69.51 | 42.12 | 16,312 |