CoaCor: Code Annotation for Code Retrieval with Reinforcement Learning

By Ziyu Yao, Jayavardhan Reddy Peddamail, Huan Sun. 2019

109 citations recorded by the source corpus.

To accelerate software development, much research has been performed to help people understand and reuse the huge amount of available code resources. Two important tasks have been widely studied: code retrieval, which aims to retrieve code snippets relevant to a given natural language query from a code base, and code annotation, where the goal is to annotate a code snippet with a natural language description. Despite their advancement in recent years, the two tasks are mostly explored separately. In this work, we investigate a novel perspective of Code annotation for Code retrieval (hence called “CoaCor”), where a code annotation model is trained to generate a natural language annotation that can represent the semantic meaning of a given code snippet and can be leveraged by a code retrieval model to better distinguish relevant code snippets from others. To this end, we propose an effective framework based on reinforcement learning, which explicitly encourages the code annotation model to generate annotations that can be used for the retrieval task. Through extensive experiments, we show that code annotations generated by our framework are much more detailed and more useful for code retrieval, and they can further improve the performance of existing code retrieval models significantly.1

Subfields: Artificial Intelligence, Information Systems, Reinforcement Learning, 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. Graham Neubig
  2. Miltiadis Allamanis
  3. Frank F. Xu
  4. Bogdan Vasilescu
  5. Marc Brockschmidt
  6. Zhengbao Jiang
  7. Pengcheng Yin
  8. Uri Alon

In Information Systems

  1. Graham Neubig
  2. Frank F. Xu
  3. Marc Brockschmidt
  4. Miltiadis Allamanis
  5. Bogdan Vasilescu
  6. Uri Alon
  7. Hamel Husain
  8. Tiferet Gazit

In Reinforcement Learning

  1. Zhengran Zeng
  2. Graham Neubig
  3. Guandong Xu
  4. Marc Brockschmidt
  5. Yuqun Zhang
  6. Wenhua Wang
  7. Miltiadis Allamanis
  8. Pengcheng Yin

In Code Generation & Program Synthesis

  1. Frank F. Xu
  2. Graham Neubig
  3. Bogdan Vasilescu
  4. Marc Brockschmidt
  5. Pengcheng Yin
  6. Miltiadis Allamanis
  7. Charles Sutton
  8. Rishabh Singh

Citations in the corpus