BERT2Code: Can Pretrained Language Models be Leveraged for Code Search?
Abdullah Al Ishtiaq, Masum Hasan, Md. Mahim Anjum Haque, Kazi Sajeed, Mehrab, Tanveer Muttaqueen, Tahmid Hasan, Anindya Iqbal, Rifat Shahriyar

TL;DR
This paper explores leveraging pretrained language models for semantic code search by using embeddings and a simple neural network, highlighting the importance of embedding quality for search effectiveness.
Contribution
It demonstrates that a lightweight neural network can effectively utilize code and natural language embeddings for semantic code search, emphasizing the role of embedding quality.
Findings
Embedding quality is the main bottleneck for search performance.
A simple 2-layer neural network can learn relationships between embeddings.
Analysis suggests improving embedding models could enhance code search results.
Abstract
Millions of repetitive code snippets are submitted to code repositories every day. To search from these large codebases using simple natural language queries would allow programmers to ideate, prototype, and develop easier and faster. Although the existing methods have shown good performance in searching codes when the natural language description contains keywords from the code, they are still far behind in searching codes based on the semantic meaning of the natural language query and semantic structure of the code. In recent years, both natural language and programming language research communities have created techniques to embed them in vector spaces. In this work, we leverage the efficacy of these embedding models using a simple, lightweight 2-layer neural network in the task of semantic code search. We show that our model learns the inherent relationship between the embedding…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Topic Modeling · Software Testing and Debugging Techniques
