AutoHarness: 通过自动合成代码框架提升大语言模型代理
AutoHarness: improving LLM agents by automatically synthesizing a code harness
AI总结:
通过自动合成代码框架,Gemini-2.5-Flash在多个游戏中超越大模型,提升性能并降低成本。
摘要:
尽管近年来语言模型取得了显著进展,但当用作代理时,这些模型往往尝试执行不仅在给定状态下不优,而且被外部环境严格禁止的动作。例如,在最近的Kaggle GameArena国际象棋比赛中,78%的Gemini-2.5-Flash失利归因于非法动作。人们通常手动编写“框架”围绕LLM以防止此类失败。在本文中,我们证明Gemini-2.5-Flash能够自动合成此类代码框架,通过少量的迭代代码优化轮次,根据环境(游戏)的反馈进行。所得到的框架在145种不同的TextArena游戏中阻止了所有非法动作,使较小的Gemini-2.5-Flash模型在性能上优于较大的Gemini-2.5-Pro模型。将我们的技术推向极限,我们能够使Gemini-2.5-Flash生成完整的策略代码,从而消除在决策时使用LLM的需要。所得到的代码策略在16个TextArena单人游戏中比Gemini-2.5-Pro和GPT-5.2-High获得更高的平均奖励。我们的结果表明,使用较小的模型合成定制代码框架(或完整策略)可以优于远大的模型,同时更具成本效益。
英文摘要:
Despite significant strides in language models in the last few years, when used as agents, such models often try to perform actions that are not just suboptimal for a given state, but are strictly prohibited by the external environment. For example, in the recent Kaggle GameArena chess competition, 78% of Gemini-2.5-Flash losses were attributed to illegal moves. Often people manually write "harnesses" around LLMs to prevent such failures. In this paper, we demonstrate that Gemini-2.5-Flash can automatically synthesize such a code harness, using a small number of rounds of iterative code refinement given feedback from the (game) environment. The resulting harness prevents all illegal moves in 145 different TextArena games (both 1-player and 2-player), enabling the smaller Gemini-2.5-Flash model to outperform larger models, such as Gemini-2.5-Pro. Pushing our technique to the limit, we can get Gemini-2.5-Flash to generate the entire policy in code, thus eliminating the need to use the LLM at decision making time. The resulting code-policy receives a higher average reward than Gemini-2.5-Pro and GPT-5.2-High on 16 TextArena 1-player games. Our results show that using a smaller model to synthesize a custom code harness (or entire policy) can outperform a much larger model, while also being more cost effective.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。