Skip to main content
QUICK REVIEW

[Paper Review] UniASM: Binary Code Similarity Detection without Fine-tuning

Yeming Gu, Hui‐Kuo G. Shu|arXiv (Cornell University)|Oct 28, 2022
Software Engineering ResearchComputer Science6 citations
TL;DR

UniASM proposes a novel UniLM-based binary code embedding model that achieves state-of-the-art performance in binary code similarity detection without requiring fine-tuning. It introduces a rich-semantic function representation and two new pre-training tasks, improving Recall@1 by 12.7%, 8.5%, and 22.3% on cross-compiler, cross-optimization, and cross-obfuscation benchmarks, respectively.

ABSTRACT

Binary code similarity detection (BCSD) is widely used in various binary analysis tasks such as vulnerability search, malware detection, clone detection, and patch analysis. Recent studies have shown that the learning-based binary code embedding models perform better than the traditional feature-based approaches. However, previous studies have not delved deeply into the key factors that affect model performance. In this paper, we design extensive ablation studies to explore these influencing factors. The experimental results have provided us with many new insights. We have made innovations in both code representation and model selection: we propose a novel rich-semantic function representation technique to ensure the model captures the intricate nuances of binary code, and we introduce the first UniLM-based binary code embedding model, named UniASM, which includes two newly designed training tasks to learn representations of binary functions. The experimental results show that UniASM outperforms the state-of-the-art (SOTA) approaches on the evaluation datasets. The average scores of Recall@1 on cross-compilers, cross-optimization-levels, and cross-obfuscations have improved by 12.7%, 8.5%, and 22.3%, respectively, compared to the best of the baseline methods. Besides, in the real-world task of known vulnerability search, UniASM outperforms all the current baselines.

Motivation & Objective

  • To investigate key factors affecting binary code embedding model performance through extensive ablation studies.
  • To develop a robust, zero-shot capable binary code similarity detection model that generalizes across diverse binary variations.
  • To design a function representation technique that captures intricate semantic nuances in binary code.
  • To introduce a UniLM-based architecture with novel pre-training tasks for improved binary function embedding.
  • To outperform existing state-of-the-art methods on cross-compiler, cross-optimization, and obfuscation scenarios without fine-tuning.

Proposed method

  • Proposes a rich-semantic function representation technique to encode detailed low-level semantics from binary functions.
  • Introduces a UniLM-based architecture (UniASM) for learning contextualized embeddings of binary functions.
  • Designs two new pre-training tasks—masked function modeling and next function prediction—to enhance representation learning.
  • Trains the model on a large-scale binary code corpus without any fine-tuning on downstream tasks.
  • Uses self-supervised learning to capture structural and semantic patterns across diverse binary binaries.
  • Employs a dual-branch contrastive learning setup to align semantically similar functions while separating dissimilar ones.

Experimental results

Research questions

  • RQ1What are the key factors that influence the performance of binary code embedding models?
  • RQ2Can a unified language model architecture effectively learn representations of binary functions without task-specific fine-tuning?
  • RQ3How does a rich-semantic function representation improve similarity detection in binary code?
  • RQ4To what extent can a pre-trained UniLM-based model generalize across cross-compiler, cross-optimization, and obfuscation scenarios?
  • RQ5Can the proposed model outperform existing SOTA methods in real-world vulnerability search tasks?

Key findings

  • UniASM achieves a 12.7% improvement in Recall@1 on cross-compiler binary similarity detection compared to the best baseline.
  • It improves Recall@1 by 8.5% on cross-optimization-level detection, demonstrating robustness to compiler optimizations.
  • On cross-obfuscation scenarios, UniASM achieves a 22.3% relative gain in Recall@1, indicating strong resilience to code transformation.
  • In real-world known vulnerability search, UniASM outperforms all current baselines, confirming its practical utility.
  • Ablation studies confirm that both the rich-semantic representation and the two new pre-training tasks significantly contribute to performance gains.
  • The model achieves SOTA results without any fine-tuning, highlighting its strong zero-shot generalization capability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.