GRACE: Graph-Guided Repository-Aware Code Completion through Hierarchical Code Fusion
Not on the map. Why?
Abstract (arXiv)
LLMs excel in localized code completion but struggle with repository-level tasks due to limited context windows and complex semantic and structural dependencies across codebases. While Retrieval-Augmented Generation (RAG) mitigates context scarcity by retrieving relevant code snippets, current approaches face significant limitations. They overly rely on textual similarity for retrieval, neglecting structural relationships such as call chains and inheritance hierarchies, and lose critical structural information by naively concatenating retrieved snippets into text sequences for LLM input. To address these shortcomings, GRACE constructs a multi-level, multi-semantic code graph that unifies file structures, abstract syntax trees, function call graphs, class hierarchies, and data flow graphs to capture both static and dynamic code semantics. For retrieval, GRACE employs a Hybrid Graph Retriever that integrates graph neural network-based structural similarity with textual retrieval, refined by a graph attention network-based re-ranker to prioritize topologically relevant subgraphs. To enhance context, GRACE introduces a structural fusion mechanism that merges retrieved subgraphs with the local code context and preserves essential dependencies like function calls and inheritance. Extensive experiments on public repository-level benchmarks demonstrate that GRACE significantly outperforms state-of-the-art methods across all metrics. Using DeepSeek-V3 as the backbone LLM, GRACE surpasses the strongest graph-based RAG baselines by 8.19% EM and 7.51% ES points on every dataset. The code is available at https://anonymous.4open.science/r/grace_icse-C3D5.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). First posted on arXiv 7 Sep 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 23
- 2026ReCUBE: Evaluating Repository-Level Context Utilization in Code Generationcited by 1
- 2026The Thousand-Graph Hypothesis: A Testable Hypothesis of Task-Conditioned Relation Materialization in Repository-Level Code Reasoningcited by 0
- 2026FeatLens: Feature-Guided Dynamic Code Graph Construction and Retrieval for Repository-Level Code Generationcited by 0
- 2026FeatLens: Feature-Guided Dynamic Code Graph Construction and Retrieval for Repository-Level Code Generation22 Sep 2026
- 2026The Thousand-Graph Hypothesis: A Testable Hypothesis of Task-Conditioned Relation Materialization in Repository-Level Code Reasoning27 Aug 2026
- 2026ReCUBE: Evaluating Repository-Level Context Utilization in Code Generation26 Mar 2026
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
- 2025SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion
- 2026Effective and Efficient Context Retrieval via Partial Dependency Graph for Repository-Level Code Generation
- 2025Completion by Comprehension: Guiding Code Generation with Multi-Granularity Understanding
- 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
- 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
- 2026Context-Augmented Code Generation Using Programming Knowledge Graphs
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion