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