arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.19184cs.CL
收藏

HERO:利用证据进行程序生成中的测试时优化与提示优化

HERO: Harnessing Evidence for Test-time Refinement and Prompt Optimization in Program Generation

University of Washington(华盛顿大学);Microsoft Research(微软研究院);Recursion(递归公司)

Mingyu Lu, Timothy Ossowski, Tristan Naumann, Hoifung Poon, Peniel Argaw

AI总结:

本研究提出HERO模型,结合离线与测试时优化,利用代码执行反馈优化程序生成的提示,在四类代码基准上提升了pass@1指标并优化了执行效率。

摘要:

利用优化通过优化可复用提示和脚手架来改进大型语言模型(LLM),但针对文本转SQL、文本转Python等程序生成任务仍需进一步适配。现有方法常依赖LLM反射器提出优化更新,虽能修复观测到的失败,但也会破坏此前正确的行为。文本转代码任务提供了缓解该问题的天然途径:可执行生成的输出,从而直接评估和验证所提更新的效果。基于此信号,我们引入\textsc{HERO}(\textbf{H}arnessing \textbf{E}vidence for \textbf{R}efinement and \textbf{O}ptimization,即利用证据进行优化与优化),它结合离线与测试时优化。第一阶段,\textsc{HERO}从执行验证的成功与失败中学习可复用提示更新,并在采用前验证候选修订;测试时,我们将生成的代码视为特定实例的优化,利用执行反馈对其进行优化。在四个SQL、Cypher和Python基准测试中,\textsc{HERO}取得最优离线性能,较初始提示提升了7.6个点的pass@1指标,而测试时优化又额外提升2.0个点并提高了执行效率。

英文摘要:

Harness optimization improves LLMs by refining reusable prompts and scaffolding, yet requires further adaptation for program generation tasks such as text-to-SQL and text-to-Python. Existing methods often rely on LLM reflectors to propose harness updates, which can fix observed failures but also disrupt previously correct behavior. Text-to-code tasks offer a natural way to mitigate this issue: we can execute generated outputs, allowing us to evaluate and verify the effects of proposed updates directly. Building on this signal, we introduce HERO Harnessing Evidence for Refinement and Optimization), which combines offline and test-time harness optimization. At the first stage, HERO learns reusable prompt updates from execution-verified successes and failures and validates candidate revisions before adoption. At test time, we treat the generated code as an instance-specific harness and refine it using execution feedback. Across four SQL, Cypher, and Python benchmarks, HERO achieves the best offline performance, improving pass@1 by 7.6 points over the initial prompt, while test-time refinement adds another 2.0 points and improves execution efficiency.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑