论文精选72°

前沿编程智能体用元编程适应陌生语言,Claude Opus 4.6 和 GPT-5.4 表现突出

Frontier Coding Agents Use Metaprogramming to Adapt to Unfamiliar Programming Languages

精选理由

做 AI 编程智能体或评估基准的团队,这篇论文揭示了主流基准(如 SWE-Bench)掩盖的能力差距——强智能体在陌生语言上的元编程策略值得借鉴,建议点开看具体实现方法。

AI 摘要

一项新研究评估了六个当代编程智能体在四种冷门编程语言(如 Brainfuck 和 Befunge-98)上的表现,发现最强智能体(Claude Opus 4.6 和 GPT-5.4 xhigh)会采用元编程策略——先写 Python 程序生成目标语言代码并本地调试,而非直接写目标语言。禁止这种策略会导致性能大幅下降。研究还发现,从强模型提炼的文本指导对弱模型帮助有限,但提供 Python 辅助代码能显著提升 Sonnet 4.6 和 GPT-5.4 mini 的表现。这表明强智能体通过工具、反馈和工作区状态构建目标语言的工作模型来适应陌生环境,元编程只是最明显的例子。

原文 · arXiv cs.AI

Frontier Coding Agents Use Metaprogramming to Adapt to Unfamiliar Programming Languages

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.