Large language model agents have made strong progress on software engineering, yet current systems suffer from a context coupling problem: the standard code editing interface conflates code inspection, modification planning, and edit execution within a single context window, forcing agents to interleave exploratory viewing with strictly formatted edit generation. Irrelevant context accumulates and edit reliability degrades. We propose SWE-Edit, which decomposes the editing interface into two specialized subagents: a Viewer that extracts task-relevant code on demand, and an Editor that executes modifications from high-level natural language plans -- letting the main agent focus on reasoning while delegating context-intensive operations to clean context windows. On SWE-Bench Verified, this decomposition raises resolve rate by 2.1 pp and cuts inference cost by 17.9%, with consistent gains across multiple reasoning-model families (Kimi-K2, MiniMax-M2.1, GLM-4.7). We further show that effective edit-format selection can be trained into a small model rather than requiring frontier-scale capacity: GRPO training on Qwen3-8B with an adaptive find-replace/whole-file-rewrite policy improves edit success by 12.5 pp and brings an 8B open-source editor to parity with GPT-5-nano on downstream SWE-Bench resolve rate. To enable rapid editor iteration, we release PR-Edit, a lightweight evaluation whose scores correlate strongly with SWE-Bench resolve rate. We release our code at https://github.com/microsoft/SWE-Edit.


翻译:大语言模型智能体在软件工程领域取得了显著进展,但现有系统存在上下文耦合问题:标准代码编辑接口将代码检查、修改规划和编辑执行混在单一上下文窗口内,迫使智能体在探索性查看与严格格式化的编辑生成之间频繁切换。无关上下文不断累积,编辑可靠性随之下降。我们提出SWE-Edit方法,将编辑接口分解为两个专门化的子智能体:一个按需提取任务相关代码的查看器(Viewer)和一个根据高层级自然语言计划执行修改的编辑器(Editor)——让主智能体专注于推理,同时将上下文密集型操作委托给独立的干净上下文窗口。在SWE-Bench验证集上,这种分解使解决率提升2.1个百分点,推理成本降低17.9%,且在多个推理模型系列(Kimi-K2、MiniMax-M2.1、GLM-4.7)上均取得一致提升。我们进一步证明,有效的编辑格式选择可以通过小型模型训练实现,而无需依赖前沿规模能力:在Qwen3-8B上采用自适应查找替换/全文件重写策略进行GRPO训练,使编辑成功率提升12.5个百分点,并使8B开源编辑器的下游SWE-Bench解决率与GPT-5-nano持平。为支持快速迭代编辑器,我们发布轻量级评估基准PR-Edit,其得分与SWE-Bench解决率高度相关。相关代码已开源至https://github.com/microsoft/SWE-Edit。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
博士论文 | 用代码结构感知方法推进代码大模型
Agent Harness综述:大模型智能体执行器工程全景
专知会员服务
27+阅读 · 5月28日
多智能体协作机制
专知会员服务
25+阅读 · 4月25日
智能体工程(Agent Engineering)
专知会员服务
38+阅读 · 2025年12月31日
高效的文本生成方法 — LaserTagger 现已开源
TensorFlow
30+阅读 · 2020年2月27日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 6月12日
Arxiv
0+阅读 · 5月18日
VIP会员
最新内容
《无人机脆弱性利用:网络空间力量的新域》
专知会员服务
2+阅读 · 今天4:08
美空军如何将人工智能从战场部署至后方机关
专知会员服务
11+阅读 · 7月31日
《史诗怒火行动:多域前瞻评估》49页报告
专知会员服务
7+阅读 · 7月31日
《英国防部:未来空战系统数字化战略》33页
专知会员服务
5+阅读 · 7月31日
《面向自主飞行网络的智能体人工智能架构》
专知会员服务
7+阅读 · 7月31日
“史诗怒火”行动:现代多域作战的重要节点
专知会员服务
8+阅读 · 7月30日
《下一代无线网络中的多无人机通信资源管理》
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员