Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyond

要約

タイトル:事前学習されたコードモデルの効率的な微調整に向けて:実験的研究とその先について

要約:
– プレトレーニングされたCodeBERTなどのコードモデルを微調整することで、多くのソフトウェアテストや解析の課題で成功が実現されている。
– しかしながら、事前学習されたパラメーターの微調整には、大きな計算コストがかかる。
– 本論文では、事前学習された表現とそのエンコードされたコード知識が微調整中にどのように変化するかを調査することで、より効率的な微調整方法を提案する。
– 実験的研究から、(1) コードのレキシカル、構文、構造的特性が下部、中間、上部のレイヤーにエンコードされ、意味プロパティは全モデルにまたがることが明らかとなった。(2) 微調整のプロセスは、ほとんどのコード特性を保持することが判明した。具体的には、下部と中間のレイヤーで捉えられた基本的なコード特性が微調整中も保持されていることが観察された。(3) これらの発見に基づいて、Tellyという方法を提案し、レイヤーの凍結を利用して事前学習されたコードモデルを効率的に微調整する。
– 5つのさまざまな下流タスクに関する包括的な実験結果は、訓練パラメータとそれに相応する時間コストが大幅に削減され、パフォーマンスが同等またはより良くなることを示している。ソースコード、データセット、およびオンライン追加資料を含む複製パッケージは、\url{https://github.com/DeepSoftwareAnalytics/Telly}で利用可能。

要約(オリジナル)

Recently, fine-tuning pre-trained code models such as CodeBERT on downstream tasks has achieved great success in many software testing and analysis tasks. While effective and prevalent, fine-tuning the pre-trained parameters incurs a large computational cost. In this paper, we conduct an extensive experimental study to explore what happens to layer-wise pre-trained representations and their encoded code knowledge during fine-tuning. We then propose efficient alternatives to fine-tune the large pre-trained code model based on the above findings. Our experimental study shows that (1) lexical, syntactic and structural properties of source code are encoded in the lower, intermediate, and higher layers, respectively, while the semantic property spans across the entire model. (2) The process of fine-tuning preserves most of the code properties. Specifically, the basic code properties captured by lower and intermediate layers are still preserved during fine-tuning. Furthermore, we find that only the representations of the top two layers change most during fine-tuning for various downstream tasks. (3) Based on the above findings, we propose Telly to efficiently fine-tune pre-trained code models via layer freezing. The extensive experimental results on five various downstream tasks demonstrate that training parameters and the corresponding time cost are greatly reduced, while performances are similar or better. Replication package including source code, datasets, and online Appendix is available at: \url{https://github.com/DeepSoftwareAnalytics/Telly}.

arxiv情報

著者 Ensheng Shi,Yanlin Wang,Hongyu Zhang,Lun Du,Shi Han,Dongmei Zhang,Hongbin Sun
発行日 2023-04-11 13:34:13+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, OpenAI

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