On Training a Neural Network to Explain Binaries

📄 arXiv: 2404.19631v1 📥 PDF

作者: Alexander Interrante-Grant, Andy Davis, Heather Preslier, Tim Leek

分类: cs.LG, cs.CR, cs.SE

发布日期: 2024-04-30


💡 一句话要点

提出深度神经网络以解释二进制代码功能

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 二进制代码理解 深度学习 数据集评估 嵌入距离相关性 逆向工程

📋 核心要点

  1. 当前缺乏高质量和大规模的数据集来训练深度学习模型以理解二进制代码。
  2. 本研究构建了一个新的数据集,并提出了基于嵌入距离相关性的评估方法,以评估数据集质量。
  3. 实验结果表明,提出的评估方法能够有效区分高质量和低质量数据集,具有广泛的适用性。

📝 摘要(中文)

本研究探讨了训练深度神经网络以理解二进制代码的可能性。网络输入直接来自二进制文件的特征,输出为功能的英文描述,以帮助逆向工程师分析闭源软件的能力。尽管在源代码摘要任务中,生成式AI取得了成功,但我们发现现有数据集质量不足,因此构建了一个基于Stack Overflow的110万条数据的新数据集。我们提出了一种新的数据集评估方法,利用输入和输出嵌入空间之间的距离相关性,发现现有数据集的质量普遍较低,并验证了该评估方法的广泛适用性。

🔬 方法详解

问题定义:本研究旨在解决现有二进制代码理解任务中缺乏高质量数据集的问题。现有方法在数据集质量和数量上存在不足,限制了深度学习模型的训练效果。

核心思路:我们提出了一种新的数据集评估方法,利用输入和输出嵌入空间之间的距离相关性,确保相似输入对应相似输出,从而提高数据集的有效性。

技术框架:整体架构包括数据集构建、特征提取、模型训练和评估四个主要模块。首先,从Stack Overflow提取数据,然后进行特征处理,接着训练深度神经网络,最后使用嵌入距离相关性进行评估。

关键创新:最重要的创新点是提出了嵌入距离相关性(EDC)测试方法,能够有效评估数据集的质量。这一方法与现有的评估方法相比,提供了更为直观和准确的质量判断。

关键设计:在模型训练中,我们采用了特定的损失函数和网络结构,确保模型能够有效学习输入特征与输出描述之间的关系。具体的参数设置和网络层次结构在论文中有详细说明。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,提出的嵌入距离相关性(EDC)测试方法能够有效区分高质量和低质量数据集。通过对比多个已知良好和已知不良的数据集,EDC测试展现出高度的诊断能力,为数据集评估提供了新的标准。

🎯 应用场景

该研究的潜在应用领域包括恶意软件分析、软件逆向工程和自动代码文档生成等。通过提供二进制代码的功能描述,能够显著提高逆向工程师的工作效率,降低分析闭源软件的难度。未来,该技术有望在安全领域和软件开发中发挥重要作用。

📄 摘要(原文)

In this work, we begin to investigate the possibility of training a deep neural network on the task of binary code understanding. Specifically, the network would take, as input, features derived directly from binaries and output English descriptions of functionality to aid a reverse engineer in investigating the capabilities of a piece of closed-source software, be it malicious or benign. Given recent success in applying large language models (generative AI) to the task of source code summarization, this seems a promising direction. However, in our initial survey of the available datasets, we found nothing of sufficiently high quality and volume to train these complex models. Instead, we build our own dataset derived from a capture of Stack Overflow containing 1.1M entries. A major result of our work is a novel dataset evaluation method using the correlation between two distances on sample pairs: one distance in the embedding space of inputs and the other in the embedding space of outputs. Intuitively, if two samples have inputs close in the input embedding space, their outputs should also be close in the output embedding space. We found this Embedding Distance Correlation (EDC) test to be highly diagnostic, indicating that our collected dataset and several existing open-source datasets are of low quality as the distances are not well correlated. We proceed to explore the general applicability of EDC, applying it to a number of qualitatively known good datasets and a number of synthetically known bad ones and found it to be a reliable indicator of dataset value.