Skip to main content
QUICK REVIEW

[論文レビュー] Evaluation of ChatGPT Model for Vulnerability Detection

Anton Cheshkov, P. Zadorozhny|arXiv (Cornell University)|Apr 12, 2023
Software Engineering Research被引用数 24
ひとこと要約

この論文は、Javaコードの脆弱性検出においてChatGPTとGPT-3を実証的に評価し、実世界の CWE に焦点を当てたデータセットに対する二値分類またはマルチラベル分類でダミーのベースラインを上回らないことを示している。

ABSTRACT

In this technical report, we evaluated the performance of the ChatGPT and GPT-3 models for the task of vulnerability detection in code. Our evaluation was conducted on our real-world dataset, using binary and multi-label classification tasks on CWE vulnerabilities. We decided to evaluate the model because it has shown good performance on other code-based tasks, such as solving programming challenges and understanding code at a high level. However, we found that the ChatGPT model performed no better than a dummy classifier for both binary and multi-label classification tasks for code vulnerability detection.

研究の動機と目的

  • 大規模言語モデル(ChatGPTとGPT-3)がJavaコードの脆弱性を検出できるかを評価する。
  • CWEタイプに焦点を当てた脆弱性あり・修正済みJava関数の実世界データセットを作成する。
  • ベースラインと比較し、プロンプトとプロンプトのバリアントを分析する。

提案手法

  • 公開GitHubリポジトリから既知の脆弱性と修正を持つJava関数のデータセットを構築する。
  • 二値分類(脆弱性あり vs. 修正済み)とマルチラベル(上位のCWEタイプ)分類のサブセットを準備する。
  • プロンプトを用いてYes/Noの脆弱性評価とCWEタイプラベルを引き出すようOpenAI API経由でGPT-3とChatGPTをクエリする。
  • 二値分類の正確度、適合率、再現率、F1、AUCを評価し、マルチラベルタスクでは各CWEタイプの指標を評価する。
  • ベースラインのダミー分類器と比較し、プロンプトのバリエーションと温度設定(0に設定)を分析する。
Figure 1: Function size distribution in the dataset.
Figure 1: Function size distribution in the dataset.

実験結果

リサーチクエスチョン

  • RQ1Can ChatGPT and GPT-3 reliably detect vulnerabilities in Java code?
  • RQ2Do these models outperform a baseline dummy classifier on binary vulnerability detection?
  • RQ3How do the models perform on multi-label CWE-type classification for the top frequent vulnerabilities?
  • RQ4What is the impact of prompt design on vulnerability detection performance?
  • RQ5Do chain-of-thought prompting or larger models improve results in this task?],
  • RQ6key_findings':['Binary classification results show limited performance; text-davinci-003 achieves precision 0.50, recall 0.99, F1 0.67, AUC 0.51; gpt-3.5-turbo achieves precision 0.51, recall 0.80, F1 0.62, AUC 0.51; baseline remains at 0.50 across metrics.
  • RQ7Overall multi-label classification on the top five CWE types yields around 38% accuracy for GPT-3 / ChatGPT variants, with macro and weighted averages typically below 0.3 for many CWE types.
  • RQ8The negative (non-vulnerable) class dominates the samples, and models tend to over-predict positives, inflating false positives.
  • RQ9When excluding negative examples, accuracy decreases, indicating the models struggle to correctly identify vulnerable functions without the context of non-vulnerable ones.
  • RQ10Prompts exploring multiple phrasings do not yield substantial performance gains, suggesting prompt variation did not meaningfully improve results.
  • RQ11An anomaly observed: ChatGPT predicted vulnerability types more accurately for fixed functions, suggesting dataset or training biases may influence labeling.

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

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

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

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