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
- Graham Neubig
- Miltiadis Allamanis
- Frank F. Xu
- Bogdan Vasilescu
- Marc Brockschmidt
- Zhengbao Jiang
- Pengcheng Yin
- Uri Alon
In Information Systems
- Graham Neubig
- Frank F. Xu
- Marc Brockschmidt
- Miltiadis Allamanis
- Bogdan Vasilescu
- Uri Alon
- Hamel Husain
- Tiferet Gazit
In Reinforcement Learning
- Zhengran Zeng
- Graham Neubig
- Guandong Xu
- Marc Brockschmidt
- Yuqun Zhang
- Wenhua Wang
- Miltiadis Allamanis
- Pengcheng Yin
In Code Generation & Program Synthesis
- Frank F. Xu
- Graham Neubig
- Bogdan Vasilescu
- Marc Brockschmidt
- Pengcheng Yin
- Miltiadis Allamanis
- Charles Sutton
- Rishabh Singh
Citations in the corpus
- CodeSearchNet Challenge: Evaluating the State of Semantic Code Search (2019, background): “[23]), and architectures similar to those discussed previously have been shown to work to some extent.”
- TranS^3: A Transformer-based Framework for Unifying Code Summarization and Code Search (2020, methodology): “However, We can observe that TranS3 signi cantly outperforms CoaCor in terms of code summarization (by 47.2%). erefore, to bridge such performance gap, CoaCor has to pay extra e ort for enhancing its modeling process while TranS3 can limit its e ort in training the model once and for all for optimiz”
- Incorporating External Knowledge through Pre-training for Natural Language to Code Generation (2020, background): “However, recently there has been a move towards applying semantic parsing to automatically generating source code in general-purpose programming languages (Yin et al., 2018; Yao et al., 2018; Lin et al., 2018; Agashe et al., 2019; Yao et al., 2019).”
- An Empirical Evaluation of GitHub Copilot's Code Suggestions (2022, unknown): “While there have been lots of similar research efforts [12, 14, 31], the seamless integration and availability of Copilot, along with GitHub’s backup, naturally created a “hype” in the tech world with many developers already using it through its technical preview or awaiting its usage [1, 21].”