cs.SENov 8, 2026

MicroSim: Contrastive Graph Neural Networks for Binary Code Similarity Detection

Authors: Moussa Moussaoui, Tarik Houichime, Abdelghani Souhar, Abdelalim Sadiq

Organizations: Computer Science Research Laboratory(LaRI), Faculty of Science, Ibn Tofail University, Kenitra, 14000, Morocco · Meridian Team, LyRICA Laboratory, School of Information Sciences, Rabat 10100, Morocco

Abstract

We present MicroSim, a system for binary code similarity detection that represents each function as a graph built from IDA Pro Hex-Rays microcode and compares such graphs with a contrastive Siamese graph neural network (GNN). We evaluate on the TREX cross-optimization benchmark, a corpus of 849,072 function-level microcode graphs spanning optimization levels -O0 through -O3, under a strict class-disjoint split in which no function key is shared between train and test. Under this protocol, MicroSim reaches 0.9972 area under the receiver operating characteristic curve (ROC-AUC) and 0.9762 Matthews correlation coefficient (MCC), outperforming Gemini (0.9332 ROC-AUC), SAFE (0.9752), and jTrans (0.9740) retrained on the same split, as well as a structure-free Bag-of-Words (BoW) baseline (0.9484). We analyze the gap between pair classification and ranked retrieval in graph transformers, showing that Cross-domain Similarity Local Scaling (CSLS) under unified tie-resolved evaluation raises GraphGPS mean reciprocal rank (MRR) from 0.2542 to 0.2559 (R@1 = 0.1639, R@10 = 0.4561), strictly satisfying the theoretical MRR upper bound. Finally, over 5 seeds with equal compute, the pairwise cosine-embedding loss attains a slightly higher ROC-AUC (Δ = -0.0256, 95% confidence interval [-0.3282, +0.2770]), whereas the supervised-contrastive information noise-contrastive estimation (InfoNCE) loss is significantly better on thresholded classification and ranked retrieval.

Figures & tables

Explore similar work

CardsList
  1. Pretraining on Call Graphs: When Binary Analysis Tasks Profit From Context

    Aug 3, 2026Samuel Valenzuela, Johannes KinderRepresentation LearningGraph Representation Learning

  2. Instruction Alignment for Binary Code Representation Learning

    Aug 12, 2026Huaijin Wang, Shuai WangSoftware EngineeringRepresentation Learning