[Paper Review] Pop Quiz! Can a Large Language Model Help With Reverse Engineering?
This paper investigates whether large language models (LLMs) can assist in reverse engineering by classifying binary code as malicious or benign. Using a zero-shot prompting approach on LLMs like GPT-3.5 and LLaMA, the study evaluates performance across three datasets—general, industrial, and upfront—reporting F1 scores up to 78.5% and MCC values above 0.5, indicating strong classification capability without fine-tuning.
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.
Motivation & Objective
- To assess the feasibility of using large language models for reverse engineering without fine-tuning.
- To evaluate LLMs' ability to classify binary code as malicious or benign using zero-shot prompting.
- To compare model performance across diverse datasets: general, industrial, and upfront binary samples.
- To measure classification effectiveness using standard NLP metrics such as F1, precision, recall, and MCC.
- To determine whether LLMs can generalize to reverse engineering tasks with minimal task-specific adaptation.
Proposed method
- Employing zero-shot prompting, the study directly inputs binary code snippets into LLMs without any fine-tuning or task-specific adaptation.
- Using models such as GPT-3.5 and LLaMA, the system classifies each binary as malicious or benign based on natural language instructions.
- The input format includes disassembled code with metadata, presented as text prompts to the LLM.
- Evaluation metrics include accuracy, precision, recall, F1, and Matthews Correlation Coefficient (MCC), with results reported as rounded percentages.
- Experiments were conducted on three datasets: general, industrial, and upfront, to assess generalization across binary types.
- Statistical analysis aggregates performance across all experiments, with results visualized in figures labeled as fig:tf-upfront, fig:tf-general, and fig:tf-industrial.
Experimental results
Research questions
- RQ1Can zero-shot LLMs effectively classify binary code as malicious or benign without fine-tuning?
- RQ2How does model performance vary across different types of binary code (general, industrial, upfront)?
- RQ3To what extent do standard NLP metrics (F1, MCC, precision, recall) reflect the reliability of LLM-based reverse engineering?
- RQ4What is the upper bound of performance achievable by LLMs in this reverse engineering setting using only prompt engineering?
Key findings
- The best-performing model achieved an F1 score of 78.5% on the general dataset, indicating strong classification performance.
- MCC values exceeded 50 across all datasets, with the highest reaching 68.7, suggesting strong correlation between predictions and ground truth.
- Precision and recall were balanced across datasets, with values ranging from 70% to 80% depending on the dataset and model.
- GPT-3.5 outperformed LLaMA in most metrics, particularly in F1 and MCC, across all three datasets.
- The model maintained consistent performance across diverse binary types, indicating generalization capability.
- No significant degradation in performance was observed when applying zero-shot prompting to unseen binary formats.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.