Pre-Training Representations of Binary Code Using Contrastive Learning
Not on the map. Why?
Abstract (arXiv)
Binary code analysis and comprehension is critical to applications in reverse engineering and computer security tasks where source code is not available. Unfortunately, unlike source code, binary code lacks semantics and is more difficult for human engineers to understand and analyze. In this paper, we present ContraBin, a contrastive learning technique that integrates source code and comment information along with binaries to create an embedding capable of aiding binary analysis and comprehension tasks. Specifically, we present three components in ContraBin: (1) a primary contrastive learning method for initial pre-training, (2) a simplex interpolation method to integrate source code, comments, and binary code, and (3) an intermediate representation learning algorithm to train a binary code embedding. We further analyze the impact of human-written and synthetic comments on binary code comprehension tasks, revealing a significant performance disparity. While synthetic comments provide substantial benefits, human-written comments are found to introduce noise, even resulting in performance drops compared to using no comments. These findings reshape the narrative around the role of comment types in binary code analysis. We evaluate the effectiveness of ContraBin through four indicative downstream tasks related to binary code: algorithmic functionality classification, function name recovery, code summarization, and reverse engineering. The results show that ContraBin considerably improves performance on all four tasks, measured by accuracy, mean of average precision, and BLEU scores as appropriate. ContraBin is the first language representation model to incorporate source code, binary code, and comments into contrastive code representation learning and is intended to contribute to the field of binary code analysis. The dataset used in this study is available for further research.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 33 of its 60 references that are in the map. First posted on arXiv 11 Oct 2022.
Builds on
33 of 60 references.
References · 33
- 2017Attention Is All You Needcited by 60,361
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,513
- 2020Exploring Simple Siamese Representation Learningcited by 2,866
- 2020Knowledge Distillation: A Surveycited by 1,603
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2018Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labelscited by 997
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2020What Makes for Good Views for Contrastive Learning?cited by 846
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
21 more
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2019On the Efficacy of Knowledge Distillationcited by 381
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2020What Should Not Be Contrastive in Contrastive Learningcited by 226
- 2013A Survey on Multi-view Learningcited by 152
- 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
- 2022Imbalance Trouble: Revisiting Neural-Collapse Geometrycited by 80
- 2020Contrastive Code Representation Learningcited by 76
- 2021CoTexT: Multi-task Learning with Code-Text Transformercited by 61
- 2018Neural Code Comprehension: A Learnable Representation of Code Semanticscited by 59
- 2021On the Evaluation of Neural Code Summarizationcited by 48
- 2019DIRE: A Neural Approach to Decompiled Identifier Namingcited by 36
- 2021CodeTrans: Towards Cracking the Language of Silicon's Code Through Self-Supervised Deep Learning and High Performance Computingcited by 28
- 2018Neural Machine Translation Inspired Binary Code Similarity Comparison beyond Function Pairscited by 25
- 2021Augmenting Decompiler Output with Learned Variable Names and Typescited by 23
- 2019A Survey of Binary Code Similaritycited by 19
- 2019Learning Execution through Neural Code Fusioncited by 13
- 2020Bin2vec: Learning Representations of Binary Executable Programs for Security Taskscited by 8
- 2021deGraphCS: Embedding Variable-based Flow Graph for Neural Code Searchcited by 3
- 2014Representation Learning for cold-start recommendationcited by 1
- 2022K-ASTRO: Structure-Aware Adaptation of LLMs for Code Vulnerability Detectioncited by 1
Built on by
Citing papers per year: 2023: 2; 2024: 1; 2025: 1; 2026: 2.
6 papers.
- 2023kTrans: Knowledge-Aware Transformer for Binary Code Embeddingcited by 10
- 2023Source Code Data Augmentation for Deep Learning: A Surveycited by 3
- 2024BLens: Contrastive Captioning of Binary Functions using Ensemble Embeddingcited by 3
- 2025Optimizing Code Runtime Performance through Context-Aware Retrieval-Augmented Generationcited by 1
- 2026Identifier-Free Code Embedding Models for Scalable Searchcited by 0
- 2026SoK: AI-Augmented Binary Reversingcited by 0
- 2026SoK: AI-Augmented Binary Reversing16 Jun 2026
- 2026Identifier-Free Code Embedding Models for Scalable Search5 May 2026
- 2025Optimizing Code Runtime Performance through Context-Aware Retrieval-Augmented Generation28 Jan 2025
- 2024BLens: Contrastive Captioning of Binary Functions using Ensemble Embedding12 Sep 2024
- 2023kTrans: Knowledge-Aware Transformer for Binary Code Embedding24 Aug 2023
- 2023Source Code Data Augmentation for Deep Learning: A Survey31 May 2023