Cross-Domain Deep Code Search with Meta Learning
Yitian Chai, Hongyu Zhang, Beijun Shen, Xiaodong Gu
Abstract
Recently, pre-trained programming language models such as Code-BERT have demonstrated substantial gains in code search. Despite showing great performance, they rely on the availability of large amounts of parallel data to fine-tune the semantic mappings between queries and code. This restricts their practicality in domainspecific languages that have relatively scarce and expensive data. In this paper, we propose CroCS, a novel approach for domainspecific code search. CroCS employs a transfer learning framework where an initial program representation model is pre-trained on a large corpus of common programming languages (such as Java and Python), and is further adapted to domain-specific languages such as Solidity and SQL. Unlike cross-language CodeBERT, which is directly fine-tuned in the target language, CroCS adapts a few-shot meta-learning algorithm called MAML to learn the good initialization of model parameters, which can be best reused in a domain-specific language. We evaluate the proposed approach on two domain-specific languages, namely Solidity and SQL, with model transferred from two widely used languages (Python and Java). Experimental results show that CroCS significantly outperforms conventional pre-trained code models that are directly finetuned in domain-specific languages, and it is particularly effective for scarce data.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
10 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks
- No more fine-tuning? an experimental evaluation of prompt tuning in code intelligence cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- No more fine-tuning? an experimental evaluation of prompt tuning in code intelligence cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- No more fine-tuning? an experimental evaluation of prompt tuning in code intelligence cites Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks
- No more fine-tuning? an experimental evaluation of prompt tuning in code intelligence cites Language Models are Few-Shot Learners
- AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detection cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detection cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Self-Supervised Query Reformulation for Code Search cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- Self-Supervised Query Reformulation for Code Search cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Self-Supervised Query Reformulation for Code Search cites Language Models are Few-Shot Learners
Cited by top-tier papers10
- No more fine-tuning? an experimental evaluation of prompt tuning in code intelligenceChaozheng Wang, Yuanhang Yang, Cuiyun Gao, Yun Peng et al.FSE 2022 · 148 citations
- Self-Supervised Query Reformulation for Code SearchYuetian Mao, Chengcheng Wan, Yuze Jiang, Xiaodong GuFSE 2023 · 14 citations
- Predicting Configuration Performance in Multiple Environments with Sequential Meta-LearningJingzhi Gong, Tao ChenFSE 2024 · 13 citations
- AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone DetectionYangkai Du, Tengfei Ma, Lingfei Wu, Xuhong Zhang et al.AAAI 2024 · 9 citations
- Statistical Type Inference for Incomplete ProgramsYaohui Peng, Jing Xie, Qiongling Yang, Hanwen Guo et al.FSE 2023 · 2 citations
Builds on5
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 citations
- OCoR: An Overlapping-Aware Code RetrieverQihao Zhu, Zeyu Sun, Xiran Liang, Yingfei Xiong et al.ASE 2020 · 28 citations
- Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related TasksAntonio Mastropaolo, Simone Scalabrino, Nathan Cooper, David Nader-Palacio et al.ICSE 2021 · 9 citations
Related papers
- Parallel-SFT: Improving Zero-Shot Cross-Programming-Language Transfer for Code RLZhaofeng Wu, Shiqi Wang, Boya Peng, Anuj Kumar Goyal et al.ACL Findings 2026
- Bridging Pre-trained Models and Downstream Tasks for Source Code UnderstandingDeze Wang, Zhouyang Jia, Shanshan Li, Yue Yu et al.ICSE 2022 · 68 citations
- CoCoSoDa: Effective Contrastive Learning for Code SearchEnsheng Shi, Yanlin Wang, Wenchao Gu, Lun Du et al.ICSE 2023 · 45 citations
- Zero-Shot Cross-Domain Code Search without Fine-TuningKeyu Liang, Zhongxin Liu, Chao Liu, Zhiyuan Wan et al.FSE 2025 · 2 citations
- Towards Low-Resource Automatic Program Repair with Meta-Learning and Pretrained Language ModelsWeishi Wang, Yue Wang, Steven C. H. Hoi, Shafiq JotyEMNLP 2023 · 2 citations
