ReACC: A Retrieval-Augmented Code Completion Framework

Shuai Lu, Nan Duan, Hojae Han, Daya Guo, Seung-won Hwang +1 more
3/15/2022
cs.SEcs.AIcs.CL
rag

Official code: microsoft/ReACC (67 stars, Python, MIT, last commit 2022-04-18).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

microsoft/ReACCOfficial100%
MIT

Source codes for paper ”ReACC: A Retrieval-Augmented Code Completion Framework“

6715Python, ShellMar 3, 20224 years agoMIT

Similar Papers

Cite this paper

@article{lu2022reacc,
  title  = {ReACC: A Retrieval-Augmented Code Completion Framework},
  author = {Shuai Lu and Nan Duan and Hojae Han and Daya Guo and Seung-won Hwang and Alexey Svyatkovskiy},
  year   = {2022},
  eprint = {2203.07722},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.07722}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.07722.svg)](https://codeofpaper.com/paper/2203.07722)

Discussion