Exploring Representation-Level Augmentation for Code Search
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 29 of its 47 references that are in the map. First posted on arXiv 21 Oct 2022.
Builds on
29 of 47 references.
References · 29
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
- 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,482
- 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,346
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,168
- 2020Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hyperspherecited by 1,393
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Modelscited by 1,225
- 2019EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Taskscited by 800
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
17 more
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2020DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representationscited by 249
- 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 220
- 2020CERT: Contrastive Self-supervised Learning for Language Understandingcited by 169
- 2019Augmenting Data with Mixup for Sentence Classification: An Empirical Studycited by 125
- 2020Contrastive Code Representation Learningcited by 76
- 2020Towards Domain-Agnostic Contrastive Learningcited by 75
- 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 74
- 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
- 2019When Deep Learning Met Code Searchcited by 45
- 2020Opportunities and Challenges in Code Search Toolscited by 22
- 2017Query Expansion Based on Crowd Knowledge for Code Searchcited by 18
- 2020Mixup-Transformer: Dynamic Data Augmentation for NLP Taskscited by 15
- 2021Multimodal Representation for Neural Code Searchcited by 11
- 2022Augmenting Document Representations for Dense Retrieval with Interpolation and Perturbationcited by 10
- 2021Constructing Contrastive samples via Summarization for Text Classification with limited annotationscited by 2
Built on by
Citing papers per year: 2023: 1; 2024: 4; 2025: 2; 2026: 1.
8 papers.
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2024Rewriting the Code: A Simple Method for Large Language Model Augmented Code Searchcited by 17
- 2023Rethinking Negative Pairs in Code Searchcited by 14
- 2024VulScribeR: Exploring RAG-based Vulnerability Augmentation with LLMscited by 7
- 2025GiFT: Gibbs Fine-Tuning for Code Generationcited by 3
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understandingcited by 2
- 2025A Study on Mixup-Inspired Augmentation Methods for Software Vulnerability Detectioncited by 0
- 2026XSearch: Explainable Code Search via Concept-to-Code Alignmentcited by 0
- 2026XSearch: Explainable Code Search via Concept-to-Code Alignment15 May 2026
- 2025A Study on Mixup-Inspired Augmentation Methods for Software Vulnerability Detection22 Apr 2025
- 2025GiFT: Gibbs Fine-Tuning for Code Generation17 Feb 2025
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024VulScribeR: Exploring RAG-based Vulnerability Augmentation with LLMs7 Aug 2024
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understanding24 Feb 2024
- 2024Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search9 Jan 2024
- 2023Rethinking Negative Pairs in Code Search12 Oct 2023