Pith

open record

sign in

arxiv: 2210.12285 · v1 · pith:MA7ARWWF · submitted 2022-10-21 · cs.SE · cs.IR· cs.LG

Exploring Representation-Level Augmentation for Code Search

Reviewed by Pith T0 review T1 audit T2 compute T3 formal T4 kernel pith:MA7ARWWFrecord.jsonopen to challenge →

classification cs.SE cs.IRcs.LG
keywords codeaugmentationmethodssearchadditionaldataproposedrepresentation-level
0
0 comments X
read the original abstract

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. Our source code is available at https://github.com/Alex-HaochenLi/RACS.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. XSearch: Explainable Code Search via Concept-to-Code Alignment

    cs.SE 2026-05 unverdicted novelty 6.0

    XSearch achieves explainable code search by breaking queries into functional concepts and matching them directly to code statements, delivering large gains on out-of-distribution benchmarks.

  2. XSearch: Explainable Code Search via Concept-to-Code Alignment

    cs.SE 2026-05 unverdicted novelty 6.0

    XSearch achieves 15x gains on out-of-distribution code search benchmarks by replacing global embedding similarity with explicit concept-to-statement alignment.