Ensemble Models for Neural Source Code Summarization of Subroutines

Ensemble Models for Neural Source Code Summarization of Subroutines
复制标题

DOI:
10.26226/morressier.613b5418842293c031b5b62e
复制
发表时间:
2021-07
期刊:
2021 IEEE International Conference on Software Maintenance and Evolution (ICSME)
影响因子:
--
通讯作者:
Alexander LeClair;Aakash Bansal;Collin McMillan
Alexander LeClair;Aakash Bansal;Collin McMillan
中科院分区:
其他
文献类型:
--
作者:
Alexander LeClair;Aakash Bansal;Collin McMillan

文献摘要

相似文献

子例程的源代码摘要是对该子例程的简要描述。摘要是程序员使用的大多数文档的基础,例如 JavaDocs 中的方法摘要。源代码摘要就是编写这些摘要的任务。目前,大多数最先进的代码摘要方法都是基于神经网络的解决方案,类似于 seq2seq、graph2seq 和其他编码器-解码器架构。编码器的输入是源代码,而解码器帮助预测自然语言摘要。虽然这些模型在结构上往往相似,但越来越多的证据表明,不同的模型对预测质量做出了不同的贡献——模型性能的差异是正交和互补的,而不是在整个数据集上统一的。在本文中,我们探索了不同神经代码摘要方法的正交性质,并提出了集成模型来利用这种正交性以获得更好的整体性能。我们证明了简单的集成策略可将性能提升高达 14.8%,并对此提升提供了解释。这项工作的要点是,大多数神经代码摘要技术中推理过程的相对较小的改变会导致预测质量的大幅提高。
A source code summary of a subroutine is a brief description of that subroutine. Summaries underpin a majority of documentation consumed by programmers, such as the method summaries in JavaDocs. Source code summarization is the task of writing these summaries. At present, most state-of-the-art approaches for code summarization are neural network-based solutions akin to seq2seq, graph2seq, and other encoder-decoder architectures. The input to the encoder is source code, while the decoder helps predict the natural language summary. While these models tend to be similar in structure, evidence is emerging that different models make different contributions to prediction quality - differences in model performance are orthogonal and complementary rather than uniform over the entire dataset. In this paper, we explore the orthogonal nature of different neural code summarization approaches and propose ensemble models to exploit this orthogonality for better overall performance. We demonstrate that a simple ensemble strategy boosts performance by up to 14.8%, and provide an explanation for this boost. The takeaway from this work is that a relatively small change to the inference procedure in most neural code summarization techniques leads to outsized improvements in prediction quality.