arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2203.07722cs.SEcs.AIcs.CL
收藏

ReACC:一个检索增强的代码完成框架

ReACC: A Retrieval-Augmented Code Completion Framework

Microsoft Research Asia(微软亚洲研究院);Seoul National University(首尔国立大学);Microsoft Devdiv(微软开发事业部);Sun Yat-sen University(中山大学)

Shuai Lu, Nan Duan, Hojae Han, Daya Guo, Seung-won Hwang, Alexey Svyatkovskiy

摘要:

代码补全是根据代码上下文预测后续代码的一种技术,可以提高软件开发的生产率。最近的工作已经证明,通过从大规模源代码数据集学习,使用Transformers的统计语言建模可以大大提高代码完成任务的性能。然而,当前的方法仅关注文件或项目内的代码上下文,即内部上下文。我们的区别是利用“外部”上下文,灵感来自人类在编写代码时从相关代码片段复制的行为。具体来说,我们提出了一个检索增强的代码完成框架,利用词汇复制和检索相似的语义引用代码。我们采用了一个阶段明智的训练方法,结合了源代码检索器和自回归语言模型的程序设计语言。我们在Python和Java程序设计语言的代码完成任务中评估了我们的方法,在CodeXGLUE基准测试中实现了最先进的性能。

英文摘要:

Code completion, which aims to predict the following code token(s) according to the code context, can improve the productivity of software development. Recent work has proved that statistical language modeling with transformers can greatly improve the performance in the code completion task via learning from large-scale source code datasets. However, current approaches focus only on code context within the file or project, i.e. internal context. Our distinction is utilizing "external" context, inspired by human behaviors of copying from the related code snippets when writing code. Specifically, we propose a retrieval-augmented code completion framework, leveraging both lexical copying and referring to code with similar semantics by retrieval. We adopt a stage-wise training approach that combines a source code retriever and an auto-regressive language model for programming language. We evaluate our approach in the code completion task in Python and Java programming languages, achieving a state-of-the-art performance on CodeXGLUE benchmark.

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

↑