前沿编码代理使用元编程适应不熟悉的编程语言
Frontier Coding Agents Use Metaprogramming to Adapt to Unfamiliar Programming Languages
AI总结:
研究评估LLM编码代理在陌生语言上的表现,发现强代理通过元编程(如用Python生成目标语言代码)适应,禁止此策略性能大幅下降,而弱代理无法从中受益。
摘要:
基于LLM的编码代理通常在熟悉的软件环境中进行评估:主流语言、常见库和公共仓库。这些基准仍然重要,但它们可能隐藏代理在语言本身不熟悉时的行为。我们使用顺序设置(包括文件编辑、本地执行和隐藏测试评分)在四种深奥编程语言上评估了六个当代编码代理。我们的协议揭示了这些代理之间的能力差异,而主流编码和代理基准(如SWE-Bench Verified和Terminal-Bench 2.0)将这些差异压缩到更窄的范围内。我们观察到,最强的代理Claude Opus 4.6和GPT-5.4 xhigh通常避免直接编写目标语言。在Brainfuck和Befunge-98上,它们编写Python程序来生成目标语言代码,并在本地调试这些生成器。禁止这种元编程策略会导致性能大幅下降。从该策略中提取的文本指导并未实质性地改善较弱的代理。相比之下,来自Opus的用于构建生成器的Python辅助代码(没有解决的基准程序或隐藏测试答案)显著提高了Sonnet 4.6和GPT-5.4 mini在相同问题上的表现,而Haiku 4.5仍然较低。更多的解释器调用和输出令牌改善了较强的代理,但使较弱的代理接近其原始性能,表明这些资源放大了有用的策略而非创造了它们。总之,这些结果表明,强大的编码代理通过使用工具、反馈和工作区状态来构建目标语言的工作模型,从而适应不熟悉的语言。元编程是最明显的案例,但更广泛的差距在于构建和调试在目标语言规则下有效的策略。
英文摘要:
LLM-based coding agents are usually evaluated in familiar software settings: mainstream languages, common libraries, and public repositories. These benchmarks remain important, but they can hide how agents behave when the language itself is unfamiliar. We evaluate six contemporary coding agents on four esoteric programming languages using a sequential setup with file editing, local execution, and hidden-test grading. Our protocol exposes capability differences between these agents that mainstream coding and agentic benchmarks such as SWE-Bench Verified and Terminal-Bench 2.0 compress into much narrower bands. We observe that the strongest agents, Claude Opus 4.6 and GPT-5.4 xhigh, often avoid writing the target language directly. On Brainfuck and Befunge-98, they write Python programs that generate target-language code and debug those generators locally. Forbidding this metaprogramming strategy causes large performance drops. Text guidance distilled from this strategy does not materially improve weaker agents. In contrast, Opus-derived Python helper code for building generators, with no solved benchmark programs or hidden-test answers, sharply improves Sonnet 4.6 and GPT-5.4 mini on the same problems, while Haiku 4.5 remains low. More interpreter calls and output tokens improve stronger agents but leave weaker agents near their original performance, indicating that these resources amplify useful strategies rather than create them. Together, these results show that strong coding agents adapt to unfamiliar languages by using tools, feedback, and workspace state to build a working model of the target language. Metaprogramming is the clearest case, but the broader gap is constructing and debugging a strategy that works under the target language's rules.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。