paperbot · PL 论文追踪

全部论文 待读 收藏

P2 On Multi-Modal Learning of Editing Source Code

论源代码编辑的多模态学习
ASE 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)2021匹配度 2/10 · 该论文研究基于多模态NMT的代码编辑/补丁生成,属于程序合成与机器学习交叉,但未涉及用户核心方向中的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析,也未使用LLM/Agent作为工具或研究对象。其技术栈为较早期的NMT而非当前强模型,与用户关注的问题匹配度低。引用 1 inbox
Saikat Chakraborty, Baishakhi Ray
crossref: 2026-09-12

AI 速览

一句话:提出多模态 NMT 代码编辑引擎 Modit,融合编辑位置、代码上下文与提交消息,显著提升 top-1 正确补丁生成率。

基于神经机器翻译(NMT)的代码编辑系统通常只以待修改代码为输入,输出排序后的补丁候选列表,但正确补丁未必排在首位,其选择往往取决于开发者需求与补丁应用的具体上下文。本文提出 Modit,一个多模态 NMT 代码编辑引擎,同时利用三种模态信息:编辑位置、编辑代码上下文,以及作为开发者自然语言提示代理的提交消息(commit message),以约束补丁生成空间。通过深入的实验与分析,作者表明将开发者提示作为输入模态能够有效缩小补丁搜索空间,并在 top-1 位置生成正确补丁这一指标上优于当前最优模型,验证了多模态信息对自动代码编辑的价值。

问题
现有基于 NMT 的代码编辑系统仅以待修改代码为输入,生成的正确补丁不一定排在候选列表首位,且补丁正确性依赖开发者意图与上下文,导致实际可用性受限。
方法
构建多模态 NMT 代码编辑引擎 Modit,将编辑位置、编辑代码上下文与提交消息(作为开发者自然语言提示的代理)三种模态信息共同作为模型输入来生成补丁。
评估
通过深入的实验与对比分析,考察把开发者提示作为输入模态对补丁搜索空间的影响,并在 top-1 正确补丁生成指标上与当前最优模型进行比较。
原文摘要(Abstract)

In recent years, Neural Machine Translator (NMT) has shown promise in automatically editing source code. Typical NMT based code editor only considers the code that needs to be changed as input and suggests developers with a ranked list of patched code to choose from - where the correct one may not always be at the top of the list. While NMT based code editing systems generate a broad spectrum of plausible patches, the correct one depends on the developers’ requirement and often on the context where the patch is applied. Thus, if developers provide some hints, using natural language, or providing patch context, NMT models can benefit from them.As a proof of concept, in this research, we leverage three modalities of information: edit location, edit code context, commit messages (as a proxy of developers’ hint in natural language) to automatically generate edits with NMT models. To that end, we build Modit, a multi-modal NMT based code editing engine. With in-depth investigation and analysis, we show that developers’ hint as an input modality can narrow the search space for patches and outperform state-of-the-art models to generate correctly patched code in top-1 position.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot6608,
  title = {On Multi-Modal Learning of Editing Source Code},
  author = {Saikat Chakraborty and Baishakhi Ray},
  booktitle = {ASE},
  year = {2021},
  doi = {10.1109/ase51524.2021.9678559}
}