Bi-Directional Transformers vs. word2vec: Discovering Vulnerabilities in Lifted Compiled Code

要約

コンパイルされたバイナリ内の脆弱性を検出することは、高レベルのコード構造が失われることや、アーキテクチャの依存関係、コンパイラ、最適化オプションなどのその他の要因により困難です。
これらの障害に対処するために、この研究では、word2vec、BERT、および RoBERTa による自然言語処理 (NLP) 埋め込み技術を使用して、中間表現 (LLVM IR) コードからセマンティクスを学習する脆弱性検出を調査します。
長短期記憶 (LSTM) ニューラル ネットワークは、Juliet データセットからの約 48,000 個の LLVM 関数を使用して作成されたエンコーダーからの埋め込みでトレーニングされました。
この研究は、コンパイルされたバイナリの脆弱性を検出するためにニューラル ネットワークをトレーニングするために LLVM コードを使用して構築された複数の双方向トランスフォーマー (BERT、RoBERTa) 埋め込みと word2vec モデルの比較において先駆的なものです。
word2vec Skip-Gram モデルは、脆弱性の検出において 92% の検証精度を達成し、word2vec Continuous Bag of Words (CBOW)、BERT、および RoBERTa を上回りました。
これは、限られた数 (例: 48K) のデータ サンプルを使用して双方向トランスフォーマー ベースのモデルをトレーニングする場合、複雑なコンテキストによる埋め込みがこのタスクの単純な word2vec モデルよりも利点を提供できない可能性があることを示唆しています。
比較結果は、コンパイラに依存しないセマンティック コード表現を学習するための最適な埋め込みを選択して、コンパイルされたバイナリの脆弱性の機械学習検出を促進するための新しい洞察を提供します。

要約(オリジナル)

Detecting vulnerabilities within compiled binaries is challenging due to lost high-level code structures and other factors such as architectural dependencies, compilers, and optimization options. To address these obstacles, this research explores vulnerability detection using natural language processing (NLP) embedding techniques with word2vec, BERT, and RoBERTa to learn semantics from intermediate representation (LLVM IR) code. Long short-term memory (LSTM) neural networks were trained on embeddings from encoders created using approximately 48k LLVM functions from the Juliet dataset. This study is pioneering in its comparison of word2vec models with multiple bidirectional transformer (BERT, RoBERTa) embeddings built using LLVM code to train neural networks to detect vulnerabilities in compiled binaries. word2vec Skip-Gram models achieved 92% validation accuracy in detecting vulnerabilities, outperforming word2vec Continuous Bag of Words (CBOW), BERT, and RoBERTa. This suggests that complex contextual embeddings may not provide advantages over simpler word2vec models for this task when a limited number (e.g. 48K) of data samples are used to train the bidirectional transformer-based models. The comparative results provide novel insights into selecting optimal embeddings for learning compiler-independent semantic code representations to advance machine learning detection of vulnerabilities in compiled binaries.

arxiv情報

著者 Gary A. McCully,John D. Hastings,Shengjie Xu,Adam Fortier
発行日 2024-09-09 17:35:58+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.CR, cs.LG, cs.SE, I.2.6 パーマリンク