Knowledge Graph Based Repository-Level Code Generation
Not on the map. Why?
Abstract (arXiv)
Recent advancements in Large Language Models (LLMs) have transformed code generation from natural language queries. However, despite their extensive knowledge and ability to produce high-quality code, LLMs often struggle with contextual accuracy, particularly in evolving codebases. Current code search and retrieval methods frequently lack robustness in both the quality and contextual relevance of retrieved results, leading to suboptimal code generation. This paper introduces a novel knowledge graph-based approach to improve code search and retrieval leading to better quality of code generation in the context of repository-level tasks. The proposed approach represents code repositories as graphs, capturing structural and relational information for enhanced context-aware code generation. Our framework employs a hybrid approach for code retrieval to improve contextual relevance, track inter-file modular dependencies, generate more robust code and ensure consistency with the existing codebase. We benchmark the proposed approach on the Evolutionary Code Benchmark (EvoCodeBench) dataset, a repository-level code generation benchmark, and demonstrate that our method significantly outperforms the baseline approach. These findings suggest that knowledge graph based code generation could advance robust, context-sensitive coding assistance tools.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 23 of its 27 references that are in the map. First posted on arXiv 20 May 2025.
Builds on
23 of 27 references.
References · 23
- 2023GPT-4 Technical Reportcited by 18,396
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2022Scaling Instruction-Finetuned Language Modelscited by 3,024
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,463
- 2023The Rise and Potential of Large Language Model Based Agents: A Surveycited by 1,439
- 2020Leveraging Passage Retrieval with Generative Models for Open Domain Question Answeringcited by 1,210
- 2024Large Language Model based Multi-Agents: A Survey of Progress and Challengescited by 769
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
11 more
- 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 91
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 72
- 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 65
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 53
- 2024AgileCoder: Dynamic Collaborative Agents for Software Development based on Agile Methodologycited by 46
- 2023RepoFusion: Training Code Models to Understand Your Repositorycited by 40
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
- 2022Code Search: A Survey of Techniques for Finding Codecited by 18
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generationcited by 16
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 15
- 2024CATCODER: Repository-Level Code Generation with Relevant Code and Type Contextcited by 8
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 23
- 2025On the Use of Agentic Coding Manifests: An Empirical Study of Claude Codecited by 14
- 2026Not All RAGs Are Created Equal: A Component-Wise Empirical Study for Software Engineering Taskscited by 1
- 2026Reversa: A Reverse Documentation Engineering Framework for Converting Legacy Software into Operational Specifications for AI Agentscited by 1
- 2026Reversa: A Reverse Documentation Engineering Framework for Converting Legacy Software into Operational Specifications for AI Agents18 May 2026
- 2026Not All RAGs Are Created Equal: A Component-Wise Empirical Study for Software Engineering Tasks14 May 2026
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025On the Use of Agentic Coding Manifests: An Empirical Study of Claude Code18 Sep 2025