SAFEdit: Does Multi-Agent Decomposition Resolve the Reliability Challenges of Instructed Code Editing?
- URL: http://arxiv.org/abs/2604.25737v1
- Date: Tue, 28 Apr 2026 15:04:46 GMT
- Title: SAFEdit: Does Multi-Agent Decomposition Resolve the Reliability Challenges of Instructed Code Editing?
- Abstract summary: We propose SAFEdit, a multi-agent framework for instructed code editing.<n>A Planner Agent produces an explicit, visibility-aware edit plan, an Editor Agent applies minimal, literal code modifications, and a Verifier Agent executes real test runs.<n>When tests fail, SAFEdit uses a Failure Abstraction Layer to transform raw test logs into structured diagnostic feedback.
- Score: 25.593993482047342
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Instructed code editing is a significant challenge for large language models (LLMs). On the EditBench benchmark, 39 of 40 evaluated models obtain a task success rate (TSR) below 60 percent, highlighting a gap between general code generation and the ability to perform instruction-driven editing under executable test constraints. To address this, we propose SAFEdit, a multi-agent framework for instructed code editing that decomposes the editing process into specialized roles to improve reliability and reduce unintended code changes. A Planner Agent produces an explicit, visibility-aware edit plan, an Editor Agent applies minimal, literal code modifications, and a Verifier Agent executes real test runs. When tests fail, SAFEdit uses a Failure Abstraction Layer (FAL) to transform raw test logs into structured diagnostic feedback, which is fed back to the Editor to support iterative refinement. We compare SAFEdit against both prior single-model results reported for EditBench and an implemented ReAct single-agent baseline under the same evaluation conditions. We used EditBench to evaluate SAFEdit on 445 code editing instances in five languages (English, Polish, Spanish, Chinese, and Russian) under varying spatial context variants. SAFEdit achieved 68.6 percent TSR, outperforming the single-model baseline by 3.8 percentage points and the ReAct single-agent baseline by 8.6 percentage points. The iterative refinement loop was found to contribute 17.4 percentage points to SAFEdit's overall success rate. SAFEdit's automated error analysis further indicates a reduction in instruction-level hallucinations compared to single-agent approaches, providing an additional framework component for interpreting failures beyond pass or fail outcomes.
Related papers
- ExecCritic: Learn to Test, Test to Improve for Coding Agents [68.42713285082912]
Execution feedback can guide coding agents toward correct repository repairs, but only when the tests capture the behavior requested by the issue.<n>We introduce ExecCritic, combining a test--verify--revise scaffold with a role-specific reinforcement learning recipe for training agents within it.<n>The scaffold separates test construction from source-code repair: a Test agent independently generates repository-native tests, a fail-closed harness qualifies and freezes them, and a Repair agent revises source code from their execution feedback without changing the tests.
arXiv Detail & Related papers (2026-09-08T17:53:37Z) - SWE-Touch: Benchmarking Coding Agents When Users Touch the Code [27.67528029348664]
Real-world software development requires coding agents to operate in shared workspaces where users may inspect and modify code during an ongoing task.<n>We introduce SWE-Touch, a framework that stress-tests this setting through validated Counter-Edits.<n>We evaluate nine coding models on SWE-bench Verified, with additional experiments on longer-horizon tasks from SWE-Bench Pro and DeepSWE.
arXiv Detail & Related papers (2026-08-03T17:03:19Z) - One Rewrite to Fix Them All? Type-Aware Repair Allocation for Text-to-Image Prompt Optimization [59.164665622252016]
Text-to-image (T2I) generators often fail to follow their prompts faithfully, producing wrong counts, swapped attributes, ambiguous relations, and illegible text.<n> Prompt optimization repairs such failures by rewriting the user prompt, requiring no generator retraining, and has yielded promising results.<n>We formulate semantic prompt optimization as atomic repair allocation: each failed proposition is routed to a type-conditioned repair operator before the resulting local constraints are compiled into one executable prompt.
arXiv Detail & Related papers (2026-07-21T05:31:43Z) - GMO-E$^2$DIT: Grounded Multi-Operation Editing for E-Commerce Images [16.213122519512932]
Real-world e-commerce image editing often requires multiple, localized, and auditable operations rather than global restyling.<n>Existing one-shot editors conflate intent resolution, spatial grounding, and synthesis into a single step.<n>We introduce GMO-E$2$DIT, an agentic editing framework that couples a Vision-Language Model (VLM) with a mask-conditioned image editor to tackle structured multi-turn task completion.
arXiv Detail & Related papers (2026-07-01T13:23:45Z) - On-Policy Self-Evolution via Failure Trajectories for Agentic Safety Alignment [54.30690671490447]
Existing safety-alignment signals are largely response-level or off-policy.<n>FATE transforms verifier-scored failures into repair supervision without expert demonstrations.<n>FATE reduces attack success rate by 33.5%, harmful compliance by 82.6%, and improves external trajectory-safety diagnosis by 6.5%.
arXiv Detail & Related papers (2026-05-12T09:56:28Z) - ANNEAL: Adapting LLM Agents via Governed Symbolic Patch Learning [12.44509691077682]
We introduce ANNEAL, a neuro-symbolic agent that converts recurring failures into governed symbolic edits of a process knowledge graph.<n>Its core mechanism, Failure-Driven Knowledge Acquisition (FDKA), localizes the responsible operator, synthesizes a typed patch through constrained LLM generation, and validates the proposal.<n>Across four domains and 27 multi-seed runs, ANNEAL is the only evaluated system that commits persistent structural repairs.
arXiv Detail & Related papers (2026-05-04T05:24:03Z) - SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent [17.74253780030394]
SWE-Edit decomposes code editing into two specialized subagents: a Viewer that extracts task-relevant code on demand, and an Editor that executes modifications from high-level plans.<n>On SWE-bench Verified, SWE-Edit improves resolved rate by 2.1% while reducing inference cost by 17.9%.
arXiv Detail & Related papers (2026-04-28T20:35:09Z) - Edit, But Verify: An Empirical Audit of Instructed Code-Editing Benchmarks [2.5424331328233203]
Instructed code editing accounts for roughly 19% of real-world coding assistant interactions.<n>From a survey of over 150 code-related benchmarks, we find that only two, CanItEdit and EDIT-Bench, target instructed code editing.
arXiv Detail & Related papers (2026-04-06T18:59:42Z) - CoEditor++: Instruction-based Visual Editing via Cognitive Reasoning [98.98349220451216]
CoEditor++ is a training-free framework that decomposes editing into "what to edit" and "how to edit"<n>We show that CoEditor++ achieves state-of-the-art performance in both general editing and responsible editing tasks.<n>Our findings suggest the potential toward cognitive-centric instruction-based image editing.
arXiv Detail & Related papers (2026-01-31T12:20:46Z) - DoVer: Intervention-Driven Auto Debugging for LLM Multi-Agent Systems [48.971606069204825]
DoVer is an intervention-driven debug framework for large language model (LLM)-based multi-agent systems.<n>It augments hypothesis generation with active verification through targeted interventions.<n>DoVer flips 18-28% of failed trials into successes, achieves up to 16% milestone progress, and validates or refutes 30-60% of failure hypotheses.
arXiv Detail & Related papers (2025-12-07T09:23:48Z) - Diffploit: Facilitating Cross-Version Exploit Migration for Open Source Library Vulnerabilities [13.559398564795048]
We propose Diffploit, an iterative, diff-driven exploit migration method structured around two key modules.<n>We evaluate Diffploit on a large-scale dataset containing 102 Java CVEs and 689 version-migration tasks across 79 libraries.<n>It successfully migrates 84.2% exploits, outperforming the change-aware test repair tool TARGET by 52.0% and the rule-based tool in IDEA by 61.6%.
arXiv Detail & Related papers (2025-11-17T04:06:01Z) - MEMOIR: Lifelong Model Editing with Minimal Overwrite and Informed Retention for LLMs [76.28901550926021]
Existing methods for lifelong model editing compromise generalization, interfere with past edits, or fail to scale to long editing sequences.<n>We propose MEMOIR, a novel scalable framework that injects knowledge through a residual memory, while preserving the core capabilities of the pre-trained model.<n>MeMOIR achieves state-of-the-art performance across reliability, generalization, and locality metrics, scaling to thousands of sequential edits with minimal forgetting.
arXiv Detail & Related papers (2025-06-09T16:16:42Z) - Image Editing As Programs with Diffusion Models [69.05164729625052]
We introduce Image Editing As Programs (IEAP), a unified image editing framework built upon the Diffusion Transformer (DiT) architecture.<n>IEAP approaches instructional editing through a reductionist lens, decomposing complex editing instructions into sequences of atomic operations.<n>Our framework delivers superior accuracy and semantic fidelity, particularly for complex, multi-step instructions.
arXiv Detail & Related papers (2025-06-04T16:57:24Z) - Bridging the Editing Gap in LLMs: FineEdit for Precise and Targeted Text Modifications [4.751608548909266]
FineEdit is a specialized editing model explicitly trained for context-aware text modifications.<n>FineEdit outperforms state-of-the-art models on single-turn edits, up to 30% over Llama-3.2-3B, and exceeding Mistral-7B-OpenOrca performance by over 40% on direct editing tasks.
arXiv Detail & Related papers (2025-02-19T01:41:44Z) - The Mirage of Model Editing: Revisiting Evaluation in the Wild [70.17413507444704]
We introduce QAEdit, a new benchmark aligned with widely used question answering (QA) datasets, and WILD, a task-agnostic evaluation framework.<n>Our single editing experiments show that current editing methods perform substantially worse than previously reported.
arXiv Detail & Related papers (2025-02-16T15:57:55Z) - Beyond the Chat: Executable and Verifiable Text-Editing with LLMs [87.84199761550634]
Conversational interfaces powered by Large Language Models (LLMs) have recently become a popular way to obtain feedback during document editing.
We present InkSync, an editing interface that suggests executable edits directly within the document being edited.
arXiv Detail & Related papers (2023-09-27T00:56:17Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.