Skip to main navigation Skip to search Skip to main content

Code Search Is All You Need? Improving Code Suggestions with Code Search

  • Junkai Chen
  • , Xing Hu*
  • , Zhenhao Li
  • , Cuiyun Gao
  • , Xin Xia
  • , David Lo
  • *Corresponding author for this work
  • Zhejiang University
  • Concordia University
  • Harbin Institute of Technology Shenzhen
  • Singapore Management University

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Modern integrated development environments (IDEs) provide various automated code suggestion techniques (e.g., code completion and code generation) to help developers improve their efficiency. Such techniques may retrieve similar code snippets from the code base or leverage deep learning models to provide code suggestions. However, how to effectively enhance the code suggestions using code retrieval has not been systematically investigated. In this paper, we study and explore a retrieval-augmented framework for code suggestions. Specifically, our framework leverages different retrieval approaches and search strategies to search similar code snippets. Then the retrieved code is used to further enhance the performance of language models on code suggestions. We conduct experiments by integrating different language models into our framework and compare the results with their original models. We find that our framework noticeably improves the performance of both code completion and code generation by up to 53.8% and 130.8% in terms of BLEU-4, respectively. Our study highlights that integrating the retrieval process into code suggestions can improve the performance of code suggestions by a large margin.

Original languageEnglish
Title of host publicationProceedings - 2024 ACM/IEEE 44th International Conference on Software Engineering, ICSE 2024
PublisherIEEE Computer Society
Pages880-892
Number of pages13
ISBN (Electronic)9798400702174
DOIs
StatePublished - 20 May 2024
Externally publishedYes
Event44th ACM/IEEE International Conference on Software Engineering, ICSE 2024 - Lisbon, Portugal
Duration: 14 Apr 202420 Apr 2024

Publication series

NameProceedings - International Conference on Software Engineering
ISSN (Print)0270-5257

Conference

Conference44th ACM/IEEE International Conference on Software Engineering, ICSE 2024
Country/TerritoryPortugal
CityLisbon
Period14/04/2420/04/24

Keywords

  • Code Search
  • Code Suggestion
  • Language Model

Fingerprint

Dive into the research topics of 'Code Search Is All You Need? Improving Code Suggestions with Code Search'. Together they form a unique fingerprint.

Cite this