一句话:证明用少量项目特定样本训练 GPT Codex 即可在代码摘要任务上显著超越当前最优模型。
大型语言模型(如 GPT-3、Codex)在多项自然语言任务上达到最优性能,在代码任务上也展现出巨大潜力。其突出能力之一是少样本与零样本学习:仅需极少量示例即可学会执行任务。这一特性在软件工程中尤为契合,因为标识符命名、API、术语与编码模式等现象高度项目特定。然而项目特定数据往往十分有限,尤其在项目早期,因此 LLM 的少样本学习能力可能非常关键。本文研究使用大型 GPT Codex 模型进行少样本训练,并发现证据表明:利用项目特定训练数据,可以显著超越当前最先进的代码摘要模型。
Very large language models (LLMs), such as GPT-3 and Codex have achieved state-of-the-art performance on several natural-language tasks, and show great promise also for code. A particularly exciting aspect of LLMs is their knack for few-shot and zero-shot learning: they can learn to perform a task with very few examples. Few-shotting has particular synergies in software engineering, where there are a lot of phenomena (identifier names, APIs, terminology, coding patterns) that are known to be highly project-specific. However, project-specific data can be quite limited, especially early in the history of a project; thus the few-shot learning capacity of LLMs might be very relevant. In this paper, we investigate the use few-shot training with the very large GPT (Generative Pre-trained Transformer) Codex model, and find evidence suggesting that one can significantly surpass state-of-the-art models for code-summarization, leveraging project-specific training.