Code Completion with Neural Attention and Pointer Networks

By Jian Li, Yue Wang, Michael R. Lyu, Irwin King. 2017

246 citations recorded by the source corpus.

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.

Subfields: Computer Networks and Communications, Information Systems, Natural Language Processing, Code Generation & Program Synthesis, Signal Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Computer Networks and Communications

  1. Maliheh Izadi
  2. Roberta Gismondi
  3. Baishakhi Ray
  4. Charles Sutton
  5. Xinyun Chen
  6. Dawn Song
  7. Georgios Gousios
  8. Sarah Nadi

In Information Systems

  1. Baptiste Rozière
  2. Baishakhi Ray
  3. Georgios Gousios
  4. Daya Guo
  5. Nan Duan
  6. Ge Li
  7. Guillaume Lample
  8. Prem Devanbu

In Natural Language Processing

  1. Baptiste Rozière
  2. Nan Duan
  3. Ge Li
  4. Baishakhi Ray
  5. Zhi Jin
  6. Xinyun Chen
  7. Dawn Song
  8. Prem Devanbu

In Code Generation & Program Synthesis

  1. Baptiste Rozière
  2. Guillaume Lample
  3. Ge Li
  4. Zhi Jin
  5. Marc Szafraniec
  6. Wasi Uddin Ahmad
  7. Marie-Anne Lachaux
  8. Baishakhi Ray

In Signal Processing

  1. Baishakhi Ray
  2. Saikat Chakraborty
  3. Ge Li
  4. Rafael-Michael Karampatsis
  5. Zhi Jin
  6. Baptiste Rozière
  7. Guillaume Lample
  8. Marie-Anne Lachaux

Citations in the corpus