NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Understanding the AI-powered Binary Code Similarity Detection

Lirong Fu, Peiyu Liu, Wenlong Meng, Kangjie Lu, Shize Zhou, Xuhong Zhang, Wenzhi Chen, Shouling JiarXiv 2024 · DOI

Abstract

Binary Code Similarity Detection (BinSD) is a critical task in cybersecurity, yet the rapid proliferation of AI-powered models has made objective comparison difficult. This research provides a systematic evaluation of 24 state-of-the-art BinSD tools, revealing that while Graph Neural Networks (GNNs) currently lead the field, they suffer from a critical "embedding collision" problem. Furthermore, the study demonstrates that standard metrics like AUC often fail to reflect actual performance in real-world vulnerability hunting scenarios.

The Challenge of Binary Similarity

BinSD determines if two pieces of compiled code originate from the same source without access to the original source code. This is essential for finding vulnerabilities in IoT firmware, detecting license violations, and analyzing malware. While the research community has produced numerous models using GNNs, CNNs, and Transformers, these are often "black boxes" evaluated on inconsistent benchmarks, leaving a gap in our understanding of their practical utility.

Systematic Evaluation Framework

To address this gap, the authors developed a framework to investigate 15 representative function-level BinSD tools. The evaluation focused on three key areas:

  1. Cross-Optimization and Cross-ISA Performance: Testing models against code compiled with different flags (O0-O3) and for varying architectures (x86, x64, ARM).
  2. Downstream Application Testing: Evaluating performance on real-world tasks, specifically vulnerability search (finding CVEs in IoT firmware) and license violation detection.
  3. Structural Analysis: Comparing architectural behaviors (e.g., GNNs vs. CNNs) to identify inherent limitations.
Table 1: Summary of state-of-the-art Binary Code Similarity Detection (BinSD) tools and their evaluation characteristics.

Datasets

The study utilized two primary open-sourced datasets:

  • Basic-dataset: Contains over 1.3 million functions from 25 open-source projects (e.g., OpenSSL, Busybox) across multiple architectures.
  • Application-dataset: Features 10 known vulnerable functions and 10 IoT firmware images from vendors like DLink and TPLink, totaling roughly 651,000 functions.

Key Insights: The AUC Illusion and Embedding Collision

One of the paper's most significant findings is the "AUC Illusion." While many papers report near-perfect Area Under the Curve (AUC) scores (often >0.98), these do not translate to high precision in real-world searches. In large repositories, "top-K" results are frequently flooded with false positives that the model incorrectly identifies as similar.

This phenomenon is largely driven by Embedding Collision. GNNs typically aggregate code features into a single vector (embedding) using summation. The authors discovered that semantically different functions often "collide," producing nearly identical embeddings. This structural limitation is the primary cause of false positives in GNN-based systems.

Performance Analysis

Evaluation results show that GNN-based models, such as Gemini-skip, generally achieve the best ranking metrics (MRR, Recall@5) for similar function detection. However, a significant "Cross-ISA Gap" remains; for instance, Gemini-skip's recall fell from 62.3% in same-architecture searches to just 25.4% in cross-architecture scenarios.

Figure 1: Comparison of ranking metrics for BinaryAI-bert2 and Gemini-skip across different evaluation ratios.

Efficiency also varies wildly. While some models like MGMN train in under an hour, others like Asteria require over 23 hours. More critically, the time to generate embeddings for a single firmware image can range from 1.5 hours to over 300 hours, posing major scalability challenges for certain state-of-the-art tools.

Future Directions

To move the field forward, the authors suggest three promising avenues:

  1. Leveraging LLMs: Using Large Language Models to better capture the complex semantics of assembly instructions.
  2. Embedding Concatenation: Combining neural embeddings with static features (like constant strings) to reduce the likelihood of collisions.
  3. Partial Graph Alignment: Implementing structural alignment as a secondary post-processing filter to verify the similarity scores produced by neural networks. This simple step has already shown potential in significantly boosting precision.

Summary updated

BibTeX
@misc{fu2024understanding,
  author = {Lirong Fu and Peiyu Liu and Wenlong Meng and Kangjie Lu and Shize Zhou and Xuhong Zhang and Wenzhi Chen and Shouling Ji},
  title = {{Understanding the AI-powered Binary Code Similarity Detection}},
  year = {2024},
  eprint = {2410.07537},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.07537},
}
Figure