Cross-modal Retrieval Models for Stripped Binary Analysis

Guoqiang Chen, Lingyun Ying, Ziyang Song, Daguang Liu, Qiang Wang, Zhiqi Wang, Li Hu, Shaoyin Cheng, Weiming Zhang, Nenghai YuarXiv 2025 · DOI

Introduction

In the field of software security and reverse engineering, identifying specific functionalities within compiled programs is a critical yet daunting task. Analysts often search for cryptographic routines, backdoors, or known vulnerabilities. This challenge is significantly amplified when dealing with stripped binaries—executable files from which metadata such as function names, variable labels, and type information have been removed to reduce size or obfuscate logic.

Traditional search methods rely heavily on source code or symbol information. However, stripped binaries present a "modality gap" between natural language queries and the low-level, often messy, decompiled pseudocode. Existing natural language processing (NLP) models frequently struggle with the unique syntax and lack of semantic context in binary code. To address these challenges, we present BinSeek, a high-performance, two-stage cross-modal retrieval framework.

The BinSeek Framework

BinSeek employs a coarse-to-fine retrieval strategy designed to balance computational efficiency with deep semantic understanding. The framework consists of two specialized components: an embedding model for rapid candidate generation and a context-aware reranker for precise final selection.

Overview of the BinSeek framework, illustrating the two-stage retrieval process from natural language query to ranked binary functions.

Stage 1: BinSeek-Embedding

The first stage utilizes BinSeek-Embedding, a lightweight model with 0.3 billion parameters based on the Qwen3 architecture. Its primary role is to act as a "scout," mapping both natural language queries and decompiled pseudocode into a unified vector space. By calculating the cosine similarity between these embeddings, the system can efficiently retrieve a set of top-k candidate functions from massive codebases in milliseconds. Despite its small size, this domain-specific model outperforms general-purpose models many times its size by focusing specifically on the nuances of decompiled code.

Stage 2: BinSeek-Reranker

The second stage, BinSeek-Reranker, is a 0.6 billion parameter model that performs a more granular analysis of the candidates identified in the first stage. A key innovation of the reranker is its context-aware design. Rather than analyzing a function in isolation, it incorporates information from "callee" functions—the subroutines called by the target function. This neighborhood context provides vital semantic clues that are otherwise lost in stripped binaries, leading to an approximate 8% improvement in top-1 accuracy.

Large-Scale Data Synthesis

A significant hurdle in training binary retrieval models is the scarcity of high-quality, labeled datasets pairing natural language descriptions with binary functions. To overcome this, the authors developed an automated LLM-driven data synthesis pipeline.

Using the DeepSeek-V3 large language model, the team generated natural language summaries for millions of functions found in open-source GitHub repositories. These functions were then compiled into binaries and subsequently decompiled to create a massive training set of 45.7 million positive and negative pairs. Human evaluation confirmed the high quality of this synthetic data, with 97.6% of the generated descriptions being rated as accurate or partially accurate.

Experimental Evaluation

BinSeek was evaluated against a suite of state-of-the-art embedding and reranking models. The results demonstrate that specialization and architectural design can outweigh raw model scale.

Performance comparison of the BinSeek two-stage pipeline against various baseline models, highlighting its superior accuracy and efficiency.

As shown in the evaluation metrics, BinSeek achieved a Recall@3 of 84.5% and a Mean Reciprocal Rank (MRR)@3 of 80.25%. These figures represent a substantial leap over existing baselines. Furthermore, BinSeek is remarkably efficient; compared to the high-performing SFR-Embedding-Mistral baseline, BinSeek operates 10 times faster while maintaining higher accuracy. This efficiency makes it suitable for real-world security workflows where rapid analysis of large binary files is required.

Conclusion

BinSeek demonstrates that a two-stage, context-aware approach combined with high-quality synthetic data can effectively bridge the gap between natural language and stripped binary code. By outperforming models 16 times its size, BinSeek proves that domain-specific optimization is key to solving complex binary analysis tasks. Future work will explore expanding the context window to include "caller" functions and scaling the architecture to further enhance its reasoning capabilities in diverse software environments.

Summary updated

BibTeX
@misc{chen2025cross,
  author = {Guoqiang Chen and Lingyun Ying and Ziyang Song and Daguang Liu and Qiang Wang and Zhiqi Wang and Li Hu and Shaoyin Cheng and Weiming Zhang and Nenghai Yu},
  title = {{Cross-modal Retrieval Models for Stripped Binary Analysis}},
  year = {2025},
  eprint = {2512.10393},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.10393},
}
Figure