Lune

ACL2022Top-tier venue

Accelerating Code Search with Deep Hashing and Code Classification

Wenchao Gu, Yanlin Wang, Lun Du, Hongyu Zhang, Shi Han, Dongmei Zhang, Michael R. Lyu

Abstract

Code search is to search reusable code snippets from source code corpus based on natural languages queries. Deep learning-based methods on code search have shown promising results. However, previous methods focus on retrieval accuracy, but lacked attention to the efficiency of the retrieval process. We propose a novel method CoSHC to accelerate code search with deep hashing and code classification, aiming to perform efficient code search without sacrificing too much accuracy. To evaluate the effectiveness of CoSHC, we apply our method on five code search models. Extensive experimental results indicate that compared with previous code search baselines, CoSHC can save more than 90% of retrieval time meanwhile preserving at least 99% of retrieval accuracy.

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.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • CoCoSoDa: Effective Contrastive Learning for Code Search cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion cites CoCoSoDa: Effective Contrastive Learning for Code Search
  • AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion cites SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashing
  • AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion cites When to Stop? Towards Efficient Code Generation in LLMs with Excess Token Prevention
  • SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashing cites CoCoSoDa: Effective Contrastive Learning for Code Search
  • SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashing cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashing cites Deep Joint-Semantics Reconstructing Hashing for Large-Scale Unsupervised Cross-Modal Retrieval
  • DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning cites CoCoSoDa: Effective Contrastive Learning for Code Search
  • DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning cites SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep Hashing
  • DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning cites When to Stop? Towards Efficient Code Generation in LLMs with Excess Token Prevention
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. CoCoSoDa: Effective Contrastive Learning for Code SearchEnsheng Shi, Yanlin Wang, Wenchao Gu, Lun Du et al.ICSE 2023 · 45 citations
  2. When to Stop? Towards Efficient Code Generation in LLMs with Excess Token PreventionLianghong Guo, Yanlin Wang, Ensheng Shi, Wanjun Zhong et al.ISSTA 2024 · 16 citations
  3. SECRET: Towards Scalable and Efficient Code Retrieval via Segmented Deep HashingWenchao Gu, Ensheng Shi, Yanlin Wang, Lun Du et al.ICSE 2025 · 3 citations
  4. DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context PoisoningYanli Wang, Jiadong Wu, Tianyue Jiang, Mingwei Liu et al.ASE 2025 · 3 citations
  5. AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code CompletionTianyue Jiang, Yanlin Wang, Yanli Wang, Daya Guo et al.ASE 2025 · 2 citations

Builds on2

  1. 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
  2. Deep Joint-Semantics Reconstructing Hashing for Large-Scale Unsupervised Cross-Modal RetrievalShupeng Su, Zhisheng Zhong, Chao ZhangICCV 2019 · 261 citations

Related papers

  1. Asymmetric Deep Hashing for Efficient Hash Code CompressionShu Zhao, Dayan Wu, Wanqian Zhang, Yu Zhou et al.ACM MM 2020 · 18 citations
  2. Efficient Text-to-Code Retrieval with Cascaded Fast and Slow Transformer ModelsAkhilesh Deepak Gotmare, Junnan Li, Shafiq Joty, Steven C. H. HoiFSE 2023 · 5 citations
  3. Accelerate Learning of Deep Hashing With Gradient AttentionLong-Kai Huang, Jianda Chen, Sinno Jialin PanICCV 2019 · 22 citations
  4. You see what I want you to see: poisoning vulnerabilities in neural code searchYao Wan, Shijie Zhang, Hongyu Zhang, Yulei Sui et al.FSE 2022 · 57 citations
  5. Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving TransformationsNghi D. Q. Bui, Yijun Yu, Lingxiao JiangSIGIR 2021 · 98 citations
Dusk over the sea between two cliffs drawn in fine vertical lines