Skip to main content
QUICK REVIEW

[Paper Review] ReSIM: Re-ranking Binary Similarity Embeddings to Improve Function Search Performance

Gianluca Capozzi, Anna Paola Giancaspro|arXiv (Cornell University)|Feb 10, 2026
Advanced Malware Detection TechniquesComputer Science0 citations
TL;DR

ReSIM introduces a neural re-ranker that works on top of embedding-based binary function similarity to jointly evaluate query-candidate pairs, improving Recall and nDCG across multiple embedding models and datasets.

ABSTRACT

Binary Function Similarity (BFS), the problem of determining whether two binary functions originate from the same source code, has been extensively studied in recent research across security, software engineering, and machine learning communities. This interest arises from its central role in developing vulnerability detection systems, copyright infringement analysis, and malware phylogeny tools. Nearly all binary function similarity systems embed assembly functions into real-valued vectors, where similar functions map to points that lie close to each other in the metric space. These embeddings enable function search: a query function is embedded and compared against a database of candidate embeddings to retrieve the most similar matches. Despite their effectiveness, such systems rely on bi-encoder architectures that embed functions independently, limiting their ability to capture cross-function relationships and similarities. To address this limitation, we introduce ReSIM, a novel and enhanced function search system that complements embedding-based search with a neural re-ranker. Unlike traditional embedding models, our reranking module jointly processes query-candidate pairs to compute ranking scores based on their mutual representation, allowing for more accurate similarity assessment. By re-ranking the top results from embedding-based retrieval, ReSIM leverages fine-grained relation information that bi-encoders cannot capture. We evaluate ReSIM across seven embedding models on two benchmark datasets, demonstrating consistent improvements in search effectiveness, with average gains of 21.7% in terms of nDCG and 27.8% in terms of Recall.

Motivation & Objective

  • Motivate and address limitations of bi-encoder BFS systems that independently embed functions.
  • Propose a two-stage function search pipeline combining fast embedding retrieval with a cross-encoder re-ranker.
  • Show that joint query-candidate processing improves ranking accuracy over embedding-based retrieval alone.
  • Demonstrate cross-model robustness and transferability of the ReSIM approach across datasets and toolchains.

Proposed method

  • A two-stage pipeline where an embedding model retrieves top-w candidates (window W).
  • A neural re-ranker (cross-encoder) jointly processes (query, candidate) pairs to score similarity and re-rank W to produce top-k results.
  • Re-ranker is trained with a pairwise contrastive/margin ranking objective using hard negatives from multiple models.
  • Fine-tuning uses DeepSeek-R1-Qwen3-8B (8B parameters) with LoRA adapters and 4-bit QLoRA quantization.
  • Preprocessing normalizes two assembly functions before concatenation and tokenization for cross-encoder input.
  • The approach is model-agnostic with respect to the underlying embedding model φ and can ensemble multiple φs.

Experimental results

Research questions

  • RQ1How does ReSIM perform across diverse BFS embedding models and toolchains?
  • RQ2How does window size w affect ReSIM's performance and efficiency?
  • RQ3Does ensembling embedding models with ReSIM yield additional gains over single-model setups?
  • RQ4Is there transferable benefit from pre-trained re-ranker models when applied to assembly-function search?

Key findings

  • ReSIM consistently improves nDCG@k and Recall@k across seven embedding models and two datasets.
  • Average gains reported: 21.7% in nDCG and 27.8% in Recall across evaluated settings.
  • Older embedding models (e.g., Gemini, SAFE) show larger gains; transformer-based models also benefit with notable improvements.
  • Ensembling embedding models with ReSIM yields an additional Recall increase (about 3%) on a multi-toolchain dataset.
  • There is observable transfer of knowledge from pre-trained re-ranker (DeepSeek-R1-Qwen3-8B) even though it was not trained on assembly language.
  • ReSIM supports a range of k values (5,10,15,20,25,30) with robust improvements across datasets.

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.