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

要約

最新の自然言語処理 (NLP) 技術の使用は、脆弱性の検出や型推論などのソフトウェア エンジニアリング タスクに有益であることがわかっています。
ただし、深い NLP モデルをトレーニングするには、大量の計算リソースが必要です。
このペーパーでは、これらのモデルでリソースと利用可能な情報を最大限に活用することを目的とした手法について説明します。
私たちは、事前トレーニングされたトランスフォーマー モデルの初期層からコードの複合表現を構築するための汎用アプローチ、EarlyBIRD を提案します。
私たちは、複合表現を作成するための 12 の戦略のパフォーマンスを、最後のエンコーダー層のみを使用する標準的な方法と比較することにより、CodeBERT モデルでのこのアプローチの実行可能性を経験的に調査します。
4 つのデータセットに対する評価では、いくつかの初期層の組み合わせにより欠陥検出のパフォーマンスが向上し、いくつかの組み合わせにより多クラス分類が向上することがわかりました。
具体的には、CodeBERT の 12 層のうち 3 層だけを使用した Devign では、検出精度が平均で +2 向上し、微調整の速度が 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.

arxiv情報

著者 Anastasiia Grishina,Max Hort,Leon Moonen
発行日 2023-09-11 17:56:10+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.LG, cs.SE パーマリンク