When deep learning met code search

By José Pablo Cambronero, Hongyu Li, Seohyun Kim, Koushik Sen, Satish Chandra. 2019

239 citations recorded by the source corpus.

There have been multiple recent proposals on using deep neural networks for code search using natural language. Common across these proposals is the idea of embedding code and natural language queries into real vectors and then using vector distance to approximate semantic correlation between code and the query. Multiple approaches exist for learning these embeddings, including unsupervised techniques, which rely only on a corpus of code examples, and supervised techniques, which use an aligned corpus of paired code and natural language descriptions. The goal of this supervision is to produce embeddings that are more similar for a query and the corresponding desired code snippet. Clearly, there are choices in whether to use supervised techniques at all, and if one does, what sort of network and training to use for supervision. This paper is the first to evaluate these choices systematically. To this end, we assembled implementations of state-of-the-art techniques to run on a common platform, training and evaluation corpora. To explore the design space in network complexity, we also introduced a new design point that is a minimal supervision extension to an existing unsupervised technique. Our evaluation shows that: 1. adding supervision to an existing unsupervised technique can improve performance, though not necessarily by much; 2. simple networks for supervision can be more effective that more sophisticated sequence-based networks for code search; 3. while it is common to use docstrings to carry out supervision, there is a sizeable gap between the effectiveness of docstrings and a more query-appropriate supervision corpus.

Subfields: Artificial Intelligence, Information Systems, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Eran Yahav
  2. Uri Alon
  3. Miltiadis Allamanis
  4. Petros Maniatis
  5. Aditya Kanade
  6. Baptiste Rozière
  7. Kensen Shi
  8. Gogul Balakrishnan

In Information Systems

  1. Uri Alon
  2. Eran Yahav
  3. Aditya Kanade
  4. Petros Maniatis
  5. Miltiadis Allamanis
  6. Kensen Shi
  7. Gogul Balakrishnan
  8. Marc Brockschmidt

In Code Generation & Program Synthesis

  1. Aditya Kanade
  2. Uri Alon
  3. Marc Szafraniec
  4. Baptiste Rozière
  5. Miltiadis Allamanis
  6. Eran Yahav
  7. Petros Maniatis
  8. Guillaume Lample

Citations in the corpus