Skip to content

Commit 4160bb7

Browse files
Alex-HaochenLimallamanis
authored andcommitted
Create li2022exploring.markdown
1 parent 3e5f875 commit 4160bb7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: publication
3+
title: Exploring Representation-Level Augmentation for Code Search
4+
authors: Haochen Li, Chunyan Miao, Cyril Leung, Yanxian Huang, Yuan Huang, Hongyu Zhang, Yanlin Wang
5+
conference: EMNLP
6+
year: 2022
7+
additional_links:
8+
- {name: "ArXiV", url: "https://arxiv.org/abs/2210.12285"}
9+
- {name: "code", url: "https://github.com/Alex-HaochenLi/RACS"}
10+
tags: ["search", "Transformer"]
11+
---
12+
Code search, which aims at retrieving the most relevant code fragment for a given natural language query, is a common activity in software development practice. Recently, contrastive learning is widely used in code search research, where many data augmentation approaches for source code (e.g., semantic-preserving program transformation) are proposed to learn better representations. However, these augmentations are at the raw-data level, which requires additional code analysis in the preprocessing stage and additional training costs in the training stage. In this paper, we explore augmentation methods that augment data (both code and query) at representation level which does not require additional data processing and training, and based on this we propose a general format of representation-level augmentation that unifies existing methods. Then, we propose three new augmentation methods (linear extrapolation, binary interpolation, and Gaussian scaling) based on the general format. Furthermore, we theoretically analyze the advantages of the proposed augmentation methods over traditional contrastive learning methods on code search. We experimentally evaluate the proposed representation-level augmentation methods with state-of-the-art code search models on a large-scale public dataset consisting of six programming languages. The experimental results show that our approach can consistently boost the performance of the studied code search models.

0 commit comments

Comments
 (0)