K-文化的一切——从回归到 K-美妆,发送到您的邮箱订阅邮件

METAL MEDIA

The Optimizer Is the Agent: Reasoning-Driven Search across Prompts, Programs, and ML Workflows

arXiv:2608.067142026-08-10

没有外部搜索算法,单靠一个会用工具的LLM智能体就在提示词、代码和ML训练优化上超过了专用系统

现有的提示词、程序和机器学习工作流优化系统通常依赖进化搜索、赌博机算法或文本梯度这类外部控制器来决定接下来尝试什么,LLM只负责在这个框架内提出局部修改。ReASearch去掉了这个外部控制器,让一个使用工具的智能体自己决定评估什么、如何诊断失败、何时回退,在14个不同任务上比专用优化系统高出2%到40%,在圆填充(Circle Packing)问题上还找到了超越此前人类最佳纪录的解。

METAL MEDIA 解读图

去掉外部控制器:让智能体内化整个搜索策略

证据状态已报告实测结果

  1. 以往做法进化搜索、赌博机算法、文本梯度等外部控制器决定从哪个候选分支继续、如何分配预算,LLM只负责提供局部修改。
  2. ReASearch智能体循环同一个代码智能体具备文件读写、Python/Bash执行能力和持久记忆文件(lessons.md),每一步都自主判断该调用哪个工具。
  3. 领域专用工具提示词优化使用get_next_minibatch、call_student_model_batch、validate_candidate;程序进化使用edit_code和evaluate;ML工作流使用edit_train_file和run_experiment。
  4. 涌现的搜索行为双重验证、复用过往失败经验、从失败分支主动回退、根据预算自适应探索等复杂行为都不是硬编码出来的,而是在推理过程中自然出现的。
  5. 结果对比在相同预算下与GEPA、AdaEvolve、Claude Code对比,ReASearch取得2%到40%的提升,部分任务甚至超越此前的人类最佳纪录。
这是 METAL MEDIA 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 提示词优化、程序进化、机器学习工作流优化这三类完全不同的任务,使用同一套智能体循环和共享工具设计(评估、编辑、Python执行、持久记忆)来处理,只更换领域专用工具和系统提示词。
  2. 不依赖外部搜索算法,而是只给智能体一个系统提示词和一组工具,让它自己判断何时评估、怎么修改、是否验证、失败后是否回退。
  3. python_exec这个Python执行工具让智能体能够对评估日志做统计分析、自主发现失败模式,同时用lessons.md文件持续积累经验教训,支撑长周期的优化过程。
  4. 在AIME、HotpotQA、GSM8K、Terminal-Bench 2.0(提示词优化),圆填充、Heilbronn三角形、事务调度、EPLB、ARC-AGI-2(程序进化),以及NanoGPT、IMG-100、Atari、MuJoCo和一个Kaggle加密货币价格预测任务(ML工作流优化)共14个任务上进行了测试。
  5. 在相同预算(调用次数或时间)下,分别与该领域内的强基线系统GEPA、AdaEvolve、以及Claude Code的官方AutoResearch配置做了对比。
Figure 1: Positioning ReASearch relative to existing methods.
Figure 1: Positioning ReASearch relative to existing methods.
Table 1: Performance on test sets before and after system prompt optimization.
AIME ↑GSM8K ↑HotpotQA ↑Terminal-Bench 2.0 ↑
Baseline46.00 ± 1.3381.20 ± 0.3863.00 ± 1.5035.56 ± 1.48
GEPA50.67 ± 1.1582.11 ± 0.4565.80 ± 0.8042.22 ± 1.28
ReASearch52.00 ± 0.6783.40 ± 0.3067.60 ± 0.5053.33 ± 1.96
Figure 2: Prior methods use LLMs primarily as mutators, with candidate selection and optimization goals determined by external heuristic algorithms. In contrast, ReASearch exposes the entire optimization process through tools, giving the agent full control over the search procedure and enabling it to solve a wide range of tasks.
Figure 2: Prior methods use LLMs primarily as mutators, with candidate selection and optimization goals determined by external heuristic algorithms. In contrast, ReASearch exposes the entire optimization process through tools, giving the agent full control over the search procedure and enabling it to solve a wide range of tasks.
Table 2: Circle Packing Results
AlgorithmModeln=23 ↑n=24 ↑n=25 ↑n=26 ↑n=27 ↑n=28 ↑n=29 ↑n=30 ↑n=31 ↑n=32 ↑
Best known (human)2.4782.5302.5872.6352.6852.7372.7902.8422.8892.939
AdaEvolveGPT-52.4062.5282.5692.6102.6542.6412.6592.7502.7812.707
Sonnet 4.62.4782.4332.5872.6302.5762.6232.7862.8432.8872.810
ReASearchGPT-52.4712.5282.5722.6232.6832.6872.7792.7802.6832.938
Sonnet 4.62.4782.5302.5872.6362.6842.7352.7902.8432.8902.940
Figure 3: We visualize an example agent trajectory for prompt optimization, highlighting automatic verification and final prompt selection. None of this process is hardcoded; it emerges from the guiding instruction, with agents freely deciding each next step.
Figure 3: We visualize an example agent trajectory for prompt optimization, highlighting automatic verification and final prompt selection. None of this process is hardcoded; it emerges from the guiding instruction, with agents freely deciding each next step.
Table 3: Heilbronn Triangle Results
AlgorithmModeln=11 ↑n=12 ↑n=13 ↑n=14 ↑n=15 ↑
Best known (human)0.037040.032600.027020.024300.02111
AdaEvolveGPT-50.029230.031000.022290.016060.01770
Sonnet 4.60.026290.025520.021420.002990.00984
ReASearchGPT-50.035390.031420.024660.022600.01903
Sonnet 4.60.035520.032600.027000.024290.02034
Figure 4: Program evolution and ML workflow optimization exhibit similar patterns: the agent actively uses Python for reasoning and small-scale experiments before running expensive evaluations, while delegating targeted code edits to a separate agent to keep the main agent’s context clean.
Figure 4: Program evolution and ML workflow optimization exhibit similar patterns: the agent actively uses Python for reasoning and small-scale experiments before running expensive evaluations, while delegating targeted code edits to a separate agent to keep the main agent’s context clean.
Table 4: Systems Programming Results (TXN and EPLB)
AlgorithmModelTXN ↑EPLB ↑
GEPAGPT-539840.1445
ShinkaGPT-543290.1272
AdaEvolveGPT-536360.1976
Sonnet 4.642920.1441
ReASearchGPT-542370.2305
Sonnet 4.640320.1471
Figure 5: Tool call frequency statistics for each category.
Figure 5: Tool call frequency statistics for each category.
Table 6: Model training tasks.
MethodNanoGPT ↓IMG-100 ↑Atari (Q*bert) ↑MuJoCo ↑Crypto ↑
Baseline0.998 ± 0.00663.51 ± 0.85475 ± 901537 ± 2200.0953 ± 0.0021 (rank 36)
Claude Code0.974 ± 0.01078.59 ± 1.401250 ± 1803986 ± 4100.0999 ± 0.0028 (rank 29)
ReASearch0.976 ± 0.00883.99 ± 1.104500 ± 3205267 ± 4800.1110 ± 0.0024 (rank 6)
Figure 6: Comparison with GEPA on Terminal-Bench validation accuracy.
Figure 6: Comparison with GEPA on Terminal-Bench validation accuracy.
Table 7: Component ablation on prompt optimization.
MethodAIME ↑Terminal-Bench 2.0 ↑
Baseline46.0035.56
GEPA50.6742.22
ReASearch52.0053.33
ReASearch w/o memory49.3348.15
ReASearch w/o Python tools51.3351.11
Figure 7: Performance and token usage across experiments. For Claude Code, token usage is only available at the end of the optimization run, so we plot it as a linear trajectory.
Figure 7: Performance and token usage across experiments. For Claude Code, token usage is only available at the end of the optimization run, so we plot it as a linear trajectory.
Table 8: Component ablation on ARC-AGI-2 program evolution.
MethodTrain acc ↑Test acc ↑
AdaEvolve21.9%12.5%
ReASearch85.0%50.0%
ReASearch w/o memory60.0%39.2%
ReASearch w/o Python tools51.67%32.5%
Table 9: Open-source backbones on prompt optimization. The AIME and HotpotQA rows for the baseline and ReASearch w/ Claude Sonnet 4.6 match Table 1; the Terminal-Bench 2.0 column here uses GPT-OSS-120B as the student model (rather than GPT-5), so its values differ from Table 1 and are not directly comparable. GLM-5 and Kimi-2.5 are added.
MethodAIME ↑HotpotQA ↑Terminal-Bench 2.0 ↑
Baseline46.00 ± 1.3363.00 ± 1.503.00 ± 0.74
GEPA50.67 ± 1.1565.80 ± 0.80
ReASearch w/ Claude Sonnet 4.652.00 ± 0.6767.60 ± 0.5023.00 ± 2.27
ReASearch w/ GLM-551.33 ± 1.1567.20 ± 0.9014.81 ± 4.07
ReASearch w/ Kimi-2.550.67 ± 0.9466.80 ± 1.008.15 ± 3.39
Table 10: Open-source backbones on ML workflow optimization. The baseline and ReASearch w/ Claude rows match Table 6; GLM-5 and Kimi-2.5 are added.
MethodNanoGPT ↓IMG-100 ↑Atari (Q*bert) ↑MuJoCo ↑Crypto ↑
Baseline0.998 ± 0.00663.51 ± 0.85475 ± 901537 ± 2200.0953 ± 0.0021
ReASearch w/ Claude0.976 ± 0.00883.99 ± 1.104500 ± 3205267 ± 4800.1110 ± 0.0024
ReASearch w/ GLM-50.979 ± 0.00982.80 ± 1.254100 ± 3804920 ± 5100.1085 ± 0.0030
ReASearch w/ Kimi-2.50.981 ± 0.01082.10 ± 1.353900 ± 4204740 ± 5400.1076 ± 0.0033
Table 11: Component ablation on Heilbronn triangle program evolution. The objective is the minimum triangle area; higher is better.
Methodn=11 ↑n=12 ↑n=13 ↑n=14 ↑n=15 ↑
Best known (human)0.037040.032600.027020.024300.02111
AdaEvolve0.026290.025520.021420.002990.00984
ReASearch0.035520.032600.027000.024290.02034
ReASearch w/o memory0.032410.029380.023710.020640.01617
ReASearch w/o Python tools0.033870.028620.024970.018920.01753

研究结果

  • 在四个提示词优化任务(AIME、HotpotQA、GSM8K、Terminal-Bench 2.0)上,在学生模型调用次数相同的条件下,ReASearch在测试集上的表现一致优于GEPA。
  • 在程序进化任务(圆填充、Heilbronn三角形、事务调度、EPLB、ARC-AGI-2)上,在相同评估预算下ReASearch在几乎所有任务上都优于AdaEvolve,部分任务甚至超越了此前已知的人类最佳结果。
  • 在EPLB任务上,智能体诊断出一个过于严格的捐让约束,突破了长达120轮、停滞在约0.21分的瓶颈,将得分提升到0.23;而AdaEvolve(Sonnet)在连续272轮迭代中始终停滞在低61%的水平。
  • 在Heilbronn n=12任务上,智能体将观察到的8重对称结构形式化为数学约束并求解到50位精度;AdaEvolve在n=12和n=14上的表现分别仅达到该水平的78%和12%。
  • 在ML工作流优化中,ReASearch在NanoGPT上与Claude Code在统计上没有明显差异(0.976±0.008 对 0.974±0.010),但在IMG-100、Atari、MuJoCo和加密货币预测任务上用更少的token取得了更好的成绩,在加密货币预测任务中仅用15次实验就将Kaggle排行榜排名从第36位提升到第6位。

可应用场景

  • 用于自动化系统提示词的反复调优工作,而不必单独搭建一套外部搜索算法。
  • 适用于需要反复试错并积累经验的高难度单实例问题,例如几何填充或系统编程调度类的优化任务。
  • 适用于在有限实验预算下需要同时探索超参数、架构和损失函数设计的机器学习训练流水线调优。

局限与待验证事项

  • 评测的14个任务局限于特定领域(数学推理、问答、终端操作、几何优化、系统编程、拼图规则推理及少数几种ML训练场景),尚未验证在其他类型任务上的泛化能力。
  • 每个领域仍需要定制工具集(如get_next_minibatch、edit_code、run_experiment),因此该系统并非完全与领域无关,只是共享同一套智能体循环。
  • 虽然努力使预算与GEPA、AdaEvolve、Claude Code保持一致,但骨干模型差异和API成本等变量未被完全控制。
  • 部分结果仅是每种设置3次独立运行的平均值,报告中未附正式的统计显著性检验。

为什么重要

这表明当前提示词/代码/训练流水线优化工具中人工设计的外部搜索控制逻辑,原则上可以被LLM自身的推理过程内化替代。这对未来构建优化工具的方式有启发:与其编写复杂的外部控制流程,不如设计好的工具集和指令,让智能体自己形成搜索策略。

本文术语

  • 外部控制器(outer-loop controller) · 位于LLM之外、决定尝试什么以及何时停止的搜索算法,如进化搜索、赌博机算法、文本梯度方法
  • python_exec · 让智能体直接运行Python代码以分析评估结果或计算统计量的工具
  • lessons.md · 智能体在运行过程中自己写入的持久记忆文件,记录哪些方法有效、哪些失败
  • AdaEvolve · 此前的一种程序进化基线系统,通过采样离散策略标签、为每个标签生成代码并挑选最优者来搜索,用作对比对象

论文原文摘要(英文)

Recent systems for optimizing prompts, programs, and ML workflows typically rely on explicit outer-loop controllers such as evolutionary search, bandits, or textual-gradient methods. We ask a fundamentally different question: how much of this search policy can be internalized by a single tool-using agent? We present ReASearch, a unified framework for reasoning-driven optimization in which the agent autonomously decides what to evaluate, how to diagnose failures, which edits to make, and when to verify or restart. Rather than serving only as a proposal generator guided by hand-designed heuristics, the agent actively analyzes outcomes, allocates budget, and refines its strategy over long horizons through persistent memory. With a shared agent loop and domain-specific tools, ReASearch instantiates the exact same scaffold to optimize prompts, programs, and ML workflows. Across 14 diverse tasks, it is competitive with and mostly better than specialized optimization systems, achieving gains of 2% to 40% over strong domain-specific baselines, and in some cases discovering solutions that improve on prior human best-known results. Crucially, we observe that complex search behaviors, which are typically implemented by explicit controllers, emerge naturally from the agent's reasoning process.

作者 · Junbo Li, Boyi Liu, Canwen Xu, Yite Wang, Yuxiong He, Zhangyang Wang, Qiang Liu, Zhewei Yao

在 arXiv 阅读

最新论文

全部论文 →

METAL MEDIA 最新报道

图片来源: Junbo Li et al., arXiv:2608.06714, CC BY 4.0