SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent

Yikai Zhang, Jiaxin Pei, Kenan Li, Qirui Jin, Maoquan Wang, Jin Pan, Yu Kang, Shengyu Fu, Elsie Nallipogu, Junjie Hu, Yufan Huang, Zijian Jin


Abstract
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. 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 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, with the learned adaptive find-replace/whole-file-rewrite policy contributing primarily on the cost axis (-11.8% agent cost). To enable rapid editor iteration, we release PR-Edit, a lightweight editor-level evaluation that rank-orders the editor models we test consistently with their downstream SWE-Bench resolve rate. We release our code at https://github.com/microsoft/SWE-Edit.
Anthology ID:
2026.findings-emnlp.485
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
10168–10185
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.485/
DOI:
Bibkey:
Cite (ACL):
Yikai Zhang, Jiaxin Pei, Kenan Li, Qirui Jin, Maoquan Wang, Jin Pan, Yu Kang, Shengyu Fu, Elsie Nallipogu, Junjie Hu, Yufan Huang, and Zijian Jin. 2026. SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 10168–10185, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent (Zhang et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.485.pdf