arXiv:2505.08120cs.CLcs.LG2025-05被引 11

不用复杂工具,只靠大模型上下文就能高效解决代码任务

Putting It All into Context: Simplifying Agents with LCLMs

  • 把整个环境放进长文本上下文,用提示词驱动模型直接推理
  • 无工具模型在SWE-bench上达50.8%解决率,接近顶尖复杂架构
  • 适合追求简洁、低维护成本的自动化系统开发者

近期语言模型代理在自动化复杂现实任务方面展现出巨大潜力。为应对这些难题,代理架构日益复杂,常包含多步检索工具、多个代理及适配底层模型的支撑结构。本文探讨这种复杂性是否必要,以SWE-bench为例进行研究。结果表明,仅将完整环境置于长上下文语言模型(LCLM)的上下文中,并合理提示,即可与精心调优的复杂代理架构相媲美。使用无任何支撑结构的Gemini-1.5-Pro模型,在SWE-Bench-Verified上取得38%的解决率,与采用复杂代理架构的方法(32%)相当。而更强大的Gemini-2.5-Pro在相同无支撑方法下直接达到50.8%解决率。此外,结合Gemini-1.5-Pro与Claude-3.7的两阶段方法也取得了48.6%的竞争力结果。

原文摘要 · Abstract (English)

Recent advances in language model (LM) agents have demonstrated significant potential for automating complex real-world tasks. To make progress on these difficult tasks, LM agent architectures have become increasingly complex, often incorporating multi-step retrieval tools, multiple agents, and scaffolding adapted to the underlying LM. In this work, we investigate whether all of this complexity is necessary, or if parts of these scaffolds can be removed on challenging tasks like SWE-bench. We show that in the case of SWE-bench, simply putting the entire environment into the context of a long context language model (LCLM) and properly prompting the model makes it competitive with carefully tuned, complex agent scaffolds. We show that a Gemini-1.5-Pro model without any scaffolding or tools achieves 38% on SWE-Bench-Verified, comparable with approaches using carefully tuned agent scaffolds (32%). While the unscaffolded approach with Gemini-1.5-Pro falls short of the strongest agentic architectures, we demonstrate that the more capable Gemini-2.5-Pro using the same unscaffolded approach directly attains a 50.8% solve rate. Additionally, a two-stage approach combining Gemini-1.5-Pro with Claude-3.7 achieves a competitive 48.6% solve rate.

语言模型代码生成简化架构长上下文

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。