RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generation

By Fengji Zhang, Bei Chen, Yue Zhang, Jin Liu, Daoguang Zan, Yi Mao, Jian-Guang Lou, Weizhu Chen. 2023

516 citations recorded by the source corpus.

The task of repository-level code completion is to continue writing the unfinished code based on a broader context of the repository. While for automated code completion tools, it is difficult to utilize the useful information scattered in different files. We propose RepoCoder, a simple, generic, and effective framework to address the challenge. It streamlines the repository-level code completion process by incorporating a similarity-based retriever and a pre-trained code language model in an iterative retrieval-generation pipeline. RepoCoder makes effective utilization of repository-level information for code completion and has the ability to generate code at various levels of granularity. Moreover, we propose a new benchmark RepoEval, which consists of the latest and high-quality real-world repositories covering line, API invocation, and function body completion scenarios. Experimental results indicate that RepoCoder significantly improves the In-File completion baseline by over 10% in all settings and consistently outperforms the vanilla retrieval-augmented code completion approach. Furthermore, we validate the effectiveness of RepoCoder through comprehensive analysis, providing valuable insights for future research. Our source code and benchmark are publicly available: https://github.com/microsoft/CodeT/tree/main/RepoCoder

Subfields: Computer Networks and Communications, Information Systems, Information Systems and Management, Retrieval-Augmented Generation, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Computer Networks and Communications

  1. Armando Solar-Lezama
  2. Chun Xia
  3. Koushik Sen
  4. Lingming Zhang
  5. Ion Stoica
  6. Scott Shenker
  7. Mosharaf Chowdhury
  8. Sylvia Ratnasamy

In Information Systems

  1. Yinlin Deng
  2. Chun Xia
  3. Lingming Zhang
  4. Ling-Ming Zhang
  5. Soren Dunn
  6. Armando Solar-Lezama
  7. Koushik Sen
  8. Naman Jain

In Information Systems and Management

  1. Armando Solar-Lezama
  2. Koushik Sen
  3. Ion Stoica

In Code Generation & Program Synthesis

  1. Armando Solar-Lezama
  2. Chun Xia
  3. Koushik Sen
  4. Lingming Zhang
  5. Rishabh Singh

Citations in the corpus