Zero-Shot Cross-Domain Code Search without Fine-Tuning
Not on the map. Why?
Abstract (arXiv)
Code search aims to retrieve semantically relevant code snippets for natural language queries. While pre-trained language models (PLMs) have shown remarkable performance in this task, they struggle in cross-domain scenarios, often requiring costly fine-tuning or facing performance drops in zero-shot settings. RAPID, which generates synthetic data for model fine-tuning, is currently the only effective method for zero-shot cross-domain code search. Despite its effectiveness, RAPID demands substantial computational resources for fine-tuning and needs to maintain specialized models for each domain, underscoring the need for a zero-shot, fine-tuning-free approach for cross-domain code search. The key to tackling zero-shot cross-domain code search lies in bridging the gaps among domains. In this work, we propose to break the query-code matching process of code search into two simpler tasks: query-comment matching and code-code matching. Our empirical study reveals the strong complementarity among the three matching schemas in zero-shot cross-domain settings, i.e., query-code, query-comment, and code-code matching. Based on the findings, we propose CodeBridge, a zero-shot, fine-tuning-free approach for cross-domain code search. Specifically, CodeBridge uses Large Language Models (LLMs) to generate comments and pseudo-code, then combines query-code, query-comment, and code-code matching via PLM-based similarity scoring and sampling-based fusion. Experimental results show that our approach outperforms the state-of-the-art PLM-based code search approaches, i.e., CoCoSoDa and UniXcoder, by an average of 21.4% and 24.9% in MRR, respectively, across three datasets. Our approach also yields results that are better than or comparable to those of the zero-shot cross-domain code search approach RAPID, which requires costly fine-tuning.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 35 of its 63 references that are in the map. First posted on arXiv 10 Apr 2025.
Builds on
35 of 63 references.
References · 35
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2023StarCoder: may the source be with you!cited by 799
23 more
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2023C-Pack: Packed Resources For General Chinese Embeddingscited by 578
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2022SGPT: GPT Sentence Embeddings for Semantic Searchcited by 204
- 2021GPL: Generative Pseudo Labeling for Unsupervised Domain Adaptation of Dense Retrievalcited by 119
- 2021One Model to Serve All: Star Topology Adaptive Recommender for Multi-Domain CTR Predictioncited by 78
- 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 75
- 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 72
- 2023Lookahead: An Inference Acceleration Framework for Large Language Model with Lossless Generation Accuracycited by 37
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2020Opportunities and Challenges in Code Search Toolscited by 22
- 2022CoCoSoDa: Effective Contrastive Learning for Code Searchcited by 22
- 2022CodeRetriever: Unimodal and Bimodal Contrastive Learning for Code Searchcited by 21
- 2023Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyondcited by 20
- 2023One Adapter for All Programming Languages? Adapter Tuning for Code Search and Summarizationcited by 16
- 2024You Augment Me: Exploring ChatGPT-based Data Augmentation for Semantic Code Searchcited by 11
- 2022Cross-Domain Deep Code Search with Meta Learningcited by 7
- 2022MetaTPTrans: A Meta Learning Approach for Multilingual Code Representation Learningcited by 6
- 2020CodeMatcher: Searching Code Based on Sequential Semantics of Important Query Wordscited by 5
- 2022CSRS: Code Search with Relevance Matching and Semantic Matchingcited by 4
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2023Domain Adaptive Code Completion via Language Models and Decoupled Domain Databases
- 2024CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrieval
- 2026SLM Finetuning for Natural Language to Domain Specific Code Generation in Production
- 2026Exploring different approaches to customize language models for domain-specific text-to-code generation
- 2023MILL: Mutual Verification with Large Language Models for Zero-Shot Query Expansion
- 2024CodeGRAG: Bridging the Gap between Natural Language and Programming Language via Graphical Retrieval Augmented Generation
- 2024Improving the Ability of Pre-trained Language Model by Imparting Large Language Model's Experience ↗
- 2025Cross-Task Benchmarking and Evaluation of General-Purpose and Code-Specific Large Language Models ↗