Skip to main content
QUICK REVIEW

[論文レビュー] Vulnerability Detection with Code Language Models: How Far Are We?

Yangruibo Ding, Yanjun Fu|arXiv (Cornell University)|Mar 27, 2024
Network Security and Intrusion Detection被引用数 13
ひとこと要約

この論文はコード言語モデルを脆弱性検出の脆弱性を監査し、既存ベンチマークのデータ品質と評価の欠陥を明らかにし、厳密なラベリングとデデュプリケーションを備えたPrimeVulを導入し、現実的な設定下で現行モデルが低性能であることを示す。

ABSTRACT

In the context of the rising interest in code language models (code LMs) and vulnerability detection, we study the effectiveness of code LMs for detecting vulnerabilities. Our analysis reveals significant shortcomings in existing vulnerability datasets, including poor data quality, low label accuracy, and high duplication rates, leading to unreliable model performance in realistic vulnerability detection scenarios. Additionally, the evaluation methods used with these datasets are not representative of real-world vulnerability detection. To address these challenges, we introduce PrimeVul, a new dataset for training and evaluating code LMs for vulnerability detection. PrimeVul incorporates a novel set of data labeling techniques that achieve comparable label accuracy to human-verified benchmarks while significantly expanding the dataset. It also implements a rigorous data de-duplication and chronological data splitting strategy to mitigate data leakage issues, alongside introducing more realistic evaluation metrics and settings. This comprehensive approach aims to provide a more accurate assessment of code LMs' performance in real-world conditions. Evaluating code LMs on PrimeVul reveals that existing benchmarks significantly overestimate the performance of these models. For instance, a state-of-the-art 7B model scored 68.26% F1 on BigVul but only 3.09% F1 on PrimeVul. Attempts to improve performance through advanced training techniques and larger models like GPT-3.5 and GPT-4 were unsuccessful, with results akin to random guessing in the most stringent settings. These findings underscore the considerable gap between current capabilities and the practical requirements for deploying code LMs in security roles, highlighting the need for more innovative research in this domain.

研究の動機と目的

  • 既存の脆弱性検出データセットとベンチマークの欠点を分析する。
  • 高精度ラベリングとデデュプリケーションを備えたPrimeVulを提案し、データ漏洩を減らす。
  • VD-Sと対ペア機能評価を含む現実的な評価ガイドラインを導入する。
  • PrimeVul上でさまざまなオープンソースコードLMを経験的に評価し、現実的な性能ベースラインを確立する。

提案手法

  • 既存のvdベンチマークにおけるデータ収集、ラベリングの精度、重複を批判的に分析する。
  • PrimeVulを2つのラベリング手法(PrimeVul - OneFunc と PrimeVul - NVDCheck)と徹底的なデデュプリケーションを用いて構築する。
  • 漏洩を減らしVD-Sと対ペア機能評価を導入するために時系列のトレーニング/検証/テスト分割を適用する。
  • 複数のオープンソースコードLMをファインチューニングしてPrimeVul上で現実的な設定の下で評価する。
  • 精度、F1、VD-S、対ペア結果を含む指標を報告し、実用的な有用性を評価する。
Figure 1: The template for the two-shot prompt.
Figure 1: The template for the two-shot prompt.

実験結果

リサーチクエスチョン

  • RQ1RQ1: オープンソースのコードLMはPrimeVulでどのように性能を示すか。
  • RQ2RQ2: 高度なトレーニング技術は脆弱性検出性能を改善できるか。
  • RQ3RQ3: より大きな言語モデル(LLMs)は脆弱性検出性能を向上させるか。

主な発見

モデル訓練テスト精度F1VD-SP-CP-VP-BP-R
CT5BVBV95.6764.9377.3024.9850.9022.791.33
PVPVPV97.005.8295.970.183.0196.100.71
PVPVPV96.6719.789.931.0612.9484.751.24
CBBVBV95.5762.8881.7722.6048.3427.831.23
PVBVBV97.044.4995.540.351.9596.990.71
PVPVPV96.8720.8688.781.7711.3586.170.71
UCBVBV96.4665.4662.3039.6023.7433.243.42
PVBVBV97.271.9495.110.350.3598.760.53
PVPVPV96.8621.4389.211.6012.0685.111.24
SC2BVBV96.2068.2669.1435.2341.9820.612.18
PVBVBV97.093.0996.830.890.8997.700.53
PVPVPV97.0218.0589.642.308.1684.221.95
CG2.5BVBV96.5767.3061.7340.8426.0229.633.51
PVBVBV97.231.9195.681.240.0098.760.00
PVPVPV96.6519.6191.513.0110.8284.221.95
  • 既存のベンチマークは現実的な設定でのコードLMの脆弱性検出性能を過大評価している。
  • PrimeVulには6,968件の脆弱と228,800件の非脆弱関数、140のCWEsを含み、手動ベンチマークと同等の高いラベリング精度を持つ。
  • コードLMはPrimeVulで評価すると大きな性能ギャップを示す(例:BigVulでF1が68.26%のモデルがPrimeVulでF1が3.09%に低下)。
  • 高度なトレーニング技術はわずかな利益しか生まれず、GPT-3.5やGPT-4の結果は信頼性の高い改善には至らず、厳格な設定ではランダム推測に近づくことがある。
  • 新しい評価指標(VD-S)と対ペア機能評価は、従来のAccuracy/F1指標では捉えられない弱点を明らかにする。
  • 時系列データ分割は漏洩を緩和し、現実世界のモデル展開の制約をよりよく反映する。
Figure 2: The template for the chain-of-thought prompt
Figure 2: The template for the chain-of-thought prompt

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

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

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

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