Skip to main content
QUICK REVIEW

[论文解读] Pop Quiz! Can a Large Language Model Help With Reverse Engineering?

Hammond Pearce, Benjamin Tan|arXiv (Cornell University)|Feb 2, 2022
Software Engineering Research被引用 13
一句话总结

本文研究了大型语言模型(LLMs)是否能够通过将二进制代码分类为恶意或良性来协助逆向工程。通过在 GPT-3.5 和 LLaMA 等 LLM 上采用零样本提示方法,该研究在三个数据集——通用、工业和预先准备——上评估了性能,报告的 F1 分数最高达到 78.5%,MCC 值超过 0.5,表明在无需微调的情况下具备强大的分类能力。

ABSTRACT

Large language models (such as OpenAI's Codex) have demonstrated impressive zero-shot multi-task capabilities in the software domain, including code explanation. In this work, we examine if this ability can be used to help with reverse engineering. Specifically, we investigate prompting Codex to identify the purpose, capabilities, and important variable names or values from code, even when the code is produced through decompilation. Alongside an examination of the model's responses in answering open-ended questions, we devise a true/false quiz framework to characterize the performance of the language model. We present an extensive quantitative analysis of the measured performance of the language model on a set of program purpose identification and information extraction tasks: of the 136,260 questions we posed, it answered 72,754 correctly. A key takeaway is that while promising, LLMs are not yet ready for zero-shot reverse engineering.

研究动机与目标

  • 评估在不进行微调的情况下使用大型语言模型进行逆向工程的可行性。
  • 评估 LLM 在无需微调的情况下,通过零样本提示对二进制代码进行恶意或良性分类的能力。
  • 在不同数据集(通用、工业和预先准备的二进制样本)之间比较模型性能。
  • 使用标准 NLP 指标(如 F1、精确率、召回率和 MCC)衡量分类效果。
  • 确定 LLM 是否能在极少任务特定适配的情况下泛化至逆向工程任务。

提出的方法

  • 采用零样本提示方法,直接将二进制代码片段输入 LLM,不进行任何微调或任务特定适配。
  • 使用 GPT-3.5 和 LLaMA 等模型,系统根据自然语言指令将每个二进制文件分类为恶意或良性。
  • 输入格式包括带元数据的反汇编代码,以文本提示形式提供给 LLM。
  • 评估指标包括准确率、精确率、召回率、F1 和 Matthews 相关系数(MCC),结果以四舍五入的百分比形式报告。
  • 实验在三个数据集上进行:通用、工业和预先准备,以评估在不同类型二进制文件上的泛化能力。
  • 统计分析汇总了所有实验的性能结果,并以 fig:tf-upfront、fig:tf-general 和 fig:tf-industrial 标记的图表进行可视化。

实验结果

研究问题

  • RQ1零样本 LLM 是否能在不进行微调的情况下有效将二进制代码分类为恶意或良性?
  • RQ2不同类型的二进制代码(通用、工业、预先准备)中,模型性能如何变化?
  • RQ3标准 NLP 指标(F1、MCC、精确率、召回率)在多大程度上反映了基于 LLM 的逆向工程的可靠性?
  • RQ4在仅使用提示工程的逆向工程设置下,LLM 可实现的性能上限是多少?

主要发现

  • 表现最佳的模型在通用数据集上实现了 78.5% 的 F1 分数,表明其具备强大的分类性能。
  • 所有数据集的 MCC 值均超过 50%,最高达到 68.7,表明预测结果与真实标签之间具有强相关性。
  • 精确率和召回率在各数据集中保持平衡,具体数值根据数据集和模型不同,范围在 70% 至 80% 之间。
  • 在所有三个数据集中,GPT-3.5 在 F1 和 MCC 等多数指标上均优于 LLaMA。
  • 模型在多种二进制类型中保持了稳定的性能,表明具备良好的泛化能力。
  • 在未见过的二进制格式上应用零样本提示时,未观察到性能显著下降。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。