From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuning
Not on the map. Why?
Abstract (arXiv)
The dominant Fill-in-the-Middle (FIM) paradigm for code completion is constrained by its rigid inability to correct contextual errors and reliance on unaligned, insecure Base models. While Chat LLMs offer safety and Agentic workflows provide flexibility, they suffer from performance degradation and prohibitive latency, respectively. To resolve this dilemma, we propose Search-and-Replace Infilling (SRI), a framework that internalizes the agentic verification-and-editing mechanism into a unified, single-pass inference process. By structurally grounding edits via an explicit search phase, SRI harmonizes completion tasks with the instruction-following priors of Chat LLMs, extending the paradigm from static infilling to dynamic context-aware editing. We synthesize a high-quality dataset, SRI-200K, and fine-tune the SRI-Coder series. Extensive evaluations demonstrate that with minimal data (20k samples), SRI-Coder enables Chat models to surpass the completion performance of their Base counterparts. Crucially, unlike FIM-style tuning, SRI preserves general coding competencies and maintains inference latency comparable to standard FIM. We empower the entire Qwen3-Coder series with SRI, encouraging the developer community to leverage this framework for advanced auto-completion and assisted development.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 45 of its 75 references that are in the map. First posted on arXiv 19 Jan 2026.
Builds on
45 of 75 references.
References · 45
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,175
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,829
- 2020GLU Variants Improve Transformercited by 1,724
- 2019Root Mean Square Layer Normalizationcited by 1,425
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 956
- 2024How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMscited by 533
33 more
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2023GPT-4 Is Too Smart To Be Safe: Stealthy Chat with LLMs via Ciphercited by 401
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 401
- 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 400
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2023Multi-Agent Collaboration: Harnessing the Power of Intelligent LLM Agentscited by 329
- 2024Training Software Engineering Agents and Verifiers with SWE-Gymcited by 300
- 2023Low-Resource Languages Jailbreak GPT-4cited by 290
- 2023Exploiting Programmatic Behavior of LLMs: Dual-Use Through Standard Security Attackscited by 268
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 246
- 2023A Wolf in Sheep's Clothing: Generalized Nested Jailbreak Prompts can Fool Large Language Models Easilycited by 242
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2024COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllabilitycited by 162
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 144
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 127
- 2018CODIT: Code Editing with Tree-Based Neural Modelscited by 40
- 2025A Mousetrap: Fooling Large Reasoning Models for Jailbreak with Chain of Iterative Chaoscited by 39
- 2024Evaluation of LLMs on Syntax-Aware Code Fill-in-the-Middle Taskscited by 24
- 2023On the Evaluation of Neural Code Translation: Taxonomy and Benchmarkcited by 23
- 2025SWE-Flow: Synthesizing Software Engineering Data in a Test-Driven Mannercited by 18
- 2025Logic Jailbreak: Efficiently Unlocking LLM Safety Restrictions Through Formal Logical Expressioncited by 16
- 2024Security Attacks on LLM-based Code Completion Toolscited by 15
- 2020Review4Repair: Code Review Aided Automatic Program Repairingcited by 13
- 2025PlotCraft: Pushing the Limits of LLMs for Complex and Interactive Data Visualizationcited by 11
- 2024JumpCoder: Go Beyond Autoregressive Coder via Online Modificationcited by 7
- 2025GRAIL:Learning to Interact with Large Knowledge Graphs for Retrieval Augmented Reasoningcited by 7
- 2026Sparse-RL: Breaking the Memory Wall in LLM Reinforcement Learning via Stable Sparse Rolloutscited by 7
- 2024CoEdPilot: Recommending Code Edits with Learned Prior Edit Relevance, Project-wise Awareness, and Interactive Naturecited by 6
- 2025EditLord: Learning Code Transformation Rules for Code Editingcited by 4
- 2019C-3PO: Cyclic-Three-Phase Optimization for Human-Robot Motion Retargeting based on Reinforcement Learningcited by 2
- 2025Jailbreaking Attacks vs. Content Safety Filters: How Far Are We in the LLM Safety Arms Race?cited by 2
- 2026TableCache: Primary Foreign Key Guided KV Cache Precomputation for Low Latency Text-to-SQLcited by 2
Built on by
Citing papers per year: 2026: 5.
5 papers.
- 2026Qwen3-Coder-Next Technical Reportcited by 60
- 2026Scaling Agentic Verifier for Competitive Codingcited by 5
- 2026What Should I Cite? A RAG Benchmark for Academic Citation Predictioncited by 4
- 2026Learning Cross-View Object Correspondence via Cycle-Consistent Mask Predictioncited by 3
- 2026SAMAS: A Spectrum-Guided Multi-Agent System for Achieving Style Fidelity in Literary Translationcited by 0
- 2026Qwen3-Coder-Next Technical Report28 Feb 2026
- 2026SAMAS: A Spectrum-Guided Multi-Agent System for Achieving Style Fidelity in Literary Translation23 Feb 2026
- 2026Learning Cross-View Object Correspondence via Cycle-Consistent Mask Prediction22 Feb 2026
- 2026Scaling Agentic Verifier for Competitive Coding4 Feb 2026
- 2026What Should I Cite? A RAG Benchmark for Academic Citation Prediction21 Jan 2026
Similar, not cited
Close in wording, no citation either way
- 2025From Context to Intent: Reasoning-Guided Function-Level Code Completion
- 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent
- 2026Function-Aware Fill-in-the-Middle as Mid-Training for Coding Agent Foundation Models
- 2026Evaluating and Achieving Controllable Code Completion in Code LLM
- 2026SAFEdit: Does Multi-Agent Decomposition Resolve the Reliability Challenges of Instructed Code Editing?
- 2025PACIFIC: a framework for generating benchmarks to check Precise Automatically Checked Instruction Following In Code
- 2026CRANE: Constrained Reasoning Injection for Code Agents via Nullspace Editing
- 2026MTAC-IFBench: Benchmarking Instruction-Following in Multi-Turn Agentic Coding