Abstract
Binary code analysis is a critical yet challenging domain in cybersecurity, traditionally requiring significant manual effort from experts. While Large Language Models (LLMs) have shown promise in source code tasks, their efficacy in the binary domain remains under-explored. We present BinMetric, the first comprehensive benchmark designed to evaluate LLMs across a spectrum of binary analysis tasks. By testing 12 state-of-the-art models on 1,000 realistic questions across six tasks, we reveal that while LLMs possess strong semantic understanding, they struggle with the precision required for low-level assembly reconstruction.
Introduction
Binary analysis—the process of understanding compiled programs without source code access—is fundamental to malware detection, vulnerability research, and software patching. Unlike high-level source code, binary code lacks descriptive variable names, comments, and clear control flow structures, making it a "black box" for automated tools.
While LLMs have revolutionized software engineering, their application to binary analysis is hindered by the lack of standardized, high-quality benchmarks. Existing evaluations often rely on simplistic datasets or focus narrowly on decompilation. BinMetric addresses this gap by providing a multi-dimensional evaluation framework that mirrors real-world reverse engineering workflows.
Methodology and Task Suite
The BinMetric benchmark categorizes binary analysis into four hierarchical dimensions, encompassing six distinct tasks:
- Binary Code Lifting: Includes Call-site Reconstruction (CSR) and Decompilation (DEC).
- Semantic Comprehension: Includes Function Signature Recovery (SR) and Binary Code Summarization (BCS).
- Logical Analysis: Algorithm Classification (AC).
- Assembly Synthesis: Assembly Instruction Generation (AIG).
The evaluation pipeline utilizes specialized metrics tailored to each task. For instance, CodeBLEU is used for syntax and semantic alignment in decompilation, while execution correctness—verified within isolated Docker environments—is used to evaluate the functional validity of generated assembly code.
Dataset Construction
The researchers curated a high-quality dataset derived from 20 prominent open-source C projects (e.g., OpenSSL, Redis, SQLite) across 11 domains. The construction process involves a rigorous pipeline:
- Data Collection: Projects are compiled and stripped to simulate realistic reverse engineering scenarios.
- Filtering: A "double-threshold" approach removes snippets that are either too trivial or exceed model context windows.
- Leakage Prevention: To ensure the integrity of the benchmark, the authors performed extensive checks to confirm that the evaluation data was not likely present in the models' training sets.
Key Insights and Results
Evaluation of 12 state-of-the-art models, including GPT-4 and specialized open-source models like CodeLlama, yielded several critical insights:
- The Semantic-Syntactic Gap: LLMs excel at high-level semantic tasks, such as summarization, but falter in tasks requiring strict syntactic precision. For example, while models can often describe what a function does, they struggle to "lift" it back into functional C code accurately.
- GPT-4 Leadership: GPT-4 remains the top performer, particularly in logical analysis and complex decompilation tasks.
- Domain-Specific Pre-training: Models pre-trained on code (e.g., WizardCoder) significantly outperform general-purpose models of equivalent size, highlighting the importance of domain-specific data.
- The Low-Level Barrier: Assembly Instruction Generation (AIG) proved to be the most difficult task, with an average execution pass rate of less than 1%. This indicates a profound gap in the models' understanding of low-level machine architectures.
- Prompting Efficacy: "One-shot" prompting, where a single example is provided, improved performance by an average of 16.65%, though smaller models occasionally exhibited "copy-cat" behavior rather than true problem-solving.
Conclusion and Future Directions
BinMetric highlights both the potential and the current limitations of LLMs in binary analysis. While these models can serve as powerful assistants for semantic understanding, they are not yet capable of replacing human experts in tasks requiring architectural precision.
Future work should focus on binary-specific pre-training (e.g., training on aligned assembly and source code pairs), the integration of Retrieval-Augmented Generation (RAG) for technical specifications, and the development of hybrid models that combine semantic reasoning with formal logical verification.
Summary updated