饮食代码是健康的:简化预训练代码模型的程序
Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Code
摘要:
预训练的代码表示模型(如CodeBERT)在各种软件工程任务中表现出卓越的性能,但它们通常具有很高的复杂性,与输入序列的长度呈二次方关系。我们对CodeBERT注意力的实证分析表明,CodeBERT更关注某些类型的标记和语句,如关键字和数据相关语句。基于这些发现,我们提出了DietCode,它旨在轻量级地利用大型预训练模型来编写源代码。DietCode通过三种策略简化了CodeBERT的输入程序,即单词丢弃,频率过滤和基于注意力的策略,该策略选择在预训练期间接收最多注意力权重的语句和令牌。因此,它提供了一个显着减少的计算成本,而不妨碍模型的性能。在两个下游任务上的实验结果表明,DietCodeBERT提供了与CodeBERT相当的结果,在微调和测试方面的计算成本降低了40%。
英文摘要:
Pre-trained code representation models such as CodeBERT have demonstrated superior performance in a variety of software engineering tasks, yet they are often heavy in complexity, quadratically with the length of the input sequence. Our empirical analysis of CodeBERT's attention reveals that CodeBERT pays more attention to certain types of tokens and statements such as keywords and data-relevant statements. Based on these findings, we propose DietCode, which aims at lightweight leverage of large pre-trained models for source code. DietCode simplifies the input program of CodeBERT with three strategies, namely, word dropout, frequency filtering, and an attention-based strategy which selects statements and tokens that receive the most attention weights during pre-training. Hence, it gives a substantial reduction in the computational cost without hampering the model performance. Experimental results on two downstream tasks show that DietCodeBERT provides comparable results to CodeBERT with 40% less computational cost in fine-tuning and testing.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。