RepoHyper: Search-Expand-Refine on Semantic Graphs for Repository-Level Code Completion

Huy N. Phan, Hoang N. Phan, Tien N. Nguyen, Nghi D. Q. Bui
3/10/2024
29 citations
cs.SEcs.AI

Official code: FSoft-AI4Code/RepoHyper (74 stars, Jupyter Notebook, Apache-2.0, last commit 2024-09-03).

Abstract

Code Large Language Models (CodeLLMs) have demonstrated impressive proficiency in code completion tasks. However, they often fall short of fully understanding the extensive context of a project repository, such as the intricacies of relevant files and class hierarchies, which can result in less precise completions.

Show full abstract

To overcome these limitations, we present \tool, a multifaceted framework designed to address the complex challenges associated with repository-level code completion. Central to RepoHYPER is the {\em Repo-level Semantic Graph} (RSG), a novel semantic graph structure that encapsulates the vast context of code repositories. Furthermore, RepoHyper leverages Expand and Refine retrieval method, including a graph expansion and a link prediction algorithm applied to the RSG, enabling the effective retrieval and prioritization of relevant code snippets. Our evaluations show that \tool markedly outperforms existing techniques in repository-level code completion, showcasing enhanced accuracy across various datasets when compared to several strong baselines. Our implementation of RepoHYPER can be found at https://github.com/FSoft-AI4Code/RepoHyper.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

[FORGE 2025] Graph-based method for end-to-end code completion with context awareness on repository

7413Jupyter Notebook, PythonFeb 22, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{phan2024repohyper,
  title  = {RepoHyper: Search-Expand-Refine on Semantic Graphs for Repository-Level Code Completion},
  author = {Huy N. Phan and Hoang N. Phan and Tien N. Nguyen and Nghi D. Q. Bui},
  year   = {2024},
  eprint = {2403.06095},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.06095v4}
}

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/2403.06095.svg)](https://codeofpaper.com/paper/2403.06095)

Discussion