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.


翻译:主流的填充中间代码(FIM)范式因其僵化地无法修正上下文错误且依赖未对齐、不安全的基座模型而受限。虽然聊天大语言模型提供了安全性,智能体工作流提供了灵活性,但它们分别存在性能下降和延迟过高的问题。为解决这一困境,我们提出搜索替换填充(SRI)框架,该框架将智能体的验证-编辑机制内化为统一的单次推理过程。通过显式搜索阶段结构化地锚定编辑操作,SRI将代码补全任务与聊天大语言模型的指令遵循先验相协调,将范式从静态填充扩展到动态的上下文感知编辑。我们合成了高质量数据集SRI-200K,并微调出SRI-Coder系列模型。大量实验表明,仅需极少数据(2万样本),SRI-Coder即可使聊天模型在补全性能上超越其基座模型。关键的是,与FIM式微调不同,SRI能保持通用编码能力,且推理延迟与标准FIM相当。我们将SRI框架赋能于整个Qwen3-Coder系列,鼓励开发者社区利用此框架实现高级自动补全与辅助开发。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
谷歌 AI:语义文本相似度研究进展
AI研习社
22+阅读 · 2018年6月13日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 1月15日
VIP会员
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员