Skip to main content
archive
Search Submit Donate Log in
Press Enter to search · Advanced search

Computer Science > Software Engineering

arXiv:2208.11274 (cs)
[Submitted on 24 Aug 2022 (v1), last revised 28 Mar 2024 (this version, v3)]

Title:Revisiting Code Search in a Two-Stage Paradigm

Authors:Fan Hu, Yanlin Wang, Lun Du, Xirong Li, Hongyu Zhang, Shi Han, Dongmei Zhang
View a PDF of the paper titled Revisiting Code Search in a Two-Stage Paradigm, by Fan Hu and 6 other authors
View PDF HTML (experimental)
Abstract: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: this https URL.
Comments: Accepted by WSDM 2023
Subjects: Software Engineering (cs.SE)
Cite as: arXiv:2208.11274 [cs.SE]
  (or arXiv:2208.11274v3 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2208.11274
arXiv-issued DOI via DataCite
Related DOI: https://doi.org/10.1145/3539597.3570383
DOI(s) linking to related resources

Submission history

From: Fan Hu [view email]
[v1] Wed, 24 Aug 2022 02:34:27 UTC (3,047 KB)
[v2] Tue, 7 Mar 2023 09:39:42 UTC (3,028 KB)
[v3] Thu, 28 Mar 2024 03:51:21 UTC (3,029 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Revisiting Code Search in a Two-Stage Paradigm, by Fan Hu and 6 other authors
  • View PDF
  • HTML (experimental)
  • TeX Source
view license

Current browse context:

cs.SE
< prev   |   next >
new | recent | 2022-08
Change to browse by:
cs

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar
Loading...

BibTeX formatted citation

Data provided by:

Bookmark

BibSonomy Reddit

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
We gratefully acknowledge support from our major funders, member institutions, , and all contributors.
About · Help · Contact · Subscribe · Copyright · Privacy · Accessibility · Operational Status (opens in new tab)
Major funding support from
Simons Foundation Simons Foundation International Schmidt Sciences