mlsanityData to 13 Oct 2026

CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation

arXiv 2405.02355 ↗First posted 3 May 2024cs.SE cs.AIcited by 4

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

Utilizing large language models to generate codes has shown promising meaning in software development revolution. Despite the intelligence shown by the large language models, their specificity in code generation can still be improved due to the syntactic gap and mismatched vocabulary existing between natural language and programming languages. In this paper, we propose CodeGRAG, a Graphical Retrieval Augmented Code Generation framework that bridges the gap between NL and PL to enhance the performance of LLMs. CodeGRAG builds the graphical view of code blocks based on the control flow and data flow of them to better interpret the programming domain knowledge, which can facilitate natural language based LLMs for better understanding of code syntax and serve as a bridge among different programming languages. To take the extracted structural knowledge into the foundation models, we propose 1) a hard meta-graph prompt template to transform the challenging syntax graph into informative graphical view for tuning-free models and 2) a soft prompting technique that injects the domain knowledge of programming languages into model parameters via finetuning the models with the soft signals encoded by GNN expert model. Specifically, two constraints are designed to improve the alignment and structure expressiveness, contributing to the informativeness of the single-token-sized external <GraphEmb> for enhanced code generation. CodeGRAG significantly improves the code generation ability of LLMs and can even offer performance gain for cross-lingual code generation. Implementation is available at https://anonymous.4open.science/r/Code-5970/ .

Key facts. Cited by 4 papers in the map (data through 13 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 26 of its 40 references that are in the map. First posted on arXiv 3 May 2024.

Builds on

26 of 40 references.

Closest ancestors · 2

Same direction, newest first

  1. 2024EVOR: Evolving Retrieval for Code Generation19 Feb
  2. 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar

Other references · 24

  1. 2023GPT-4 Technical Reportcited by 18,278
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,072
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,979
  4. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,317
  5. 2022Robust Speech Recognition via Large-Scale Weak Supervisioncited by 4,004
  6. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,379
  7. 2023Code Llama: Open Foundation Models for Codecited by 2,130
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,304
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 905
  10. 2021Measuring Coding Challenge Competence With APPScited by 891
  11. 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
  12. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
12 more
  1. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 360
  2. 2018code2vec: Learning Distributed Representations of Codecited by 250
  3. 2017Learning to Represent Programs with Graphscited by 220
  4. 2023The BigScience ROOTS Corpus: A 1.6TB Composite Multilingual Datasetcited by 148
  5. 2023PanGu-Coder2: Boosting Large Language Models for Code with Ranking Feedbackcited by 69
  6. 2018Neural Code Comprehension: A Learnable Representation of Code Semanticscited by 59
  7. 2019When Deep Learning Met Code Searchcited by 46
  8. 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 41
  9. 2018Automated software vulnerability detection with machine learningcited by 34
  10. 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
  11. 2021Multimodal Representation for Neural Code Searchcited by 11
  12. 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detectioncited by 6

Built on by

Cited by year (2026 to 13 Oct)

Citing papers per year: 2024: 1; 2025: 2; 2026: 1.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Context-Augmented Code Generation Using Programming Knowledge Graphs
  2. 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
  3. 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
  4. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities
  5. 2026CodeMMR: Bridging Natural Language, Code, and Image for Unified Retrieval
  6. 2025Across Programming Language Silos: A Study on Cross-Lingual Retrieval-augmented Code Generation
  7. 2025GraphCodeAgent: Dual Graph-Guided LLM Agent for Retrieval-Augmented Repo-Level Code Generation
  8. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?