Summarizing Source Code using a Neural Attention Model

By Srini Iyer, Ioannis Konstas, Alvin Cheung, Luke S. Zettlemoyer. 2016

787 citations recorded by the source corpus.

High quality source code is often paired with high level summaries of the computation it performs, for example in code documentation or in descriptions posted in online forums. Such summaries are extremely useful for applications such as code search but are expensive to manually author, hence only done for a small fraction of all code that is produced. In this paper, we present the first completely datadriven approach for generating high level summaries of source code. Our model, CODE-NN , uses Long Short Term Memory (LSTM) networks with attention to produce sentences that describe C# code snippets and SQL queries. CODE-NN is trained on a new corpus that is automatically collected from StackOverflow, which we release. Experiments demonstrate strong performance on two tasks: (1) code summarization, where we establish the first end-to-end learning results and outperform strong baselines, and (2) code retrieval, where our learned model improves the state of the art on a recently introduced C# benchmark by a large margin.

Subfields: Artificial Intelligence, Information Systems, Natural Language Processing

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

  1. Mohit Bansal
  2. Luke S. Zettlemoyer
  3. Graham Neubig
  4. Jianfeng Gao
  5. Percy Liang
  6. Caiming Xiong
  7. Yejin Choi
  8. Hannaneh Hajishirzi

In Information Systems

  1. Miltiadis Allamanis
  2. Prem Devanbu
  3. Charles Sutton
  4. Uri Alon
  5. Baishakhi Ray
  6. Eran Yahav
  7. Ge Li
  8. Toufique Ahmed

In Natural Language Processing

  1. Graham Neubig
  2. Mohit Bansal
  3. Luke S. Zettlemoyer
  4. Percy Liang
  5. Caiming Xiong
  6. Richard Socher
  7. Jianfeng Gao
  8. Yejin Choi

Citations in the corpus