arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.14731cs.SEcs.AI
收藏

用于源代码摘要的蒸馏GPT

Distilled GPT for Source Code Summarization

University of Notre Dame(圣母大学)

Chia-Yi Su, Collin McMillan

AI总结:

本文提出用GPT-3.5样本输出蒸馏训练一个3.5亿参数的开源模型,用于源代码摘要生成,可在单个16GB GPU上运行并模仿GPT-3.5的性能。

摘要:

代码摘要是源代码的简短自然语言描述。摘要通常只有一句话,却构成了开发者文档的骨干。像“将所有可见多边形更改为蓝色”这样的简短描述,可以让程序员无需阅读代码本身就能对代码功能有一个高层次的了解。近年来,基于大型语言模型(如ChatGPT)的产品已展现出自动编写这些描述的强大能力。然而,要使用这些工具,程序员必须将代码发送给不受信任的第三方进行处理(例如,通过API调用)。这种失去代码控制权的情况对许多组织来说是不可接受的。在本文中,我们提出了一种替代方案:我们使用GPT-3.5生成的样本输出,通过与知识蒸馏相关的过程来训练一个开源模型。我们的模型足够小(3.5亿参数),可以在单个16GB GPU上运行,但我们在评估中表明,它足够大,能够在此任务上模仿GPT-3.5。

英文摘要:

A code summary is a brief natural language description of source code. Summaries are usually only a single sentence long, and yet form the backbone of developer documentation. A short descriptions such as "changes all visible polygons to the color blue" can give a programmer a high-level idea of what code does without the effort of reading the code itself. Recently, products based on Large Language Models such as ChatGPT have demonstrated a strong ability to write these descriptions automatically. However, to use these tools, programmers must send their code to untrusted third parties for processing (e.g., via an API call). This loss of custody is not acceptable to many organizations. In this paper, we present an alternative: we train an open source model using sample output generated by GPT-3.5 in a process related to knowledge distillation. Our model is small enough (350m parameters) to be run on a single 16gb GPU, yet we show in our evaluation that it is large enough to mimic GPT-3.5 on this task.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑