mlsanityData to 14 Oct 2026

Cascaded Fast and Slow Models for Efficient Semantic Code Search

arXiv 2110.07811 ↗First posted 15 Oct 2021cs.CL cs.PLcited by 4

Not on the map. Why?

Abstract (arXiv)

The goal of natural language semantic code search is to retrieve a semantically relevant code snippet from a fixed set of candidates using a natural language query. Existing approaches are neither effective nor efficient enough towards a practical semantic code search system. In this paper, we propose an efficient and accurate semantic code search framework with cascaded fast and slow models, in which a fast transformer encoder model is learned to optimize a scalable index for fast retrieval followed by learning a slow classification-based re-ranking model to improve the performance of the top K results from the fast retrieval. To further reduce the high memory cost of deploying two separate models in practice, we propose to jointly train the fast and slow model based on a single transformer encoder with shared parameters. The proposed cascaded approach is not only efficient and scalable, but also achieves state-of-the-art results with an average mean reciprocal ranking (MRR) score of 0.7795 (across 6 programming languages) as opposed to the previous state-of-the-art result of 0.713 MRR on the CodeSearchNet benchmark.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 20 of its 24 references that are in the map. First posted on arXiv 15 Oct 2021.

Builds on

20 of 24 references.

References · 20

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  4. 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2021Program Synthesis with Large Language Modelscited by 3,637
  7. 2021Align before Fuse: Vision and Language Representation Learning with Momentum Distillationcited by 1,619
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  9. 2021Frozen in Time: A Joint Video and Image Encoder for End-to-End Retrievalcited by 1,177
  10. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  11. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  12. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
8 more
  1. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  2. 2021Unified Pre-training for Program Understanding and Generationcited by 366
  3. 2020IntelliCode Compose: Code Generation Using Transformercited by 227
  4. 2021Thinking Fast and Slow: Efficient Text-to-Visual Retrieval with Transformerscited by 93
  5. 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 75
  6. 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
  7. 2019When Deep Learning Met Code Searchcited by 46
  8. 2021In-IDE Code Generation from Natural Language: Promise and Challengescited by 42

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 3; 2024: 0; 2025: 0; 2026: 1.

4 papers.