Towards Learning (Dis)-Similarity of Source Code from Program Contrasts
Not on the map. Why?
Abstract (arXiv)
Understanding the functional (dis)-similarity of source code is significant for code modeling tasks such as software vulnerability and code clone detection. We present DISCO(DIS-similarity of COde), a novel self-supervised model focusing on identifying (dis)similar functionalities of source code. Different from existing works, our approach does not require a huge amount of randomly collected datasets. Rather, we design structure-guided code transformation algorithms to generate synthetic code clones and inject real-world security bugs, augmenting the collected datasets in a targeted way. We propose to pre-train the Transformer model with such automatically generated program contrasts to better identify similar code in the wild and differentiate vulnerable programs from benign ones. To better capture the structural features of source code, we propose a new cloze objective to encode the local tree-based context (e.g., parents or sibling nodes). We pre-train our model with a much smaller dataset, the size of which is only 5% of the state-of-the-art models' training datasets, to illustrate the effectiveness of our data augmentation and the pre-training approach. The evaluation shows that, even with much less data, DISCO can still outperform the state-of-the-art models in vulnerability and code clone detection tasks.
Key facts. Cited by 17 papers in the map (data through 14 Oct 2026). Builds on 28 of its 49 references that are in the map. First posted on arXiv 8 Oct 2021.
Builds on
28 of 49 references.
References · 28
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
- 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,989
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2020Contrastive Learning with Hard Negative Samplescited by 628
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2021Unified Pre-training for Program Understanding and Generationcited by 366
16 more
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
- 2020DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representationscited by 251
- 2017Learning to Represent Programs with Graphscited by 220
- 2020CLEAR: Contrastive Learning for Sentence Representationcited by 186
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
- 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
- 2020Contrastive Code Representation Learningcited by 76
- 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 2021CoTexT: Multi-task Learning with Code-Text Transformercited by 61
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
- 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 41
- 2018CODIT: Code Editing with Tree-Based Neural Modelscited by 40
- 2020Exploring Software Naturalness through Neural Language Modelscited by 32
- 2020Patching as Translation: the Data and the Metaphorcited by 18
Built on by
Citing papers per year: 2022: 5; 2023: 9; 2024: 2; 2025: 1.
17 papers.
Sort:
By area:
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 65
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 54
- 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 46
- 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChaincited by 31
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2023Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyondcited by 20
- 2023GrACE: Generation using Associated Code Editscited by 16
- 2023Better Language Models of Code through Self-Improvementcited by 14
- 2022Summarize and Generate to Back-translate: Unsupervised Translation of Programming Languagescited by 12
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Searchcited by 12
- 2023Towards Causal Deep Learning for Vulnerability Detectioncited by 9
- 2023Code Representation Pre-training with Complements from Program Executionscited by 8
5 more
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representationcited by 7
- 2024BLens: Contrastive Captioning of Binary Functions using Ensemble Embeddingcited by 3
- 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representationcited by 2
- 2025Deep Learning-Based Identification of Inconsistent Method Names: How Far Are We?cited by 2
- 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Codecited by 0
- 2025Deep Learning-Based Identification of Inconsistent Method Names: How Far Are We?22 Jan 2025
- 2024BLens: Contrastive Captioning of Binary Functions using Ensemble Embedding12 Sep 2024
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Search25 Mar 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain21 Oct 2023
- 2023Towards Causal Deep Learning for Vulnerability Detection12 Oct 2023
- 2023Code Representation Pre-training with Complements from Program Executions4 Sep 2023
- 2023GrACE: Generation using Associated Code Edits23 May 2023
- 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representation26 Apr 2023
- 2023Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyond11 Apr 2023
- 2023Better Language Models of Code through Self-Improvement2 Apr 2023
- 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Code8 Mar 2023
5 more
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Context20 Dec 2022
- 2022An Empirical Study of Deep Learning Models for Vulnerability Detection15 Dec 2022
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representation18 Oct 2022
- 2022NatGen: Generative pre-training by "Naturalizing" source code15 Jun 2022
- 2022Summarize and Generate to Back-translate: Unsupervised Translation of Programming Languages23 May 2022
- 2023Better Language Models of Code through Self-Improvementcited by 14
- 2023Better Language Models of Code through Self-Improvement2 Apr 2023
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 65
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 54
- 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 46
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2023Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyondcited by 20
- 2023GrACE: Generation using Associated Code Editscited by 16
- 2022Summarize and Generate to Back-translate: Unsupervised Translation of Programming Languagescited by 12
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Searchcited by 12
- 2023Towards Causal Deep Learning for Vulnerability Detectioncited by 9
- 2023Code Representation Pre-training with Complements from Program Executionscited by 8
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representationcited by 7
- 2024BLens: Contrastive Captioning of Binary Functions using Ensemble Embeddingcited by 3
12 most cited of 15 All 15 (JSON)
- 2025Deep Learning-Based Identification of Inconsistent Method Names: How Far Are We?22 Jan 2025
- 2024BLens: Contrastive Captioning of Binary Functions using Ensemble Embedding12 Sep 2024
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Search25 Mar 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Towards Causal Deep Learning for Vulnerability Detection12 Oct 2023
- 2023Code Representation Pre-training with Complements from Program Executions4 Sep 2023
- 2023GrACE: Generation using Associated Code Edits23 May 2023
- 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representation26 Apr 2023
- 2023Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyond11 Apr 2023
- 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Code8 Mar 2023
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Context20 Dec 2022
- 2022An Empirical Study of Deep Learning Models for Vulnerability Detection15 Dec 2022
12 newest of 15 All 15 (JSON)