Retrieval-Based Neural Code Generation
Not on the map. Why?
Abstract (arXiv)
In models to generate program source code from natural language, representing this code in a tree structure has been a common approach. However, existing methods often fail to generate complex code correctly due to a lack of ability to memorize large and complex structures. We introduce ReCode, a method based on subtree retrieval that makes it possible to explicitly reference existing code examples within a neural code generation model. First, we retrieve sentences that are similar to input sentences using a dynamic-programming-based sentence similarity scoring method. Next, we extract n-grams of action sequences that build the associated abstract syntax tree. Finally, we increase the probability of actions that cause the retrieved n-gram action subtree to be in the predicted code. We show that our approach improves the performance on two code generation tasks by up to +2.6 BLEU.
Key facts. Cited by 41 papers in the map (data through 7 Oct 2026). First posted on arXiv 29 Aug 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 11; 2022: 12; 2023: 6; 2024: 6; 2025: 4; 2026: 2.
41 papers.
Sort:
By area:
- 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Modelscited by 414
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2022RARR: Researching and Revising What Language Models Say, Using Language Modelscited by 286
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2021Retrieval Augmented Code Generation and Summarizationcited by 148
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2023Retrieving Multimodal Information for Augmented Generation: A Surveycited by 84
- 2021Improving Named Entity Recognition by External Context Retrieving and Cooperative Learningcited by 76
- 2024Reliable, Adaptable, and Attributable Language Models with Retrievalcited by 73
- 2022Neuro-Symbolic Language Modeling with Automaton-augmented Retrievalcited by 60
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2022Retrieval-based Controllable Molecule Generationcited by 44
29 more
- 2021Controllable Semantic Parsing via Retrieval Augmentationcited by 35
- 2024Automatic Programming: Large Language Models and Beyondcited by 35
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunitiescited by 17
- 2021Shellcode_IA32: A Dataset for Automatic Shellcode Generationcited by 16
- 2022Incorporating Domain Knowledge through Task Augmentation for Front-End JavaScript Code Generationcited by 11
- 2021Exploring Dynamic Selection of Branch Expansion Orders for Code Generationcited by 10
- 2023De-fine: Decomposing and Refining Visual Programs with Auto-Feedbackcited by 10
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completioncited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2021Reading StackOverflow Encourages Cheating: Adding Question Text Improves Extractive Code Generationcited by 8
- 2022T5QL: Taming language models for SQL generationcited by 8
- 2025A Survey on Retrieval And Structuring Augmented Generation with Large Language Modelscited by 8
- 2024mathbbUSCD: Improving Code Generation of LLMs by Uncertainty-Aware Selective Contrastive Decodingcited by 6
- 2021A Neural Question Answering System for Basic Questions about Subroutinescited by 5
- 2021Embedding API Dependency Graph for Neural Code Generationcited by 5
- 2022Generation-Augmented Query Expansion For Code Retrievalcited by 5
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Modelscited by 5
- 2021Lyra: A Benchmark for Turducken-Style Code Generationcited by 4
- 2021ComSum: Commit Messages Summarization and Meaning Preservationcited by 3
- 2022Transformer with Tree-order Encoding for Neural Program Generationcited by 3
- 2021End to End Software Engineering Researchcited by 2
- 2022Can NMT Understand Me? Towards Perturbation-based Evaluation of NMT Models for Code Generationcited by 2
- 2025CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Modelscited by 2
- 2023Dynamic Retrieval-Augmented Generationcited by 1
- 2026SynthFix: Adaptive Neuro-Symbolic Code Vulnerability Repaircited by 1
- 2022Can We Generate Shellcodes via Natural Language? An Empirical Studycited by 0
- 2022Antecedent Predictions Are More Important Than You Think: An Effective Method for Tree-Based Code Generationcited by 0
- 2026RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models28 Jul 2026
- 2026SynthFix: Adaptive Neuro-Symbolic Code Vulnerability Repair19 Apr 2026
- 2025A Survey on Retrieval And Structuring Augmented Generation with Large Language Models12 Sep 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2025CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Models29 Mar 2025
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan 2025
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completion23 Sep 2024
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024mathbbUSCD: Improving Code Generation of LLMs by Uncertainty-Aware Selective Contrastive Decoding9 Sep 2024
- 2024Automatic Programming: Large Language Models and Beyond3 May 2024
- 2024Reliable, Adaptable, and Attributable Language Models with Retrieval5 Mar 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
29 more
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Dynamic Retrieval-Augmented Generation14 Dec 2023
- 2023De-fine: Decomposing and Refining Visual Programs with Auto-Feedback21 Nov 2023
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Models21 Aug 2023
- 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Models27 Jun 2023
- 2023Retrieving Multimodal Information for Augmented Generation: A Survey20 Mar 2023
- 2022Generation-Augmented Query Expansion For Code Retrieval20 Dec 2022
- 2022RARR: Researching and Revising What Language Models Say, Using Language Models17 Oct 2022
- 2022T5QL: Taming language models for SQL generation21 Sep 2022
- 2022Retrieval-based Controllable Molecule Generation23 Aug 2022
- 2022Incorporating Domain Knowledge through Task Augmentation for Front-End JavaScript Code Generation22 Aug 2022
- 2022Antecedent Predictions Are More Important Than You Think: An Effective Method for Tree-Based Code Generation22 Aug 2022
- 2022DocPrompting: Generating Code by Retrieving the Docs13 Jul 2022
- 2022Transformer with Tree-order Encoding for Neural Program Generation30 May 2022
- 2022Can NMT Understand Me? Towards Perturbation-based Evaluation of NMT Models for Code Generation29 Mar 2022
- 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar 2022
- 2022Can We Generate Shellcodes via Natural Language? An Empirical Study8 Feb 2022
- 2022Neuro-Symbolic Language Modeling with Automaton-augmented Retrieval28 Jan 2022
- 2021End to End Software Engineering Research22 Dec 2021
- 2021Controllable Semantic Parsing via Retrieval Augmentation16 Oct 2021
- 2021Lyra: A Benchmark for Turducken-Style Code Generation27 Aug 2021
- 2021Retrieval Augmented Code Generation and Summarization26 Aug 2021
- 2021ComSum: Commit Messages Summarization and Meaning Preservation23 Aug 2021
- 2021Reading StackOverflow Encourages Cheating: Adding Question Text Improves Extractive Code Generation8 Jun 2021
- 2021Exploring Dynamic Selection of Branch Expansion Orders for Code Generation1 Jun 2021
- 2021Improving Named Entity Recognition by External Context Retrieving and Cooperative Learning8 May 2021
- 2021Shellcode_IA32: A Dataset for Automatic Shellcode Generation27 Apr 2021
- 2021Embedding API Dependency Graph for Neural Code Generation29 Mar 2021
- 2021A Neural Question Answering System for Basic Questions about Subroutines11 Jan 2021
- 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Modelscited by 414
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Surveycited by 352
- 2021Retrieval Augmented Code Generation and Summarizationcited by 148
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2024Reliable, Adaptable, and Attributable Language Models with Retrievalcited by 73
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunitiescited by 17
- 2023Dynamic Retrieval-Augmented Generationcited by 1
- 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities23 Jan 2025
- 2024Reliable, Adaptable, and Attributable Language Models with Retrieval5 Mar 2024
- 2024Retrieval-Augmented Generation for AI-Generated Content: A Survey29 Feb 2024
- 2023Dynamic Retrieval-Augmented Generation14 Dec 2023
- 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Models27 Jun 2023
- 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar 2022
- 2021Retrieval Augmented Code Generation and Summarization26 Aug 2021
- 2022RARR: Researching and Revising What Language Models Say, Using Language Modelscited by 286
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2023Retrieving Multimodal Information for Augmented Generation: A Surveycited by 84
- 2021Improving Named Entity Recognition by External Context Retrieving and Cooperative Learningcited by 76
- 2022Neuro-Symbolic Language Modeling with Automaton-augmented Retrievalcited by 60
- 2022Retrieval-based Controllable Molecule Generationcited by 44
- 2021Controllable Semantic Parsing via Retrieval Augmentationcited by 35
- 2024Automatic Programming: Large Language Models and Beyondcited by 35
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2021Shellcode_IA32: A Dataset for Automatic Shellcode Generationcited by 16
- 2022Incorporating Domain Knowledge through Task Augmentation for Front-End JavaScript Code Generationcited by 11
12 most cited of 32 All 32 (JSON)
- 2026SynthFix: Adaptive Neuro-Symbolic Code Vulnerability Repair19 Apr 2026
- 2025A Survey on Retrieval And Structuring Augmented Generation with Large Language Models12 Sep 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2025CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Models29 Mar 2025
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completion23 Sep 2024
- 2024mathbbUSCD: Improving Code Generation of LLMs by Uncertainty-Aware Selective Contrastive Decoding9 Sep 2024
- 2024Automatic Programming: Large Language Models and Beyond3 May 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023De-fine: Decomposing and Refining Visual Programs with Auto-Feedback21 Nov 2023
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Models21 Aug 2023
- 2023Retrieving Multimodal Information for Augmented Generation: A Survey20 Mar 2023
- 2022Generation-Augmented Query Expansion For Code Retrieval20 Dec 2022
12 newest of 32 All 32 (JSON)