paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automatic Code Documentation Generation Using GPT-3

使用 GPT-3 的自动代码文档生成
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 2/10 · 该论文属于 LLM 用于代码生成/文档生成方向,既非静态分析/形式化验证,也不涉及浮点程序分析或贝叶斯程序分析,与画像中 PL↔AI 的核心交集(用 LLM 改进分析/验证,或分析 Agentic 程序)几乎无重合。且仅以旧模型 Codex 做 one-shot 评测、以 BLEU 刷分,缺少失效原因分析与工业落地讨论。引用 95 inbox
Junaed Younus Khan, Gias Uddin
crossref: 2026-09-12

AI 速览

一句话:用基于 GPT-3 的 Codex 自动生成代码文档,在六种编程语言上以 one-shot 设置超越已有方法。

代码文档是高效软件开发的重要产物,但人工撰写往往耗时耗力,因而自动化需求迫切。本文采用 Codex——一个在自然语言与编程语言上预训练的 GPT-3 模型——来自动生成代码文档。作者在六种编程语言上对该模型进行评估,发现即便只使用 one-shot 学习(仅提供一个训练示例)这类基础设置,Codex 也能超越现有技术,整体 BLEU 得分达到 20.6,相比此前最优方法提升 11.2%。这一结果表明 Codex 在自动代码文档生成任务上颇具潜力,值得开展更深入的后续研究,以支撑多样化的开发任务。

问题
人工撰写代码文档耗费大量人力、资源与时间,如何自动生成高质量代码文档是本文关注的问题。
方法
采用基于 GPT-3、在自然语言与编程语言上预训练的 Codex 模型进行代码文档生成,并使用 one-shot 等基础设置。
评估
在六种编程语言上以 BLEU 指标与已有技术对比,Codex 总体 BLEU 达 20.6,较此前最优方法提升 11.2%。
原文摘要(Abstract)

Source code documentation is an important artifact for efficient software development. Code documentation could greatly benefit from automation since manual documentation is often labouring, resource and time-intensive. In this paper, we employed Codex for automatic code documentation creation. Codex is a GPT-3 based model pre-trained on both natural and programming languages. We find that Codex outperforms existing techniques even with basic settings like one-shot learning (i.e., providing only one example for training). Codex achieves an overall BLEU score of 20.6 for six different programming languages (11.2% improvement over earlier state-of-the-art techniques). Thus, Codex shows promise and warrants in-depth future studies for automatic code documentation generation to support diverse development tasks.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot7189,
  title = {Automatic Code Documentation Generation Using GPT-3},
  author = {Junaed Younus Khan and Gias Uddin},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3559548}
}