HackerPapers

arXiv:2303.12570cs.CL

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

Fengji Zhang, Bei Chen, Yue Zhang, Jacky Keung, Jin Liu, Daoguang Zan, Yi Mao, Jian-Guang Lou, Weizhu Chen

Abstract

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

arXiv comments
accepted by EMNLP 2023 main conference
Journal reference
DOI
Subjects
cs.CLComputation and Language cs.AIArtificial Intelligence cs.PLProgramming Languages cs.SESoftware Engineering

On Hacker News

Linked by 2 identifiable commenters in 4 comments across 3 threads, from Mar 2023 to Jun 2023. Found in 1 HN submission from Mar 2023 to Mar 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • For anyone interested in related research, I used https://mirrorthink.ai to find some background on the state-of-the-art. (disclaimer: this is AI generated, but grounded on contents of papers, with real references, so I'd say it is still constructive) The state-of-the-art in…

      synthiqView on HNParent context

    • Tabby's philosophy is to achieve a completion rate comparable to Codex/Copilot by using a model size of less than 1B, with support for BF16/FP16 that reduces VRAM requirements to 2G or less. This may seem impossible, given that the model size is 10 times smaller than that of…

      wsxiaoysView on HNParent context

    • Cody is more like a wrapper on top of GPT API (gpt-3.5-turbo) endpoint, with related code snippets embed in prompt. It’s not competing the low latency scenario that Github Copilot seats in. There’re recent works show a potential of beating Copilot’s performance (e.g…

      wsxiaoysView on HNParent context

    • That‘ll be super interesting! Local context is definitely the key factor for small models achieving better quality than copilot (related: [1], [2]) . One things I’d really wanna have in Sourcegraph: A Search API supports custom retrieval / ranking. Research works (e.g [2]) show…

      wsxiaoysView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.