RepoScope: Leveraging Call Chain-Aware Multi-View Context for Repository-Level Code Generation
Yang Liu, Li Zhang, Fang Liu, Zhuohang Wang, Donglin Wei, Zhishuo Yang, Kechi Zhang, Jia Li, Lin Shi

TL;DR
RepoScope introduces a novel approach for repository-level code generation by leveraging call chain-aware multi-view context and structural semantics, significantly improving the relevance and accuracy of generated code without additional training.
Contribution
It proposes a call chain prediction method and a structure-preserving serialization algorithm, utilizing static analysis to enhance context retrieval and prompt construction for code generation.
Findings
Achieves up to 36.35% relative improvement in pass@1 scores on benchmarks.
Outperforms state-of-the-art methods in repository-level code generation.
Demonstrates effectiveness across multiple tasks and integration with existing approaches.
Abstract
Repository-level code generation aims to generate code within the context of a specified repository. Existing approaches typically employ retrieval-augmented generation (RAG) techniques to provide LLMs with relevant contextual information extracted from the repository. However, these approaches often struggle with effectively identifying truly relevant contexts that capture the rich semantics of the repository, and their contextual perspectives remains narrow. Moreover, most approaches fail to account for the structural relationships in the retrieved code during prompt construction, hindering the LLM's ability to accurately interpret the context. To address these issues, we propose RepoScope, which leverages call chain-aware multi-view context for repository-level code generation. RepoScope constructs a Repository Structural Semantic Graph (RSSG) and retrieves a comprehensive four-view…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Software Engineering Techniques and Practices
