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

EarlyBIRD 捕获 Bug:关于利用编码器模型的早期层以实现更高效代码分类的研究

The EarlyBIRD Catches the Bug: On Exploiting Early Layers of Encoder Models for More Efficient Code Classification

Simula Research Laboratory(西穆拉研究实验室);BI Norwegian Business School(BI挪威商学院)

Anastasiia Grishina, Max Hort, Leon Moonen

AI总结:

本文提出 EarlyBIRD 方法,利用预训练 transformer 模型早期层构建代码复合表示,在四个数据集上评估发现其能提升缺陷检测和多类分类性能,且在 Devign 上仅用 CodeBERT 3 层即获 +2 准确率提升和 3.3 倍微调加速。

摘要:

现代自然语言处理(NLP)技术的应用已被证明对漏洞检测和类型推断等软件工程任务大有裨益。然而,训练深度 NLP 模型需要大量的计算资源。本文探索了旨在实现这些模型中资源与可用信息最佳利用的技术。我们提出了一种通用方法 EarlyBIRD,用于从预训练 transformer 模型的早期层构建代码的复合表示。我们通过比较 12 种创建复合表示的策略与仅使用最后一个编码器层的标准做法,在 CodeBERT 模型上实证研究了该方法的可行性。我们在四个数据集上的评估表明,几种早期层组合在缺陷检测上取得了更好的性能,且一些组合改善了多类分类。具体而言,我们在 Devign 上获得了 +2 的检测准确率平均提升,仅使用了 CodeBERT 12 层中的 3 层,并实现了 3.3 倍的微调加速。这些发现表明,早期层可用于在相同资源下获得更好的结果,以及在微调和推理期间减少资源使用。

英文摘要:

The use of modern Natural Language Processing (NLP) techniques has shown to be beneficial for software engineering tasks, such as vulnerability detection and type inference. However, training deep NLP models requires significant computational resources. This paper explores techniques that aim at achieving the best usage of resources and available information in these models. We propose a generic approach, EarlyBIRD, to build composite representations of code from the early layers of a pre-trained transformer model. We empirically investigate the viability of this approach on the CodeBERT model by comparing the performance of 12 strategies for creating composite representations with the standard practice of only using the last encoder layer. Our evaluation on four datasets shows that several early layer combinations yield better performance on defect detection, and some combinations improve multi-class classification. More specifically, we obtain a +2 average improvement of detection accuracy on Devign with only 3 out of 12 layers of CodeBERT and a 3.3x speed-up of fine-tuning. These findings show that early layers can be used to obtain better results using the same resources, as well as to reduce resource usage during fine-tuning and inference.

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

↑