MicroSim: Contrastive Graph Neural Networks for Binary Code Similarity Detection
Moussa Moussaoui, Tarik Houichime, Abdelghani Souhar, Abdelalim Sadiq
Key points
From the paper's conclusion- 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).
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 ({\Delta} = -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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Revisiting Graph Representations for ML-Based Binary Code Similarity Detection: A Systematic StudyProceedings of the ACM on Software Engineering · 2026
- Learning Spectral Representations of Code through Latent Graph Learning for Generalizable Cross-Language Code Clone DetectionarXiv · 2026
- SemDiff: Binary similarity detection by diffing key-semantics graphs.Neural networks : the official journal of the International Neural Network Society · 2026
- From Similarity Ranking to Definitive Verdict: LLM-Enhanced Source-to-Binary Function LocalizationProceedings of the ACM on Programming Languages · 2026
- Fool Me If You Can: On the Robustness of Binary Code Similarity Detection Models against Semantics-Preserving TransformationsProceedings of the ACM on software engineering. · 2026
- Model Reuse Through Retargeted-Architecture Binary Code AnalysisIEEE Transactions on Dependable and Secure Computing · 2026