mlsanityData to 14 Oct 2026

Context-Augmented Code Generation Using Programming Knowledge Graphs

arXiv 2601.20810 ↗First posted 28 Jan 2026cs.SE cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) excel at code generation but struggle with complex problems. Retrieval-Augmented Generation (RAG) mitigates this issue by integrating external knowledge, yet retrieval models often miss relevant context, and generation models hallucinate with irrelevant data. We propose Programming Knowledge Graph (PKG) for semantic representation and fine-grained retrieval of code and text. Our approach enhances retrieval precision through tree pruning and mitigates hallucinations via a re-ranking mechanism that integrates non-RAG solutions. Structuring external data into finer-grained nodes improves retrieval granularity. Evaluations on HumanEval and MBPP show up to 20% pass@1 accuracy gains and a 34% improvement over baselines on MBPP. Our findings demonstrate that our proposed PKG approach along with re-ranker effectively address complex problems while maintaining minimal negative impact on solutions that are already correct without RAG. The replication package is published at https://github.com/iamshahd/ProgrammingKnowledgeGraph

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 38 of its 52 references that are in the map. First posted on arXiv 28 Jan 2026.

Builds on

38 of 52 references.

References · 38

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  4. 2021Program Synthesis with Large Language Modelscited by 3,637
  5. 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,212
  6. 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,141
  7. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  8. 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
  9. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  10. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  11. 2022When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memoriescited by 1,128
  12. 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 952
26 more
  1. 2023StarCoder: may the source be with you!cited by 799
  2. 2023In-Context Retrieval-Augmented Language Modelscited by 702
  3. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  4. 2023Active Retrieval Augmented Generationcited by 516
  5. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  6. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  7. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
  8. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
  9. 2024HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language Modelscited by 281
  10. 2022DocPrompting: Generating Code by Retrieving the Docscited by 153
  11. 2021Retrieval Augmented Code Generation and Summarizationcited by 149
  12. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 91
  13. 2024RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graphcited by 91
  14. 2024Reliable, Adaptable, and Attributable Language Models with Retrievalcited by 73
  15. 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 65
  16. 2025Enhancing repository-level software repair via repository-aware knowledge graphscited by 27
  17. 2025Provence: efficient and robust context pruning for retrieval-augmented generationcited by 25
  18. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 23
  19. 2024EVOR: Evolving Retrieval for Code Generationcited by 22
  20. 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
  21. 2025cAST: Enhancing Code Retrieval-Augmented Generation with Structural Chunking via Abstract Syntax Treecited by 17
  22. 2025Prometheus: Towards Long-Horizon Codebase Navigation for Repository-Level Problem Solvingcited by 13
  23. 2025Pragmatic Reasoning improves LLM Code Generationcited by 7
  24. 2025CoDocBench: A Dataset for Code-Documentation Alignment in Software Maintenancecited by 5
  25. 2025SemRAG: Semantic Knowledge-Augmented RAG for Improved Question-Answeringcited by 4
  26. 2025Iterative Self-Training for Code Generation via Reinforced Re-Rankingcited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
  2. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities
  3. 2026Effective and Efficient Context Retrieval via Partial Dependency Graph for Repository-Level Code Generation
  4. 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation
  5. 2026Reliable Graph-RAG for Codebases: AST-Derived Graphs vs LLM-Extracted Knowledge Graphs
  6. 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization
  7. 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
  8. 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval