Proceedings

Code Completion with Neural Attention and Pointer Networks

Download BibTeX Cite

Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence. Main track. Pages 4159-4165.

https://doi.org/10.24963/ijcai.2018/578

Abstract

Intelligent code completion has become an essential research task to accelerate modern software development. To facilitate effective code completion for dynamically-typed programming languages, we apply neural language models by learning from large codebases, and develop a tailored attention mechanism for code completion. However, standard neural language models even with attention mechanism cannot correctly predict the out-of-vocabulary (OoV) words that restrict the code completion performance. In this paper, inspired by the prevalence of locally repeated terms in program source code, and the recently proposed pointer copy mechanism, we propose a pointer mixture network for better predicting OoV words in code completion. Based on the context, the pointer mixture network learns to either generate a within-vocabulary word through an RNN component, or regenerate an OoV word from local context through a pointer component. Experiments on two benchmarked datasets demonstrate the effectiveness of our attention mechanism and pointer mixture network on the code completion task.

  1. [Allamanis and Sutton, 2014] Miltiadis Allamanis and Charles Sutton. Mining idioms from source code. In FSE'14: Proc. of the International Symposium on Foundations of Software Engineering, pages 472-483, 2014.
  2. [Allamanis et al., 2016] Miltiadis Allamanis, Hao Peng, and Charles Sutton. A convolutional attention network for ex- treme summarization of source code. In ICML'16: Proc. of the International Conference on Machine Learning, pages 2091-2100, 2016.
  3. [Bahdanau et al., 2014] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
  4. [Bhoopchand et al., 2016] Avishkar Bhoopchand, Tim Rocktäschel, Earl Barr, and Sebastian Riedel. Learning python code suggestion with a sparse pointer network. arXiv preprint arXiv:1611.08307, 2016.
  5. [Bielik et al., 2016] Pavol Bielik, Veselin Raychev, and Mar- tin Vechev. Phog: probabilistic model for code. In ICM- L'16: Proc. of the International Conference on Machine Learning, pages 2933-2942, 2016.
  6. [Cheng et al., 2016] Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. arXiv preprint arXiv:1601.06733, 2016.
  7. [Gu et al., 2016] Jiatao Gu, Zhengdong Lu, Hang Li, and Victor OK Li. Incorporating copying mechanism in sequence-to-sequence learning. arXiv preprint arX- iv:1603.06393, 2016.
  8. [Gulcehre et al., 2016] Caglar Gulcehre, Sungjin Ahn, Ramesh Nallapati, Bowen Zhou, and Yoshua Ben- gio. Pointing the unknown words. arXiv preprint arXiv:1603.08148, 2016.
  9. [Hindle et al., 2012] Abram Hindle, Earl T Barr, Zhendong Su, Mark Gabel, and Premkumar Devanbu. On the natu- ralness of software. In ICSE'12: Proc. of the Internation- al Conference on Software Engineering, pages 837-847, 2012.
  10. [Hochreiter and Schmidhuber, 1997] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735-1780, 1997.
  11. [Kingma and Ba, 2014] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
  12. [Li et al., 2017] Jian Li, Pinjia He, Jieming Zhu, and Michael R Lyu. Software defect prediction via convolu- tional neural network. In QRS'17: Proc. of the Interna- tional Conference on Software Quality, Reliability and Se- curity, pages 318-328, 2017.
  13. [Ling et al., 2016] Wang Ling, Edward Grefenstette, Kar- l Moritz Hermann, Tomáš Kočiskỳ, Andrew Senior, Fumin Wang, and Phil Blunsom. Latent predictor networks for code generation. arXiv preprint arXiv:1603.06744, 2016.
  14. [Liu et al., 2016] Chang Liu, Xin Wang, Richard Shin, Joseph E Gonzalez, and Dawn Song. Neural code com- pletion. 2016.
  15. [Luong et al., 2014] Minh-Thang Luong, Ilya Sutskever, Quoc V Le, Oriol Vinyals, and Wojciech Zaremba. Ad- dressing the rare word problem in neural machine transla- tion. arXiv preprint arXiv:1410.8206, 2014.
  16. [Merity et al., 2016] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
  17. [Mikolov et al., 2010] Tomas Mikolov, Martin Karafiát, Lukas Burget, Jan Cernockỳ, and Sanjeev Khudanpur. Re- current neural network based language model. In INTER- SPEECH, 2010.
  18. [Mou et al., 2016] Lili Mou, Ge Li, Lu Zhang, Tao Wang, and Zhi Jin. Convolutional neural networks over tree struc- tures for programming language processing. In AAAI, pages 1287-1293, 2016.
  19. [Raychev et al., 2014] Veselin Raychev, Martin Vechev, and Eran Yahav. Code completion with statistical language models. In ACM SIGPLAN Notices, volume 49, pages 419-428, 2014.
  20. [Raychev et al., 2016] Veselin Raychev, Pavol Bielik, and Martin Vechev. Probabilistic model for code with decision trees. In OOPSLA'16: Proc. of the International Con- ference on Object-Oriented Programming, Systems, Lan- guages, and Applications, pages 731-747, 2016.
  21. [Tran et al., 2016] Ke Tran, Arianna Bisazza, and Christof Monz. Recurrent memory networks for language model- ing. arXiv preprint arXiv:1601.01272, 2016.
  22. [Tu et al., 2014] Zhaopeng Tu, Zhendong Su, and Premku- mar Devanbu. On the localness of software. In FSE'14: Proc. of the International Symposium on Foundations of Software Engineering, pages 269-280, 2014.
  23. [Vinyals et al., 2015] Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS'15: Advances in Neural Information Processing Systems, pages 2692- 2700, 2015.
  24. [White et al., 2015] Martin White, Christopher Vendome, Mario Linares-Vásquez, and Denys Poshyvanyk. Toward deep learning software repositories. In MSR'15: Proc. of the Working Conference on Mining Software Repositories, pages 334-345, 2015.
  25. [Zaremba et al., 2014] Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regulariza- tion. arXiv preprint arXiv:1409.2329, 2014.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards