arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.08682cs.LGcs.AI
收藏

预训练嵌入在二进制代码分析中的作用

On the Role of Pre-trained Embeddings in Binary Code Analysis

Max Planck Institute for Solar System Research(马克斯·普朗克太阳系研究所)

Alwin Maier, Felix Weissberg, Konrad Rieck

AI总结:

本文批判性探索预训练嵌入在二进制代码分析中的作用,通过120万函数语料库在五个下游任务评估发现,足够标记数据时嵌入性能相似,无预训练端到端学习平均最佳,并得出嵌入与端到端学习的适用指导方针。

摘要:

深度学习推动了二进制代码分析领域的显著进展。特别是,汇编代码的预训练嵌入已成为解决分析任务(如代码相似性度量或函数识别)的黄金标准。这些嵌入能够从未标记代码中学习向量表示。然而,与自然语言处理不同,二进制代码分析的许多任务并不缺乏标记信息。例如,函数边界、优化级别和参数类型的标记训练数据可轻松从编译器提供的调试信息中获取。因此,嵌入的主要动机无法直接转移到二进制代码分析中。本文从批判性视角探索预训练嵌入的作用。为此,我们使用来自Debian发行版的120万个函数语料库,在五个下游任务上系统评估了近期的汇编代码嵌入。我们观察到,当有足够标记数据时,多个嵌入的性能相似,且先前工作中报告的差异几乎不可察觉。令人惊讶的是,我们发现无预训练的端到端学习平均性能最佳,这对专用嵌入的必要性提出了质疑。通过改变标记数据量,我们最终得出了二进制代码分析中嵌入何时具有优势、端到端学习何时更优的指导方针。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑