Back to Search Start Over

I2R: Intra and inter-modal representation learning for code search.

Authors :
Zhang, Xu
Xiang, Yanzheng
Liu, Zejie
Hu, Xiaoyu
Zhou, Deyu
Source :
Intelligent Data Analysis. 2024, Vol. 28 Issue 3, p807-823. 17p.
Publication Year :
2024

Abstract

Code search, which locates code snippets in large code repositories based on natural language queries entered by developers, has become increasingly popular in the software development process. It has the potential to improve the efficiency of software developers. Recent studies have demonstrated the effectiveness of using deep learning techniques to represent queries and codes accurately for code search. In specific, pre-trained models of programming languages have recently achieved significant progress in code searching. However, we argue that aligning programming and natural languages are crucial as there are two different modalities. Existing pre-train models based approaches for code search do not effectively consider implicit alignments of representations across modalities (inter-modal representation). Moreover, the existing methods do not take into account the consistency constraint of intra-modal representations, making the model ineffective. As a result, we propose a novel code search method that optimizes both intra-modal and inter-modal representation learning. The alignment of the representation between the two modalities is achieved by introducing contrastive learning. Furthermore, the consistency of intra-modal feature representation is constrained by KL-divergence. Our experimental results confirm the model's effectiveness on seven different test datasets. This paper proposes a code search method that significantly improves existing methods. Our source code is publicly available on GitHub.1 [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
1088467X
Volume :
28
Issue :
3
Database :
Academic Search Index
Journal :
Intelligent Data Analysis
Publication Type :
Academic Journal
Accession number :
177634952
Full Text :
https://doi.org/10.3233/IDA-230082