对比预训练嵌入与端到端学习,发现后者在二进制分析中更优。
On the Role of Pre-trained Embeddings in Binary Code Analysis
- 用120万函数数据集系统评估多种汇编嵌入方法
- 有足够标签数据时,无预训练的端到端模型表现最好
- 提出何时用嵌入、何时直接训练的实用建议
深度学习推动了二进制代码分析的进步。预训练的汇编代码嵌入已成为衡量代码相似性或函数识别等任务的标准方法,能从无标签代码中学习向量表示。然而,在二进制分析中,许多任务的标签信息并不稀缺——例如,函数边界、优化级别和参数类型可从编译器提供的调试信息中轻松获取。因此,预训练嵌入的主要动机在该领域并不完全适用。本文从批判视角探索预训练嵌入的作用。我们基于来自Debian发行版的120万函数语料库,系统评估了近期汇编代码嵌入在五个下游任务上的表现。结果发现:当有充足标注数据时,多种嵌入方法表现相近,先前研究报道的差异几乎不明显。令人惊讶的是,端到端学习(无需预训练)平均表现最优,这质疑了专用嵌入的必要性。通过改变标注数据量,我们最终得出嵌入带来优势或应选择端到端学习的指导原则。
原文摘要 · Abstract (English)
Deep learning has enabled remarkable progress in binary code analysis. In particular, pre-trained embeddings of assembly code have become a gold standard for solving analysis tasks, such as measuring code similarity or recognizing functions. These embeddings are capable of learning a vector representation from unlabeled code. In contrast to natural language processing, however, label information is not scarce for many tasks in binary code analysis. For example, labeled training data for function boundaries, optimization levels, and argument types can be easily derived from debug information provided by a compiler. Consequently, the main motivation of embeddings does not transfer directly to binary code analysis. In this paper, we explore the role of pre-trained embeddings from a critical perspective. To this end, we systematically evaluate recent embeddings for assembly code on five downstream tasks using a corpus of 1.2 million functions from the Debian distribution. We observe that several embeddings perform similarly when sufficient labeled data is available, and that differences reported in prior work are hardly noticeable. Surprisingly, we find that end-to-end learning without pre-training performs best on average, which calls into question the need for specialized embeddings. By varying the amount of labeled data, we eventually derive guidelines for when embeddings offer advantages and when end-to-end learning is preferable for binary code analysis.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。