CLAP:通过自然语言监督学习可迁移的二进制代码表示
CLAP: Learning Transferable Binary Code Representations with Natural Language Supervision
AI总结:
CLAP 通过自然语言监督对齐二进制代码与语义解释,自动构建 1.95 亿对训练数据,学习可迁移的二进制代码表示,在无任务特定训练时即可匹敌全监督基线。
摘要:
二进制代码表示学习在二进制分析任务中已展现出显著性能,但现有方案往往迁移性较差,尤其是在少样本和零样本场景下,即任务中可用训练样本很少或完全没有。为解决这一问题,我们提出 CLAP(对比语言-汇编预训练),该方法利用自然语言监督来学习更好的二进制代码(即汇编代码)表示,并获得更强的迁移能力。其核心在于,通过有效对齐二进制代码与其语义解释(以自然语言形式),我们的方法增强了优越的迁移学习能力,从而得到一个能够为二进制代码生成更好嵌入的模型。为了实现这种对齐训练,我们进一步提出一个高效的数据集引擎,能够自动生成包含二进制代码及相应自然语言解释的大规模多样化数据集。我们已生成 1.95 亿对二进制代码与解释,并训练了 CLAP 的原型。CLAP 在二进制分析中各类下游任务上的评估均表现出卓越性能。值得注意的是,在没有任何任务特定训练的情况下,CLAP 通常能与完全监督的基线相竞争,展现出优秀的迁移性。我们在 https://github.com/Hustcw/CLAP 发布了预训练模型和代码。
英文摘要:
Binary code representation learning has shown significant performance in binary analysis tasks. But existing solutions often have poor transferability, particularly in few-shot and zero-shot scenarios where few or no training samples are available for the tasks. To address this problem, we present CLAP (Contrastive Language-Assembly Pre-training), which employs natural language supervision to learn better representations of binary code (i.e., assembly code) and get better transferability. At the core, our approach boosts superior transfer learning capabilities by effectively aligning binary code with their semantics explanations (in natural language), resulting a model able to generate better embeddings for binary code. To enable this alignment training, we then propose an efficient dataset engine that could automatically generate a large and diverse dataset comprising of binary code and corresponding natural language explanations. We have generated 195 million pairs of binary code and explanations and trained a prototype of CLAP. The evaluations of CLAP across various downstream tasks in binary analysis all demonstrate exceptional performance. Notably, without any task-specific training, CLAP is often competitive with a fully supervised baseline, showing excellent transferability. We release our pre-trained model and code at https://github.com/Hustcw/CLAP.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。