mlsanityData to 14 Oct 2026

Generation-Augmented Query Expansion For Code Retrieval

arXiv 2212.10692 ↗First posted 20 Dec 2022cs.SE cs.AI cs.CLcited by 6

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
  7. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  9. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  10. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  11. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  12. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
6 more
  1. 2020Generation-Augmented Retrieval for Open-domain Question Answeringcited by 186
  2. 2021Retrieval Augmented Code Generation and Summarizationcited by 149
  3. 2021Scaling Deep Contrastive Learning Batch Size under Memory Limited Setupcited by 127
  4. 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 119
  5. 2018A Retrieve-and-Edit Framework for Predicting Structured Outputscited by 73
  6. 2018Retrieval-Based Neural Code Generationcited by 41

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 4; 2024: 1; 2025: 0; 2026: 1.

6 papers.