双向Transformer与word2vec:发现提升编译代码中的漏洞
Bi-Directional Transformers vs. word2vec: Discovering Vulnerabilities in Lifted Compiled Code
AI总结:
本研究比较word2vec与双向Transformer(BERT、RoBERTa)嵌入,用LSTM在LLVM IR上检测编译二进制漏洞,发现word2vec Skip-Gram以92%准确率最优。
摘要:
由于丢失了高级代码结构以及架构依赖、编译器和优化选项等因素,检测编译二进制文件中的漏洞具有挑战性。为解决这些障碍,本研究探索使用自然语言处理(NLP)嵌入技术,包括word2vec、BERT和RoBERTa,从中间表示(LLVM IR)代码中学习语义。使用来自Juliet数据集的大约48k个LLVM函数创建的编码器嵌入,训练了长短期记忆(LSTM)神经网络。本研究开创性地比较了word2vec模型与使用LLVM代码构建的多个双向Transformer(BERT、RoBERTa)嵌入,以训练神经网络检测编译二进制文件中的漏洞。Word2vec Skip-Gram模型在检测漏洞方面达到了92%的验证准确率,优于word2vec连续词袋(CBOW)、BERT和RoBERTa。这表明,当使用有限数量(例如48K)的数据样本训练基于双向Transformer的模型时,复杂的上下文嵌入可能不会为此任务提供优于简单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 transformers (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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。