RAPID: Zero-Shot Domain Adaptation for Code Search with Pre-Trained Models

计算机科学 域适应 零(语言学) 适应(眼睛) 领域(数学分析) 编码(集合论) 人工智能 理论计算机科学 程序设计语言 算法 机器学习 数学 心理学 神经科学 集合(抽象数据类型) 哲学 数学分析 分类器(UML) 语言学
作者
Guodong Fan,Shizhan Chen,Cuiyun Gao,Jianmao Xiao,Tao Zhang,Zhiyong Feng
出处
期刊:ACM Transactions on Software Engineering and Methodology [Association for Computing Machinery]
卷期号:33 (5): 1-35
标识
DOI:10.1145/3641542
摘要

Code search, which refers to the process of identifying the most relevant code snippets for a given natural language query, plays a crucial role in software maintenance. However, current approaches heavily rely on labeled data for training, which results in performance decreases when confronted with cross-domain scenarios including domain- or project-specific situations. This decline can be attributed to their limited ability to effectively capture the semantics associated with such scenarios. To tackle the aforementioned problem, we propose a ze R o-shot dom A in ada P tion with pre-tra I ned mo D els framework for code search named RAPID. The framework first generates synthetic data by pseudo labeling, then trains the CodeBERT with sampled synthetic data. To avoid the influence of noisy synthetic data and enhance the model performance, we propose a mixture sampling strategy to obtain hard negative samples during training. Specifically, the mixture sampling strategy considers both relevancy and diversity to select the data that are hard to be distinguished by the models. To validate the effectiveness of our approach in zero-shot settings, we conduct extensive experiments and find that RAPID outperforms the CoCoSoDa and UniXcoder model by an average of 15.7% and 10%, respectively, as measured by the MRR metric. When trained on full data, our approach results in an average improvement of 7.5% under the MRR metric using CodeBERT. We observe that as the model’s performance in zero-shot tasks improves, the impact of hard negatives diminishes. Our observation also indicates that fine-tuning CodeT5 for generating pseudo labels can enhance the performance of the code search model, and using only 100-shot samples can yield comparable results to the supervised baseline. Furthermore, we evaluate the effectiveness of RAPID in real-world code search tasks in three GitHub projects through both human and automated assessments. Our findings reveal RAPID exhibits superior performance, e.g., an average improvement of 18% under the MRR metric over the top-performing model.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
yindi1991完成签到 ,获得积分10
3秒前
科研猫完成签到,获得积分10
5秒前
了U完成签到 ,获得积分10
6秒前
弄香完成签到,获得积分10
11秒前
juejue333完成签到,获得积分10
13秒前
周萌完成签到 ,获得积分10
14秒前
17秒前
GSQ完成签到,获得积分10
19秒前
aeolianbells完成签到 ,获得积分10
19秒前
乐观的星月完成签到 ,获得积分10
21秒前
Ava发布了新的文献求助10
23秒前
AmyHu完成签到,获得积分10
24秒前
ZYA1999完成签到,获得积分10
33秒前
司徒元瑶完成签到 ,获得积分10
36秒前
federish完成签到 ,获得积分10
41秒前
Ava完成签到,获得积分10
51秒前
科研通AI2S应助科研通管家采纳,获得10
59秒前
无言完成签到 ,获得积分10
1分钟前
1分钟前
BUTTOND完成签到 ,获得积分10
1分钟前
滕皓轩完成签到 ,获得积分10
1分钟前
虫子发布了新的文献求助10
1分钟前
LSY完成签到 ,获得积分10
1分钟前
sunshine完成签到 ,获得积分10
1分钟前
Serena完成签到 ,获得积分10
1分钟前
科目三应助虫子采纳,获得10
1分钟前
酷酷的紫南完成签到 ,获得积分10
1分钟前
Naruto发布了新的文献求助10
1分钟前
淡定无施完成签到,获得积分10
1分钟前
chen完成签到 ,获得积分10
1分钟前
子木李完成签到 ,获得积分10
1分钟前
westernline完成签到,获得积分10
1分钟前
今天开心吗完成签到 ,获得积分10
1分钟前
Star完成签到 ,获得积分10
1分钟前
迅速千愁完成签到 ,获得积分0
1分钟前
上官若男应助蔚蓝的天空采纳,获得10
1分钟前
WXF完成签到 ,获得积分10
2分钟前
无限的含羞草完成签到,获得积分10
2分钟前
请我吃葡萄完成签到 ,获得积分10
2分钟前
小林完成签到 ,获得积分10
2分钟前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Applied Min-Max Approach to Missile Guidance and Control 5000
Metallurgy at high pressures and high temperatures 2000
Inorganic Chemistry Eighth Edition 1200
Anionic polymerization of acenaphthylene: identification of impurity species formed as by-products 1000
The Psychological Quest for Meaning 800
Signals, Systems, and Signal Processing 610
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 物理 内科学 复合材料 催化作用 物理化学 光电子学 电极 细胞生物学 基因 无机化学
热门帖子
关注 科研通微信公众号,转发送积分 6325897
求助须知:如何正确求助?哪些是违规求助? 8142015
关于积分的说明 17071610
捐赠科研通 5378411
什么是DOI,文献DOI怎么找? 2854159
邀请新用户注册赠送积分活动 1831834
关于科研通互助平台的介绍 1683061