GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
Wei Liu, Ailun Yu, Daoguang Zan, Bo Shen, Wei Zhang, Haiyan Zhao, Zhi, Jin, Qianxiang Wang

TL;DR
GraphCoder is a retrieval-augmented code completion framework that leverages a graph-based context representation and a coarse-to-fine retrieval process to improve repository-specific code completion performance.
Contribution
It introduces a novel code context graph and a retrieval method that significantly enhances repository-level code completion accuracy and efficiency.
Findings
Achieves higher exact match scores than baseline methods.
Uses less time and space compared to existing approaches.
Effectively captures code context through a structured graph representation.
Abstract
The performance of repository-level code completion depends upon the effective leverage of both general and repository-specific knowledge. Despite the impressive capability of code LLMs in general code completion tasks, they often exhibit less satisfactory performance on repository-level completion due to the lack of repository-specific knowledge in these LLMs. To address this problem, we propose GraphCoder, a retrieval-augmented code completion framework that leverages LLMs' general code knowledge and the repository-specific knowledge via a graph-based retrieval-generation process. In particular, GraphCoder captures the context of completion target more accurately through code context graph (CCG) that consists of control-flow, data- and control-dependence between code statements, a more structured way to capture the completion target context than the sequence-based context used in…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Web Data Mining and Analysis
