返回全部动态

扩散语言模型应如何编辑代码?四种接口与组合鸿沟

原标题:How Should Diffusion Language Models Edit Code?

arXiv cs.SE一手来源研究质量 83

AI 摘要

该研究系统比较了掩码扩散语言模型(MDLM)在代码编辑中的四种接口:整文件重写、搜索替换、先定位后填充、token级编辑。在CanItEdit基准上的实验揭示了一个“组合鸿沟”:当给定正确的编辑位置时,扩散模型能协调多处修改,但一旦需要模型自己预测编辑位置,这种能力就大幅丧失。研究进一步分离出两个独立要求——覆盖所有必要修改区域,以及精确划定区域边界;扩大区域以保证覆盖反而会因需要重新生成未改动代码而降低成功率。

以上摘要由 AI 生成,可能存在误差。事实请以原文为准。

正文节选

How Should Diffusion Language Models Edit Code? Abstract Code editing requires a model to decide where to make changes, generate the new content, and preserve everything else. We study how masked diffusion language models divide these responsibilities across four editing interfaces: whole-file rewriting, search-and-replace, locate-then-infill, and token-level editing. Experiments on CanItEdit reveal a composition gap: diffusion models can generate coordinated changes when the correct edit locati


发布时间:2026-10-01 12:00
抓取时间:2026-10-01 13:31
来源机构:arXiv
阅读原文arxiv.org