arXiv(opens in a new tab)cs.LGSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.09468

Building the Harness Automatically: Self-Play in Code Distills a Text Harness for Black-Box Optimization

Yi Wu, Zheng Ren, Zhiyu Hu, Haochen Wang, Daryl Chang, Li Wei, Ting Wang, Zhen Li, Pooja Gupta, Nitin Jindal, Lukasz Heldt

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

Yi Wu ∗^{*}

Zheng Ren ∗^{*}

Zhiyu Hu

Haochen Wang

Daryl Chang

Li Wei

Ting Wang

Zhen Li

Pooja Gupta

Nitin Jindal

Lukasz Heldt

Google

Mountain View, USA

WUYISH@GOOGLE.COM

MURPHYREN@GOOGLE.COM

HARRYHU@GOOGLE.COM

HAOCHENWW@GOOGLE.COM

DLCHANG@GOOGLE.COM

LIWEI@GOOGLE.COM

TINGWA@GOOGLE.COM

ZHENLIZH@GOOGLE.COM

POOJAGUPTA@GOOGLE.COM

NITINJINDAL@GOOGLE.COM

HELDT@GOOGLE.COM

Abstract

Can an agent learn a numerical search strategy through executable practice and then transfer that strategy as text? We study low-budget black-box optimization, where unaided language models remain well below strong classical optimizers. During development, an agent repeatedly writes and evaluates optimizer programs. It then distills the resulting program and practice record once into a 197-word primary harness (Harness A), which is frozen before evaluation. Harness A reduces Gemini Flash regret by 48% in an independent N = 30 study (p < .001), enters the GP-BO performance range on the practice family, and lowers mean regret on all three held-out BBOB landscapes. The same text improves every tested Gemini executor and transfers to Claude Sonnet, reducing regret by 43% and 49% (p ≤ .005). An independent end-to-end replication produces Harness B, a different program and text at the same performance tier. The same framework also attains the lowest regret on a sealed YouTube reward-tuning production benchmark. Executable practice is thus a viable way to discover a search policy, and language a portable medium for deploying it. 1^{1}

1. Introduction

Many scientific and engineering tasks require optimizing an expensive, gradient-free objective under a small query budget — the setting of Bayesian optimization (BO) and evolutionary strategies (Frazier, 2018; Hansen et al., 2021). LLMs can interpret optimization histories and express search heuristics, but are unreliable numerical optimizers without structure (Huang et al., 2024); recent work therefore embeds them inside established search procedures (Liu et al., 2024; Agarwal et al., 2025).

*. Equal contribution to the work.

  1. Code: https://anonymous.4open.science/r/llm-opt-sandbox-E5B3/README.md.

© Y. Wu*, Z. Ren*, Z. Hu, H. Wang, D. Chang, L. Wei, T. Wang, Z. Li, P. Gupta, N. Jindal & L. Heldt.

Our question is how to learn search behavior that remains dependable after development. Prompt optimizers revise instructions from feedback (Yang et al., 2024; Pryzant et al., 2023; Wang et al., 2024), and reflective systems extend this idea to harness evolution (Agrawal et al., 2026; Lee et al., 2026). Revising from test outcomes, however, leaks evaluation information. We instead distill practice on external development objectives once, gate it, and freeze it before public or internal evaluation; accepted runs are tested fresh and rejected runs are audited separately.

Contributions. We contribute (i) a practice–gate–distill–freeze framework for reusable low-budget search behavior that transfers unchanged across executors; and (ii) an evaluation that seals before testing, reproduces one independently accepted run, and exposes a rejected run.

References (19)