paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Grace: Language Models Meet Code Edits

Grace:语言模型遇上代码编辑
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 3/10 · 论文关注用 LLM 做代码编辑生成,属于 PL+AI 中的代码生成/补丁预测方向,但未涉及静态分析、浮点程序分析、贝叶斯程序分析或 Agentic 程序分析,且核心目标是提升 LLM 的编辑生成能力,与用户“用静态分析服务 ML/Agent”或“用 LLM 改进静态分析”的主线不吻合。引用 27 inbox
Priyanshu Gupta, Avishree Khare, Yasharth Bajpai, Saikat Chakraborty, Sumit Gulwani, Aditya Kanade, Arjun Radhakrishna, Gustavo Soares, Ashish Tiwari
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出Grace方法,通过将LLM条件于相关历史编辑,显著提升代码编辑生成的准确率。

开发者常因修复bug或添加特性而编辑代码,但代码编辑的多样性及开发者意图的隐含性使预测编辑极具挑战。本文提出Grace(Generation conditioned on Associated Code Edits)方法,将预训练大语言模型(LLM)条件于相关的历史关联编辑,利用LLM的生成能力应对编辑多样性,并通过条件化捕捉隐含的开发者意图。作者分别在零样本和微调设置下评估codex和CodeT5,并在两个数据集上实验。结果表明,Grace显著提升LLM性能,相比当前最先进的符号和神经网络方法,在top-1建议中分别多生成29%和54%的正确编辑代码。

问题
预测代码编辑因编辑类型多样且开发者意图难以显式捕捉而极具挑战。
方法
提出Grace,将预训练LLM条件于相关的历史关联编辑,以利用生成能力并捕捉开发者意图。
评估
在零样本和微调设置下分别评估codex和CodeT5,使用两个数据集,并与符号及神经网络SOTA方法比较。
原文摘要(Abstract)

Developers spend a significant amount of time in editing code for a variety of reasons such as bug fixing or adding new features. Designing effective methods to predict code edits has been an active yet challenging area of research due to the diversity of code edits and the difficulty of capturing the developer intent. In this work, we address these challenges by endowing pre-trained large language models (LLMs) with the knowledge of relevant prior associated edits, which we call the Grace (Generation conditioned on Associated Code Edits) method. The generative capability of the LLMs helps address the diversity in code changes and conditioning code generation on prior edits helps capture the latent developer intent. We evaluate two well-known LLMs, codex and CodeT5, in zero-shot and fine-tuning settings respectively. In our experiments with two datasets, Grace boosts the performance of the LLMs significantly, enabling them to generate 29% and 54% more correctly edited code in top-1 suggestions relative to the current state-of-the-art symbolic and neural approaches, respectively.

链接与引用

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

BibTeX
@inproceedings{GuptaKBCGKRS023,
  title = {Grace: Language Models Meet Code Edits},
  author = {Priyanshu Gupta and Avishree Khare and Yasharth Bajpai and Saikat Chakraborty and Sumit Gulwani and Aditya Kanade and Arjun Radhakrishna and Gustavo Soares and Ashish Tiwari},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616253}
}