A Neural Model for Generating Natural Language Summaries of Program Subroutines
By Alexander LeClair, Siyuan Jiang, Collin McMillan. 2019
335 citations recorded by the source corpus.
Source code summarization -- creating natural language descriptions of source code behavior -- is a rapidly-growing research topic with applications to automatic documentation generation, program comprehension, and software maintenance. Traditional techniques relied on heuristics and templates built manually by human experts. Recently, data-driven approaches based on neural machine translation have largely overtaken template-based systems. But nearly all of these techniques rely almost entirely on programs having good internal documentation; without clear identifier names, the models fail to create good summaries. In this paper, we present a neural model that combines words from code with code structure from an AST. Unlike previous approaches, our model processes each data source as a separate input, which allows the model to learn code structure independent of the text in code. This process helps our approach provide coherent summaries in many cases even when zero internal documentation is provided. We evaluate our technique with a dataset we created from 2.1m Java methods. We find improvement over two baseline techniques from SE literature and one from NLP literature.
Subfields: Artificial Intelligence, Information Systems, Software, Natural Language Processing, Code Generation & Program Synthesis
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
- Prem Devanbu
- Toufique Ahmed
- Wasi Uddin Ahmad
- Baishakhi Ray
- Saikat Chakraborty
- Hongyu Zhang
- Kai-Wei Chang
- Gabriele Bavota
In Information Systems
- Prem Devanbu
- Baishakhi Ray
- Michele Tufano
- Hongyu Zhang
- Saikat Chakraborty
- Gabriele Bavota
- Denys Poshyvanyk
- Koushik Sen
In Software
- Prem Devanbu
- Toufique Ahmed
- Baishakhi Ray
- Armando Solar-Lezama
- Gabriele Bavota
- Michele Tufano
- Hongyu Zhang
- Koushik Sen
In Natural Language Processing
- Prem Devanbu
- Toufique Ahmed
- Michele Tufano
- Hongyu Zhang
- Gabriele Bavota
- Baishakhi Ray
- Shi Han
- Lun Du
In Code Generation & Program Synthesis
- Prem Devanbu
- Toufique Ahmed
- Baishakhi Ray
- Koushik Sen
- Wasi Uddin Ahmad
- Hongyu Zhang
- Saikat Chakraborty
- Armando Solar-Lezama
Citations in the corpus
- LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code (2024, background): “…additionally studied other tasks and scenarios like type prediction (Mir et al., 2022; Wei et al., 2023a; Malik et al., 2019), code summarization (LeClair et al., 2019; Iyer et al., 2016; Barone and Sennrich, 2017; Hasan et al., 2021; Alon et al., 2018), code security (Liguori et al., 2022;…”
- CoCoGUM: Contextual Code Summarization with Multi-Relational GNN on UMLs (2020, methodology): “For the local context encoders, we follow the Ast-attendgru model of LeClair et al. [10].”
- Multilingual training for Software Engineering (2021, methodology): “Comment synthesis is now an active research area, including many projects such as CodeNN [30], DeepCom [26], Astattgru[40], CodeBERT [18], Rencos [74],SecNN [42],PLBART [1], CoTexT[54], ProphetNet-X [55], NCS [2], Code2seq[7], Re 2 Com [71], and many more [19, 24, 25, 27, 28, 38, 39, 41, 49, 50,…”
- A Transformer-based Approach for Source Code Summarization (2020, methodology): “Later, LeClair et al. (2019) used the SBT method and decoupled the code structure from the code tokens to learn better structure representation.”
- On Learning Meaningful Assert Statements for Unit Test Cases (2020, background): “such as bug-fixing [7, 12, 20, 36], code changes [35], code migration [21, 22], code summarization [18, 19, 39], pseudo-code generation”
- Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Tasks (2021, background): “Some examples include automatic bug fixing [1]–[4], learning generic code changes [5], code migration [6], [7], code summarization [8]–[11], pseudo-code generation [12], code deobfuscation [13], [14], injection of”
- Retrieval-based Neural Source Code Summarization (2020, methodology): “The abstract syntax tree structures are incorporated by [21, 34, 55].”
- Improved Code Summarization via a Graph Neural Network (2020, methodology): “nce, Washington, DC, USA, July 2017 (Conference’17), 12 pages. DOI: 10.1145/nnnnnnn.nnnnnnn 1 INTRODUCTION Source code summarization is the task of writing brief natural language descriptions of code [15, 19, 29, 37]. „ese descriptions Permission to make digital or hard copies of all or part of this”
- TranS^3: A Transformer-based Framework for Unifying Code Summarization and Code Search (2020, background): “In particular, on one hand, since the natural-language-based code comments can reect program semantics to strengthen the understanding of the programs [1], adopting them in code search can improve the matching process with natural language queries [6].”