Skip to main content
QUICK REVIEW

[論文レビュー] APPT: Boosting Automated Patch Correctness Prediction via Fine-tuning Pre-trained Models

Quanjun Zhang, Chunrong Fang|arXiv (Cornell University)|Jan 29, 2023
Machine Learning in Healthcare被引用数 5
ひとこと要約

APPTは、プログラム修復における自動パッチ正しさ予測のためのファインチューニング済み事前学習モデルアプローチを提案する。BERTをエンコーダーとして用い、LSTMと分類器を組み合わせることで一般化性能を向上させる。Defects4Jパッチでは79.7%の精度と83.2%の再現率を達成し、SOTAをそれぞれ4.3%と6.7%上回り、実世界のパッチでは5つの指標で99%以上を達成する。

ABSTRACT

Automated program repair (APR) aims to fix software bugs automatically without human debugging efforts and plays a crucial role in software development and maintenance. Despite promising, APR is still challenged by a long-standing overfitting problem (i.e., the generated patch is plausible but overfitting). Various techniques have thus been proposed to address the overfitting problem. Recently, researchers have employed BERT to extract code features, which are then used to train a classifier for patch correctness prediction. However, BERT is restricted to feature extraction for classifier training without benefiting from the training process, potentially generating sub-optimal vector representations for patched code snippets. In this paper, we propose APPT, a pre-trained model-based automated patch correctness assessment technique by both pre-training and fine-tuning. APPT adopts a pre-trained model as the encoder stack, followed by an LSTM stack and a deep learning classifier. More importantly, the pre-trained model is fine-tuned in conjunction with other components as a whole pipeline to fully adapt it specifically for reasoning about patch correctness. We conduct an extensive experiment on 1,183 Defects4J patches and the experimental results show that APPT achieves prediction accuracy of 79.7% and recall of 83.2%, outperforming CACHE by 4.3% and 6.7%. Our additional investigation on 49,694 real-world patches shows that APPT achieves the optimum performance compared with existing representation learning techniques. We further investigate the impact of each component and find that they all positively contribute to APPT, e.g., the fine-tuning process and the LSTM stack increase F1-score by 10.22% and 4.11%, respectively. We also prove that adopting advanced pre-trained models can further provide substantial advancement, highlighting the generalizability of APPT.

研究の動機と目的

  • 自動プログラム修復(APR)における過学習問題に対処する。具体的には、テストケースに合格するが未観測の環境では失敗するパッチの問題を解決する。
  • 静的および動的パッチ正しさ評価手法の限界を克服する。これらの手法は、低精度または高計算コストの問題を抱えている。
  • 事前学習モデルを活用し、パッチ正しさ予測のためのより良いコード表現を学習することで、手作業で設計された特徴量を超える一般化性能を向上させる。
  • 特徴抽出のみに使用するのではなく、エンドツーエンドのファインチューニングにより、事前学習モデルの有効性をパッチ正しさ予測に活用することを検討する。
  • 異なる事前学習モデル(BERT、CodeBERT、GraphCodeBERTなど)にわたるアプローチの汎用性を検証する。

提案手法

  • バグのあるコードと修正済みコードスニペットからの文脈表現を抽出するために、事前学習済みBERTモデルをエンコーダースタックとして使用する。
  • エンコーダーの後にLSTM層を統合し、コード変更とその文脈の間の順序的依存関係をモデル化する。
  • 二つの全結合層とソフトマックス活性化関数を備えたディープラーニング分類器に、LSTMの出力を入力し、パッチ正しさの二値分類を実行する。
  • エンコーダー、LSTM、分類器を含む全パイプラインをエンドツーエンドでファインチューニングし、パッチ正しさ推論に特化したモデルに適応させる。
  • 合成データ(Defects4J)と実世界データ(49,694パッチ)の両方でモデルを評価し、耐障害性とスケーラビリティを評価する。
  • 標準指標(精度、再現率、F1スコア、AUC)を用いて、APPTをCACHEや手作業特徴量手法と比較する。
Figure 1: Overview of APR
Figure 1: Overview of APR

実験結果

リサーチクエスチョン

  • RQ1特徴抽出のみに使用するのではなく、事前学習モデルをエンドツーエンドでファインチューニングすることで、パッチ正しさ予測の精度が向上するか?
  • RQ2LSTM層の統合が、コード変更内の依存関係を捉える能力にどのように影響するか?
  • RQ3APPTはCodeBERT や GraphCodeBERT などの異なる事前学習モデルに対しても汎用性を示すか?また、それらはBERTベースのAPPTを上回る性能を示すか?
  • RQ4APPTは既存の最先端技術と比較して、実世界のパッチに対してどのように性能を発揮するか?
  • RQ5各コンポonent(例:ファインチューニング、LSTM)が全体の性能向上にどの程度寄与しているか?

主な発見

  • 1,183個のDefects4Jパッチにおいて、APPTは79.7%の精度と83.2%の再現率を達成し、SOTA手法であるCACHEを精度で4.3ポイント、再現率で6.7ポイント上回った。
  • 49,694個の実世界パッチでは、APPTは5つの標準評価指標で99%以上を達成し、優れた一般化性能と耐障害性を示した。
  • ファインチューニングプロセスそのものがF1スコアを10.22%向上させ、パッチ正しさタスクへのモデル適応において極めて重要な役割を果たしていることが示された。
  • LSTMコンポーネントはF1スコアの向上に4.11%寄与しており、コード変更内の順序的依存関係をモデル化する価値があることが強調された。
  • BERTの代わりにGraphCodeBERTを使用した場合、精度が2.8%向上し、AUCが3.3%向上した。これは、高度な事前学習モデルの利点を裏付けるものである。
  • アブレーションスタディの結果、エンコーダー、LSTM、分類器のすべてのコンポーネントが性能向上に正の寄与をしていることが確認され、設計選択の妥当性が検証された。
Figure 2: Overview of APPT
Figure 2: Overview of APPT

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。