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

从小型本地数据集学习代码摘要

Learning code summarization from a small and local dataset

University of California, Davis(加州大学戴维斯分校)

Toufique Ahmed, Premkumar Devanbu

摘要:

基础模型(例如,CodeBERT、GraphCodeBERT、CodeT5)对于许多软件工程任务都能很好地工作。这些模型使用数十亿个代码令牌进行预训练(使用自我监督),然后使用数十万个标记的示例进行微调,这些示例通常来自许多项目。然而,软件现象可能是非常特定于项目的。词汇和其他现象随着每个项目的变化而变化。因此,在特定项目数据上进行培训,并在同一项目上进行测试,是一个很有前途的想法。必须仔细评估这一假设,例如,在时间序列设置中,以防止训练测试泄漏。我们比较了几种模型和训练方法,包括同一项目训练,跨项目训练,训练一个专门设计为样本有效的模型(因此初步认为非常适合在有限样本的同一项目环境中学习)和最大化混合方法,首先在许多语言的许多项目上进行微调,然后在同一项目上进行训练。我们发现,在Java和Python的许多不同项目中,最大化的混合设置提供了一致的、实质性的收益。

英文摘要:

Foundation models (e.g., CodeBERT, GraphCodeBERT, CodeT5) work well for many software engineering tasks. These models are pre-trained (using self-supervision) with billions of code tokens, and then fine-tuned with hundreds of thousands of labeled examples, typically drawn from many projects. However, software phenomena can be very project-specific. Vocabulary, and other phenomena vary substantially with each project. Thus, training on project-specific data, and testing on the same project, is a promising idea. This hypothesis has to be evaluated carefully, e.g., in a time-series setting, to prevent training-test leakage. We compare several models and training approaches, including same-project training, cross-project training, training a model especially designed to be sample efficient (and thus prima facie well-suited for learning in a limited-sample same-project setting) and a maximalist hybrid approach, fine-tuning first on many projects in many languages and then training on the same-project. We find that the maximalist hybrid setting provides consistent, substantial gains over the state-of-the-art, on many different projects in both Java and Python.

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

↑