Revisiting Code Search in a Two-Stage Paradigm
Not on the map. Why?
Abstract (arXiv)
With a good code search engine, developers can reuse existing code snippets and accelerate software development process. Current code search methods can be divided into two categories: traditional information retrieval (IR) based and deep learning (DL) based approaches. DL-based approaches include the cross-encoder paradigm and the bi-encoder paradigm. However, both approaches have certain limitations. The inference of IR-based and bi-encoder models are fast, however, they are not accurate enough; while cross-encoder models can achieve higher search accuracy but consume more time. In this work, we propose TOSS, a two-stage fusion code search framework that can combine the advantages of different code search methods. TOSS first uses IR-based and bi-encoder models to efficiently recall a small number of top-k code candidates, and then uses fine-grained cross-encoders for finer ranking. Furthermore, we conduct extensive experiments on different code candidate volumes and multiple programming languages to verify the effectiveness of TOSS. We also compare TOSS with six data fusion methods. Experimental results show that TOSS is not only efficient, but also achieves state-of-the-art accuracy with an overall mean reciprocal ranking (MRR) score of 0.763, compared to the best baseline result on the CodeSearchNet benchmark of 0.713. Our source code and experimental data are available at: https://github.com/fly-dragon211/TOSS.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). First posted on arXiv 24 Aug 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 1; 2025: 0; 2026: 7.
8 papers.
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
- 2026PhoenixRepair: Rethinking Repair Strategy Exploration in Software Agentscited by 2
- 2026MediaWiki Code2Code Search: Neural Retrieval for the Semantic Discovery of Open-Source Software Entitiescited by 1
- 2026Recall Before Rerank: Benchmarking Deep Learning Models for Large-Scale Code-to-Code Retrievalcited by 0
- 2026SynH-Rank: Quality-Aware Code Search via Diverse Data Synthesis and Hierarchical Ranking Trainingcited by 0
- 2026CodeGraph: Open-Taxonomy Knowledge Graph for Source Code with Wikidata Groundingcited by 0
- 2026CodeGraph: Open-Taxonomy Knowledge Graph for Source Code with Wikidata Grounding24 Sep 2026
- 2026MediaWiki Code2Code Search: Neural Retrieval for the Semantic Discovery of Open-Source Software Entities29 Jul 2026
- 2026PhoenixRepair: Rethinking Repair Strategy Exploration in Software Agents21 Jul 2026
- 2026SynH-Rank: Quality-Aware Code Search via Diverse Data Synthesis and Hierarchical Ranking Training19 Jul 2026
- 2026Recall Before Rerank: Benchmarking Deep Learning Models for Large-Scale Code-to-Code Retrieval24 Jun 2026
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning28 Jan 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024