arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2210.05102cs.SEcs.LG
收藏

使用对比学习预训练二进制代码表示

Pre-Training Representations of Binary Code Using Contrastive Learning

Department of Computer Science(计算机科学系);Vanderbilt University(范德比大学);National University of Singapore(新加坡国立大学);College of William & Mary(威廉与玛丽学院)

Yifan Zhang, Chen Huang, Yueke Zhang, Huajie Shao, Kevin Leach, Yu Huang

AI总结:

本文提出ContraBin,一种整合源代码、注释与二进制代码的对比学习预训练方法,通过三个组件提升二进制代码分析任务性能,并发现合成注释优于人工注释。

摘要:

二进制代码的分析与理解对于逆向工程和计算机安全任务中的应用至关重要,在这些任务中源代码不可用。不幸的是,与源代码不同,二进制代码缺乏语义,使得人类工程师更难理解和分析。在本文中,我们提出了ContraBin,一种对比学习技术,它整合了源代码、注释信息和二进制代码,以创建能够辅助二进制分析和理解任务的嵌入表示。具体来说,我们在ContraBin中提出了三个组成部分:(1)用于初始预训练的主要对比学习方法,(2)一种整合源代码、注释和二进制代码的单纯形插值方法,以及(3)一种用于训练二进制代码嵌入的中间表示学习算法。我们进一步分析了人工编写和合成注释对二进制代码理解任务的影响,揭示了显著的性能差异。虽然合成注释提供了显著的好处,但发现人工编写的注释会引入噪声,甚至导致性能相比不使用注释时下降。这些发现重塑了关于注释类型在二进制代码分析中作用的叙事。我们通过四个与二进制代码相关的指示性下游任务评估了ContraBin的有效性:算法功能分类、函数名称恢复、代码摘要和逆向工程。结果表明,ContraBin在所有四个任务上均显著提高了性能,分别通过准确率、平均精度的均值和BLEU分数来衡量。ContraBin是第一个将源代码、二进制代码和注释整合到对比代码表示学习中的语言表示模型,旨在为二进制代码分析领域做出贡献。本研究中使用的数据集可供进一步研究使用。

英文摘要:

Binary code analysis and comprehension is critical to applications in reverse engineering and computer security tasks where source code is not available. Unfortunately, unlike source code, binary code lacks semantics and is more difficult for human engineers to understand and analyze. In this paper, we present ContraBin, a contrastive learning technique that integrates source code and comment information along with binaries to create an embedding capable of aiding binary analysis and comprehension tasks. Specifically, we present three components in ContraBin: (1) a primary contrastive learning method for initial pre-training, (2) a simplex interpolation method to integrate source code, comments, and binary code, and (3) an intermediate representation learning algorithm to train a binary code embedding. We further analyze the impact of human-written and synthetic comments on binary code comprehension tasks, revealing a significant performance disparity. While synthetic comments provide substantial benefits, human-written comments are found to introduce noise, even resulting in performance drops compared to using no comments. These findings reshape the narrative around the role of comment types in binary code analysis. We evaluate the effectiveness of ContraBin through four indicative downstream tasks related to binary code: algorithmic functionality classification, function name recovery, code summarization, and reverse engineering. The results show that ContraBin considerably improves performance on all four tasks, measured by accuracy, mean of average precision, and BLEU scores as appropriate. ContraBin is the first language representation model to incorporate source code, binary code, and comments into contrastive code representation learning and is intended to contribute to the field of binary code analysis. The dataset used in this study is available for further research.

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

↑