Does Your Neural Code Completion Model Use My Code? A Membership Inference Approach

要約

近年、コード補完を自動化するための深層学習ベースのモデルの開発において大きな進歩が見られました。
GitHub のソース コードを使用することは、コード補完のための深層学習ベースのモデルをトレーニングするための一般的な方法ですが、著作権侵害などの法的および倫理的な問題を引き起こす可能性があります。
このペーパーでは、次の質問に答えることで、現在のニューラル コード補完モデルの法的および倫理的問題を調査します: 私のコードはニューラル コード補完モデルのトレーニングに使用されていますか?
この目的を達成するために、もともと分類タスク用に作成されたメンバーシップ推論アプローチ (CodeMI と呼ばれる) を、コード補完というより困難なタスクに合わせて調整します。
特に、ターゲット コード補完モデルは不透明なブラック ボックスとして動作し、そのトレーニング データやパラメーターへのアクセスが妨げられるため、その動作を模倣するために複数のシャドウ モデルをトレーニングすることを選択します。
これらのシャドウ モデルから取得された事後結果は、その後、メンバーシップ分類器をトレーニングするために使用されます。
その後、メンバーシップ分類子を効果的に使用して、ターゲット コード補完モデルの出力に基づいて、特定のコード サンプルのメンバーシップ ステータスを推定できます。
私たちは、さまざまなニューラル コード補完モデル (つまり、LSTM ベース、CodeGPT、CodeGen、StarCoder) にわたって、この適応されたアプローチの有効性を包括的に評価します。
実験結果から、LSTM ベースのモデルと CodeGPT モデルにはメンバーシップ漏洩の問題があることが明らかになりました。この問題は、それぞれ 0.842 と 0.730 の精度で提案したメンバーシップ推論アプローチによって簡単に検出できます。
興味深いことに、私たちの実験では、CodeGen や StarCoder などの現在の大規模なコード言語モデルのデータ メンバーシップの検出が難しく、さらなる改善の余地が残っていることも示しています。
最後に、モデルの暗記の観点からも調査結果を説明します。

要約(オリジナル)

Recent years have witnessed significant progress in developing deep learning-based models for automated code completion. Although using source code in GitHub has been a common practice for training deep-learning-based models for code completion, it may induce some legal and ethical issues such as copyright infringement. In this paper, we investigate the legal and ethical issues of current neural code completion models by answering the following question: Is my code used to train your neural code completion model? To this end, we tailor a membership inference approach (termed CodeMI) that was originally crafted for classification tasks to a more challenging task of code completion. In particular, since the target code completion models perform as opaque black boxes, preventing access to their training data and parameters, we opt to train multiple shadow models to mimic their behavior. The acquired posteriors from these shadow models are subsequently employed to train a membership classifier. Subsequently, the membership classifier can be effectively employed to deduce the membership status of a given code sample based on the output of a target code completion model. We comprehensively evaluate the effectiveness of this adapted approach across a diverse array of neural code completion models, (i.e., LSTM-based, CodeGPT, CodeGen, and StarCoder). Experimental results reveal that the LSTM-based and CodeGPT models suffer the membership leakage issue, which can be easily detected by our proposed membership inference approach with an accuracy of 0.842, and 0.730, respectively. Interestingly, our experiments also show that the data membership of current large language models of code, e.g., CodeGen and StarCoder, is difficult to detect, leaving amper space for further improvement. Finally, we also try to explain the findings from the perspective of model memorization.

arxiv情報

著者 Yao Wan,Guanghua Wan,Shijie Zhang,Hongyu Zhang,Yulei Sui,Pan Zhou,Hai Jin,Lichao Sun
発行日 2024-04-22 15:54:53+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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