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

Yikai Zhang, Jiaxin Pei, Kenan Li, Qirui Jin, Maoquan Wang +7 more
4/28/2026
6 citations
cs.SEcs.CL

Official code: microsoft/SWE-Edit (14 stars, Python, MIT, last commit 2026-07-13).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

microsoft/SWE-EditOfficial100%
MIT

Rethinking Code Editing for Efficient Software Engineering Agents

141Python, JinjaFeb 2, 20264 months agoMIT

Similar Papers

Cite this paper

@article{zhang2026sweedit,
  title  = {SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent},
  author = {Yikai Zhang and Jiaxin Pei and Kenan Li and Qirui Jin and Maoquan Wang and Jin Pan and Yu Kang and Shengyu Fu and Elsie Nallipogu and Junjie Hu and Yufan Huang and Zijian Jin},
  year   = {2026},
  eprint = {2604.26102},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.26102v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2604.26102.svg)](https://codeofpaper.com/paper/2604.26102)

Discussion