SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion
Fuente:
arXiv
Guardado en:
| Autores principales: | , , , , , , , , , |
|---|---|
| Formato: | Preprint |
| Publicado: |
2025
|
| Materias: | |
| Acceso en línea: | |
| Etiquetas: |
Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
|
| _version_ | 1866914089242984448 |
|---|---|
| author | Chen, Xiaohan Pan, Zhongying Feng, Quan Tian, Yu Yang, Shuqun Wang, Mengru Gong, Lina Geng, Yuxia Li, Piji Chen, Xiang |
| author_facet | Chen, Xiaohan Pan, Zhongying Feng, Quan Tian, Yu Yang, Shuqun Wang, Mengru Gong, Lina Geng, Yuxia Li, Piji Chen, Xiang |
| contents | 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. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2508_10068 |
| institution | arXiv |
| publishDate | 2025 |
| record_format | arxiv |
| spellingShingle | SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion Chen, Xiaohan Pan, Zhongying Feng, Quan Tian, Yu Yang, Shuqun Wang, Mengru Gong, Lina Geng, Yuxia Li, Piji Chen, Xiang Software Engineering Computation and Language Information Retrieval Programming Languages 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. |
| title | SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion |
| topic | Software Engineering Computation and Language Information Retrieval Programming Languages |
| url | https://arxiv.org/abs/2508.10068 |