arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2601.21379cs.SE
收藏

预测开发者对AI生成代码建议的接受度

Predicting Developer Acceptance of AI-Generated Code Suggestions

Beihang University(北京航空航天大学)

Jing Jiang, Liehao Li, Jinyun Hou, Xin Tan, Li Zhang

AI总结:

本文通过分析工业数据,提出CSAP模型预测开发者对AI生成代码建议的接受度,提升了过滤效果和开发者体验。

摘要:

AI辅助编程工具被广泛采用,但其实际效用常常受到不受欢迎的建议的阻碍,这些建议会中断开发者的流程并导致沮丧。尽管现有研究已探讨了编程过程中开发者与AI的交互,但在开发者对AI生成代码建议的接受度的定量分析中仍存在显著差距,部分原因是必要的细粒度交互数据通常是专有的。为了弥合这一差距,本文通过一家大型科技公司66,329次工业开发者-AI交互数据进行了实证研究。我们分析了被接受的代码建议与被拒绝的代码建议之间显著不同的特征。我们发现,被接受的建议具有更高的历史接受次数和比率,无论是对于开发者还是项目,更长的生成间隔,更短的项目中先前的代码上下文,以及更旧的IDE版本。基于这些发现,我们引入了CSAP(代码建议接受预测)来在显示之前预测开发者是否会接受代码建议。我们对CSAP的评估显示,其在不平衡和平衡数据集上分别达到了0.973和0.922的准确率。与大型语言模型基线和生产中的工业过滤器相比,CSAP在不平衡数据集上分别提高了12.6%和69.5%的准确率,在平衡数据集上分别提高了87.0%和140.1%的准确率。我们的结果表明,针对性的个性化是过滤出预测拒绝的代码建议并减少开发者干扰的强大方法。据我们所知,这是首次对大规模工业数据上代码建议接受度的定量研究,这项工作也照亮了AI辅助编程的重要研究方向。

英文摘要:

AI-assisted programming tools are widely adopted, yet their practical utility is often undermined by undesired suggestions that interrupt developer workflows and cause frustration. While existing research has explored developer-AI interactions when programming qualitatively, a significant gap remains in quantitative analysis of developers' acceptance of AI-generated code suggestions, partly because the necessary fine-grained interaction data is often proprietary. To bridge this gap, this paper conducts an empirical study using 66,329 industrial developer-AI interactions from a large technology company. We analyze features that are significantly different between accepted code suggestions and rejected ones. We find that accepted suggestions are characterized by significantly higher historical acceptance counts and ratios for both developers and projects, longer generation intervals, shorter preceding code context in the project, and older IDE versions. Based on these findings, we introduce CSAP (Code Suggestion Acceptance Prediction) to predict whether a developer will accept the code suggestion before it is displayed. Our evaluation of CSAP shows that it achieves the accuracy of 0.973 and 0.922 on imbalanced and balanced dataset respectively. Compared to a large language model baseline and an in-production industrial filter, CSAP relatively improves the accuracy by 12.6\% and 69.5\% on imbalanced dataset, and improves the accuracy by 87.0\% and 140.1\% on balanced dataset. Our results demonstrate that targeted personalization is a powerful approach for filtering out code suggestions with predicted rejection and reduce developer interruption. To the best of our knowledge, it is the first quantitative study of code suggestion acceptance on large-scale industrial data, and this work also sheds light on an important research direction of AI-assisted programming.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑