SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion

Xiaohan Chen, Zhongying Pan, Quan Feng, Yu Tian, Shuqun Yang +5 more
8/13/2025
cs.SEcs.CLcs.IR

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Despite Retrieval-Augmented Generation improving code completion, traditional retrieval methods struggle with information redundancy and a lack of diversity within limited context windows. To solve this, we propose a resource-optimized retrieval augmentation method, SaraCoder. It maximizes information diversity and representativeness in a limited context window, significantly boosting the accuracy and reliability of repository-level code completion. Its core Hierarchical Feature Optimization module systematically refines candidates by distilling deep semantic relationships, pruning exact duplicates, assessing structural similarity with a novel graph-based metric that weighs edits by their topological importance, and reranking results to maximize both relevance and diversity. Furthermore, an External-Aware Identifier Disambiguator module accurately resolves cross-file symbol ambiguity via dependency analysis. Extensive experiments on the challenging CrossCodeEval and RepoEval-Updated benchmarks demonstrate that SaraCoder outperforms existing baselines across multiple programming languages and models. Our work proves that systematically refining retrieval results across multiple dimensions provides a new paradigm for building more accurate and resource-optimized repository-level code completion systems.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2025saracoder,
  title  = {SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion},
  author = {Xiaohan Chen and Zhongying Pan and Quan Feng and Yu Tian and Shuqun Yang and Mengru Wang and Lina Gong and Yuxia Geng and Piji Li and Xiang Chen},
  year   = {2025},
  eprint = {2508.10068},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.10068v2}
}

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

Discussion