Generation-Augmented Query Expansion For Code Retrieval
Not on the map. Why?
Abstract (arXiv)
Pre-trained language models have achieved promising success in code retrieval tasks, where a natural language documentation query is given to find the most relevant existing code snippet. However, existing models focus only on optimizing the documentation code pairs by embedding them into latent space, without the association of external knowledge. In this paper, we propose a generation-augmented query expansion framework. Inspired by the human retrieval process - sketching an answer before searching, in this work, we utilize the powerful code generation model to benefit the code retrieval task. Specifically, we demonstrate that rather than merely retrieving the target code snippet according to the documentation query, it would be helpful to augment the documentation query with its generation counterpart - generated code snippets from the code generation model. To the best of our knowledge, this is the first attempt that leverages the code generation model to enhance the code retrieval task. We achieve new state-of-the-art results on the CodeSearchNet benchmark and surpass the baselines significantly.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 18 of its 26 references that are in the map. First posted on arXiv 20 Dec 2022.
Builds on
18 of 26 references.
References · 18
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
6 more
- 2020Generation-Augmented Retrieval for Open-domain Question Answeringcited by 186
- 2021Retrieval Augmented Code Generation and Summarizationcited by 149
- 2021Scaling Deep Contrastive Learning Batch Size under Memory Limited Setupcited by 127
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 119
- 2018A Retrieve-and-Edit Framework for Predicting Structured Outputscited by 73
- 2018Retrieval-Based Neural Code Generationcited by 41
Built on by
Citing papers per year: 2023: 4; 2024: 1; 2025: 0; 2026: 1.
6 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2023Revisiting Recommendation Loss Functions through Contrastive Learning (Technical Report)cited by 5
- 2023(Debiased) Contrastive Learning Loss for Recommendation (Technical Report)cited by 0
- 2026Accurate, Efficient, and Explainable Deep Learning Approaches for Environmental Science Problemscited by 0
- 2026Accurate, Efficient, and Explainable Deep Learning Approaches for Environmental Science Problems19 May 2026
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2023Revisiting Recommendation Loss Functions through Contrastive Learning (Technical Report)13 Dec 2023
- 2023(Debiased) Contrastive Learning Loss for Recommendation (Technical Report)13 Dec 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generation22 Mar 2023