CoChat

CoaCor: Code Annotation for Code Retrieval with Reinforcement Learning

Open access
Yao, Ziyu, Peddamail, Jayavardhan Reddy, Sun, Huan · 2019 · The World Wide Web Conference
Cited by 89

The 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.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1145/3308558.3313632

Cites

13 of 13 references verified0 citation errors · 0 not checkable

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.

A few free checks a day · papers already verified open instantly · results are public

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

Show all 13 references

Research works printed but not linked: 48

  1. 10.1145/3212695 · DOI · Paper page
  2. 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.
  3. 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.
  4. 10.1145/175290.175300 · DOI · Paper page
  5. 10.3115/1219044.1219075 · DOI · Paper page
  6. 10.1145/3238147.3240471 · DOI · Paper page
  7. 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
  8. 10.1109/ICNN.1996.548916 · DOI · Paper page
  9. 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. 10.1145/3180155.3180167 · DOI · Paper page
  11. 10.5555/2486788.2486898 · doi:10.5555/2486788.2486898
  12. 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.
  13. 10.18653/v1/N16-1108 · DOI · Paper page
  14. 10.1109/CSMR-WCRE.2014.6747190 · DOI
  15. 10.1145/3196321.3196334 · DOI · Paper page
  16. 10.5555/3304889.3304975 · doi:10.5555/3304889.3304975
  17. 10.18653/v1/P16-1195 · DOI · Paper page
  18. 10.5555/3155562.3155583 · doi:10.5555/3155562.3155583
  19. 10.1145/2568225.2568292 · DOI
  20. 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
  21. 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
  22. 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
  23. 10.1109/CVPR.2018.00640 · DOI · Paper page
  24. 10.18653/v1/D18-1421 · DOI · Paper page
  25. 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
  26. 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.
  27. 10.1109/TSE.2011.84 · DOI
  28. 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.
  29. 10.1109/ICPC.2013.6613830 · DOI · Paper page
  30. 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.
  31. 10.3115/1073083.1073135 · DOI · Paper page
  32. 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
  33. 10.1109/CVPR.2017.131 · DOI · Paper page
  34. 10.1162/089976604773135104 · DOI · Paper page
  35. 10.5555/1059603.1059611 · doi:10.5555/1059603.1059611
  36. 10.5555/2627435.2670313 · doi:10.5555/2627435.2670313
  37. 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.
  38. 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.
  39. 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.
  40. 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
  41. 10.1145/3018661.3018691 · DOI
  42. 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.
  43. 10.1145/3238147.3238206 · DOI · Paper page
  44. 10.1145/3077136.3080786 · DOI · Paper page
  45. 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
  46. 10.1007/BF00992696 · DOI · Paper page
  47. 10.1145/3178876.3186081 · DOI
  48. 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

See all 89

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.