arrow
Return

On Representation Learning-based Methods for Effective, Efficient, and Scalable Code Retrieval

delete2024-10-01
delete1
PRE
AI
C
Celso França *
R
Rennan C. Lima
C
Cláudio Moisés Valiense de Andrade
W
Washington Cunha
P
Pedro O. S. Vaz de Melo
B
Berthier Ribeiro‐Neto
L
Leonardo Rocha
R
Rodrygo L. T. Santos
A
Adriana Silvina Pagano
M
Marcos André Gonçalves
DOI:10.1016/j.neucom.2024.128172delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code retrieval consists of finding relevant code snippets regarding a programmer's query - an increasingly important task due to software ubiquity. Although significant progress has been made, there is still a need for refinement and improvement in current code retrieval solutions. Besides effective, , we argue that solutions for the code retrieval task should be efficient and scalable to ever-increasing large code repositories. This paper introduces xCoFormer, , the first representation learning-based model for the code retrieval task in the literature, which meets all these requirements. Our contributions include: (i) an interactive tag-training method that efficiently places a query closer to its relevant codes in the embedding space and (ii) use of a specialized loss function (N N-pair) better suited to the code retrieval task. To evaluate our proposal, we conducted experiments with different versions of xCoFormer against several state-of-the-art deep learning models in datasets with different properties. In our experiments, xCoFormer produced the best cost-effectiveness tradeoff - it is as effective as our closest competitor while being thousands of times faster at search time. xCoFormer's attention mechanism also (partially) meets the desirable requirement of explainability by exposing the reasoning of the model's predictions. Finally, when used as a proxy method, fine-tuned with domain-specific code language models, such as Unixcoder and CodeBERT, our proposal achieves gains of more than 33% in effectiveness when compared to the use of general purpose language models such as BERT and RoBERTa.
Keywords:
Code retrieval
Representation learning
Language models

Journal

Neurocomputing cover
Neurocomputing
IF:
6.5
Papers:
2.5W
Citations:
6.5W

Organization

U
Universidade Federal de Minas Gerais
Scholars:
2.5W
Papers: 1.5W
Citations: 1.4W
Cited Papers

Cited Papers

A review on the attention mechanism of deep learning
err2021-09-01
err1.6K
PREAI
errNiu, Zhaoyang; Zhong, Guoqiang; Yu, Hui
errShare
errSave
errShare
errSave
Lifestyle Modification in the Pharmacologic Treatment of Obesity: A Pilot Investigation of a Potential Primary Care Approach
err2012-09-06
err0
errOAAI
errThomas A. Wadden; Robert I. Berkowitz; Renee A. Vogt; Suzanne N. Steen; Albert J. Stunkard; Gary D. Foster
errShare
errSave
Dialogue-adaptive language model pre-training from quality estimation
err2023-01-01
err9
errOAAI
errLi, Junlong; Zhang, Zhuosheng; Zhao, Hai
errShare
errSave
Neural Vector Spaces for Unsupervised Information Retrieval
err2018-06-26
err49
errOAAI
errVan Gysel, Christophe; De Rijke, Maarten; Kanoulas, Evangelos
errShare
errSave
Examining and mitigating gender bias in text emotion detection task
err2022-07-01
err2
PREAI
errOdbal; Zhang, Guanhong; Ananiadou, Sophia
errShare
errSave
On the class separability of contextual embeddings representations-or The classifier does not matter when the (text) representation is so good!
err2023-07-01
err7
PREAI
errde Andrade, Claudio M. V.; Belem, Fabiano M.; Cunha, Washington; Franca, Celso; Viegas, Felipe; Rocha, Leonardo; Goncalves, Marcos Andre
errShare
errSave
On the cost-effectiveness of neural and non-neural approaches and representations for text classification: A comprehensive comparative study
err2021-05-01
err40
PREAI
errCunha, Washington; Mangaravite, Vitor; Gomes, Christian; Canuto, Sergio; Resende, Elaine; Nascimento, Cecilia; Viegas, Felipe; Franca, Celso; Martins, Wellington Santos; Almeida, Jussara M.; Rosa, Thierson; Rocha, Leonardo; Goncalves, Marcos Andre
errShare
errSave
errShare
errSave
researcher View more