paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Neural Model for Generating Natural Language Summaries of Program Subroutines

生成程序子程序自然语言摘要的神经模型
ICSE 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)2019匹配度 2/10 · 该论文属于代码摘要生成(code summarization),虽然结合了 AST 与神经模型,但与用户核心关注的静态分析、Agentic 程序、LLM/Agent 改进静态分析、浮点程序分析或贝叶斯程序分析均无直接关系,且方法不建立在当前强 LLM/Agent 之上。引用 338 inbox
Alexander LeClair, Siyuan Jiang, Collin McMillan
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出将代码词与 AST 结构分开编码的神经模型,在缺少内部文档时仍能生成连贯的程序子程序摘要。

源代码摘要是为代码行为生成自然语言描述的任务,可用于自动文档生成、程序理解和软件维护。传统方法依赖人工模板和启发式;近期神经机器翻译方法虽占主导,但大多依赖良好的内部文档和清晰的标识符,否则摘要质量下降。本文提出一种神经模型,将代码中的词与来自 AST 的代码结构结合,并把每种数据源作为独立输入处理,使模型能在不受代码文本干扰的情况下学习代码结构。作者构建了包含 210 万 Java 方法的数据集,实验表明该模型优于两个软件工程基线和一个自然语言处理基线,并且在完全没有内部文档的情况下也常能生成连贯摘要。

问题
现有源代码摘要技术,尤其是神经机器翻译方法,高度依赖良好的内部文档和清晰标识符,在缺少文档时难以生成高质量摘要。
方法
提出神经模型,将代码词与 AST 结构作为独立输入分别处理,从而解耦代码结构与代码文本,学习独立于文本的结构信息。
评估
在自建的 210 万 Java 方法数据集上,与两个软件工程基线和一个人自然语言处理基线对比,取得改进,并验证了零内部文档场景下的摘要生成效果。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-1902-01954,
  title = {A Neural Model for Generating Natural Language Summaries of Program Subroutines},
  author = {Alexander LeClair and Siyuan Jiang and Collin McMillan},
  booktitle = {ICSE},
  year = {2019},
  doi = {10.1109/icse.2019.00087}
}