CoaCor: Code Annotation for Code Retrieval with Reinforcement Learning
Open accessThe DOI matches its Crossref record; 13 of the 13 references it cites were found in a registry or an index.
Abstract
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
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Hochreiter, S., & Schmidhuber, J. (1997) · Neural Computation · doi:10.1162/neco.1997.9.8.1735 · Cited by 102,318
Adam: A Method for Stochastic Optimization
Kingma, D. P., & Ba, J. (2014) · arXiv · doi:10.48550/arxiv.1412.6980 · Cited by 98,946
Bidirectional recurrent neural networks
Schuster, M., & Paliwal, K. K. (1997) · IEEE Transactions on Signal Processing · doi:10.1109/78.650093 · Cited by 10,172 · cited 2×
“ctors through a randomly initialized word embedding matrix, which will be learned during model training. We then use a bidirectional Long Short-Term Memory (LSTM)-based Recurrent Neural Network (RNN) [10, 11, 18, 35, 48, 64] to learn the token representation by summarizing the contextual information from both directio…”
BackgroundMethodEffective Approaches to Attention-based Neural Machine Translation
Luong, T., Pham, H., & Manning, C. D. (2015) · Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d15-1166 · Cited by 8,382
Asynchronous Methods for Deep Reinforcement Learning
Mnih, V., Badia, A. P., Mirza, M., Graves, A., Lillicrap, T. P., Harley, T., Silver, D., & Kavukcuoglu, K. (2016) · arXiv · doi:10.48550/arxiv.1602.01783 · Cited by 7,132 · cited 5×
“ard will be returned. We formulate this generation process as the Markov Decision Process [5] and train the CA model with reinforcement learning [53] (specifically, theAdvantageActor-Critic algorithm [36]) to maximize the retrieval-based rewards it can receive from the QC-based CR model. We elaborate the CR and CA mod…”
MethodInfluentialBellman, R. (1957) · Indiana University Mathematics Journal · doi:10.1512/iumj.1957.6.56038 · Cited by 2,408
Sequence Level Training with Recurrent Neural Networks
Ranzato, M., Chopra, S., Auli, M., & Zaremba, W. (2015) · arXiv · doi:10.48550/arxiv.1511.06732 · Cited by 1,426 · cited 4×
“[44] were among the first to successfully apply the REINFORCE algorithm [62] to train RNNmodels for several sequence generation tasks, indicating that directly optimizing the metric used at test time can lead to significantly better models than those trained via MLE.”
BackgroundMethodInfluentialTowards automatically generating summary comments for Java methods
Sridhara, G., Hill, E., Muppaneni, D., Pollock, L., & Vijay-Shanker, K. (2010) · Proceedings of the IEEE/ACM international conference on Automated software engineering · doi:10.1145/1858996.1859006 · Cited by 514
An Actor-Critic Algorithm for Sequence Prediction
Bahdanau, D., Brakel, P., Xu, K., Goyal, A., Lowe, R., Pineau, J., Courville, A., & Bengio, Y. (2016) · arXiv · doi:10.48550/arxiv.1607.07086 · Cited by 423
Why We Need New Evaluation Metrics for NLG
Novikova, J., Dušek, O., Cercas Curry, A., & Rieser, V. (2017) · Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d17-1238 · Cited by 422 · cited 1×
“This is in line with the recent discussions on whether the automatic BLEU score is an appropriate evaluation metric for generation tasks or not [30, 40].”
Result
Research works printed but not linked: 48
- 10.1145/3212695 · DOI · Paper page
- Miltiadis Allamanis , Hao Peng , and Charles Sutton . 2016 . A convolutional attention network for extreme summarization of source code . In International Conference on Machine Learning. 2091-2100 . Miltiadis Allamanis, Hao Peng, and Charles Sutton. 2016. A convolutional attention network for extreme summarization of source code. In International Conference on Machine Learning. 2091-2100.
- Miltos Allamanis , Daniel Tarlow , Andrew Gordon , and Yi Wei . 2015 . Bimodal modelling of source code and natural language . In International Conference on Machine Learning. 2123-2132 . Miltos Allamanis, Daniel Tarlow, Andrew Gordon, and Yi Wei. 2015. Bimodal modelling of source code and natural language. In International Conference on Machine Learning. 2123-2132.
- 10.1145/175290.175300 · DOI · Paper page
- 10.3115/1219044.1219075 · DOI · Paper page
- 10.1145/3238147.3240471 · DOI · Paper page
- Felix A Gers Jürgen Schmidhuber and Fred Cummins. 1999. Learning to forget: Continual prediction with LSTM. (1999). Felix A Gers Jürgen Schmidhuber and Fred Cummins. 1999. Learning to forget: Continual prediction with LSTM. (1999). · DOI · Paper page
- 10.1109/ICNN.1996.548916 · DOI · Paper page
- Ian Goodfellow Jean Pouget-Abadie Mehdi Mirza Bing Xu David Warde-Farley Sherjil Ozair Aaron Courville and Yoshua Bengio. 2014. Generative adversarial nets. In Advances in neural information processing systems. 2672-2680. Ian Goodfellow Jean Pouget-Abadie Mehdi Mirza Bing Xu David Warde-Farley Sherjil Ozair Aaron Courville and Yoshua Bengio. 2014. Generative adversarial nets. In Advances in neural information processing systems. 2672-2680.
- 10.1145/3180155.3180167 · DOI · Paper page
- 10.5555/2486788.2486898 · doi:10.5555/2486788.2486898
- Di He , Yingce Xia , Tao Qin , Liwei Wang , Nenghai Yu , Tieyan Liu , and Wei-Ying Ma . 2016 . Dual learning for machine translation . In Advances in Neural Information Processing Systems. 820 - 828 . Di He, Yingce Xia, Tao Qin, Liwei Wang, Nenghai Yu, Tieyan Liu, and Wei-Ying Ma. 2016. Dual learning for machine translation. In Advances in Neural Information Processing Systems. 820-828.
- 10.18653/v1/N16-1108 · DOI · Paper page
- 10.1109/CSMR-WCRE.2014.6747190 · DOI
- 10.1145/3196321.3196334 · DOI · Paper page
- 10.5555/3304889.3304975 · doi:10.5555/3304889.3304975
- 10.18653/v1/P16-1195 · DOI · Paper page
- 10.5555/3155562.3155583 · doi:10.5555/3155562.3155583
- 10.1145/2568225.2568292 · DOI
- Yoon Kim. 2014. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882(2014). Yoon Kim. 2014. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882(2014). · DOI · Paper page
- Wuwei Lan and Wei Xu. 2018. Neural Network Models for Paraphrase Identification Semantic Textual Similarity Natural Language Inference and Question Answering. arXiv preprint arXiv:1806.04330(2018). Wuwei Lan and Wei Xu. 2018. Neural Network Models for Paraphrase Identification Semantic Textual Similarity Natural Language Inference and Question Answering. arXiv preprint arXiv:1806.04330(2018). · arXiv
- Jiwei Li Will Monroe Alan Ritter Michel Galley Jianfeng Gao and Dan Jurafsky. 2016. Deep reinforcement learning for dialogue generation. arXiv preprint arXiv:1606.01541(2016). Jiwei Li Will Monroe Alan Ritter Michel Galley Jianfeng Gao and Dan Jurafsky. 2016. Deep reinforcement learning for dialogue generation. arXiv preprint arXiv:1606.01541(2016). · arXiv
- 10.1109/CVPR.2018.00640 · DOI · Paper page
- 10.18653/v1/D18-1421 · DOI · Paper page
- Chia-Wei Liu Ryan Lowe Iulian V Serban Michael Noseworthy Laurent Charlin and Joelle Pineau. 2016. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023(2016). Chia-Wei Liu Ryan Lowe Iulian V Serban Michael Noseworthy Laurent Charlin and Joelle Pineau. 2016. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023(2016). · arXiv
- Meili Lu , Xiaobing Sun , Shaowei Wang , David Lo , and Yucong Duan . 2015 . Query expansion via wordnet for effective code search. In Software Analysis , Evolution and Reengineering (SANER), 2015 IEEE 22nd International Conference on. IEEE, 545-549 . Meili Lu, Xiaobing Sun, Shaowei Wang, David Lo, and Yucong Duan. 2015. Query expansion via wordnet for effective code search. In Software Analysis, Evolution and Reengineering (SANER), 2015 IEEE 22nd International Conference on. IEEE, 545-549.
- 10.1109/TSE.2011.84 · DOI
- Larry Medsker and Lakhmi C Jain . 1999. Recurrent neural networks: design and applications . CRC press . Larry Medsker and Lakhmi C Jain. 1999. Recurrent neural networks: design and applications. CRC press.
- 10.1109/ICPC.2013.6613830 · DOI · Paper page
- Dana Movshovitz-Attias and William W Cohen . 2013 . Natural language models for predicting programming comments . In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers) , Vol. 2 . 35 - 40 . Dana Movshovitz-Attias and William W Cohen. 2013. Natural language models for predicting programming comments. In Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), Vol. 2. 35-40.
- 10.3115/1073083.1073135 · DOI · Paper page
- Romain Paulus Caiming Xiong and Richard Socher. 2017. A deep reinforced model for abstractive summarization. arXiv preprint arXiv:1705.04304(2017). Romain Paulus Caiming Xiong and Richard Socher. 2017. A deep reinforced model for abstractive summarization. arXiv preprint arXiv:1705.04304(2017). · arXiv
- 10.1109/CVPR.2017.131 · DOI · Paper page
- 10.1162/089976604773135104 · DOI · Paper page
- 10.5555/1059603.1059611 · doi:10.5555/1059603.1059611
- 10.5555/2627435.2670313 · doi:10.5555/2627435.2670313
- Ilya Sutskever Oriol Vinyals and Quoc V Le. 2014. Sequence to sequence learning with neural networks. In Advances in neural information processing systems. 3104-3112. Ilya Sutskever Oriol Vinyals and Quoc V Le. 2014. Sequence to sequence learning with neural networks. In Advances in neural information processing systems. 3104-3112.
- Richard S Sutton and Andrew G Barto . 1998. Introduction to reinforcement learning . Vol. 135 . MIT press Cambridge . Richard S Sutton and Andrew G Barto. 1998. Introduction to reinforcement learning. Vol. 135. MIT press Cambridge.
- Richard S Sutton David A McAllester Satinder P Singh and Yishay Mansour. 2000. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems. 1057-1063. Richard S Sutton David A McAllester Satinder P Singh and Yishay Mansour. 2000. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems. 1057-1063.
- Duyu Tang Nan Duan Tao Qin Zhao Yan and Ming Zhou. 2017. Question answering and question generation as dual tasks. arXiv preprint arXiv:1706.02027(2017). Duyu Tang Nan Duan Tao Qin Zhao Yan and Ming Zhou. 2017. Question answering and question generation as dual tasks. arXiv preprint arXiv:1706.02027(2017). · arXiv
- 10.1145/3018661.3018691 · DOI
- Ellen M Voorhees 1999 . The TREC-8 Question Answering Track Report .. In Trec , Vol. 99. 77 - 82 . Ellen M Voorhees 1999. The TREC-8 Question Answering Track Report.. In Trec, Vol. 99. 77-82.
- 10.1145/3238147.3238206 · DOI · Paper page
- 10.1145/3077136.3080786 · DOI · Paper page
- Xiaoran Wang Yifan Peng and Benwen Zhang. 2018. Comment Generation for Source Code: State of the Art Challenges and Opportunities. arXiv preprint arXiv:1802.02971(2018). Xiaoran Wang Yifan Peng and Benwen Zhang. 2018. Comment Generation for Source Code: State of the Art Challenges and Opportunities. arXiv preprint arXiv:1802.02971(2018). · arXiv
- 10.1007/BF00992696 · DOI · Paper page
- 10.1145/3178876.3186081 · DOI
- Wojciech Zaremba Ilya Sutskever and Oriol Vinyals. 2014. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329(2014). Wojciech Zaremba Ilya Sutskever and Oriol Vinyals. 2014. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329(2014). · arXiv
Cited by
An empirical evaluation of GitHub copilot's code suggestions
Nguyen, N., & Nadi, S. (2022) · Proceedings of the 19th International Conference on Mining Software Repositories · doi:10.1145/3524842.3528470 · Cited by 313
In-IDE Code Generation from Natural Language: Promise and Challenges
Xu, F. F., Vasilescu, B., & Neubig, G. (2022) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3487569 · Cited by 154
Kuhail, M. A., Mathew, S. S., Khalil, A., Berengueres, J., & Shah, S. J. H. (2024) · Science of Computer Programming · doi:10.1016/j.scico.2024.103111 · Cited by 68
You see what I want you to see: poisoning vulnerabilities in neural code search
Wan, Y., Zhang, S., Zhang, H., Sui, Y., Xu, G., Yao, D., Jin, H., & Sun, L. (2022) · Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering · doi:10.1145/3540250.3549153 · Cited by 60
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
Husain, H., Wu, H.-H., Gazit, T., Allamanis, M., & Brockschmidt, M. (2019) · arXiv · doi:10.48550/arxiv.1909.09436 · Cited by 483
Metadata
- Authors
- Yao, Z., Peddamail, J. R., & Sun, H.
- Venue
- The World Wide Web Conference
- Publisher
- ACM
- Published
- 2019-05-13
- Pages
- 2203-2214
- OpenAlex
- W2911550516
- Cited by
- 89
- References
- 13
- FWCI
- 10.98
- Type
- conference paper
- Language
- en
- Open access
- gold
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
How to cite
Cite CoChat for the checks on this page, and the paper for its own findings.
- This page
- CoChat. (2026). Citation check: CoaCor: Code Annotation for Code Retrieval with Reinforcement Learning. https://app.cochat.ai/papers/10.1145/3308558.3313632
- The paper
- Yao, Z., Peddamail, J. R., & Sun, H. (2019). CoaCor: Code Annotation for Code Retrieval with Reinforcement Learning. The World Wide Web Conference. https://doi.org/10.1145/3308558.3313632
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.