mlsanityData to 14 Oct 2026

Towards Learning (Dis)-Similarity of Source Code from Program Contrasts

arXiv 2110.03868 ↗First posted 8 Oct 2021cs.PL cs.AI cs.LGcited by 17

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  4. 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
  5. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
  6. 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,989
  7. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  8. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  9. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  10. 2020Contrastive Learning with Hard Negative Samplescited by 628
  11. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  12. 2021Unified Pre-training for Program Understanding and Generationcited by 366
16 more
  1. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
  2. 2020DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representationscited by 251
  3. 2017Learning to Represent Programs with Graphscited by 220
  4. 2020CLEAR: Contrastive Learning for Sentence Representationcited by 186
  5. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
  6. 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
  7. 2020Contrastive Code Representation Learningcited by 76
  8. 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
  9. 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
  10. 2021CoTexT: Multi-task Learning with Code-Text Transformercited by 61
  11. 2021Self-Supervised Bug Detection and Repaircited by 59
  12. 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
  13. 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 41
  14. 2018CODIT: Code Editing with Tree-Based Neural Modelscited by 40
  15. 2020Exploring Software Naturalness through Neural Language Modelscited by 32
  16. 2020Patching as Translation: the Data and the Metaphorcited by 18

Built on by

Cited by year

Citing papers per year: 2022: 5; 2023: 9; 2024: 2; 2025: 1.

17 papers.

Sort:

By area:

  1. 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 65
  2. 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 54
  3. 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 46
  4. 2023Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChaincited by 31
  5. 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
  6. 2023Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyondcited by 20
  7. 2023GrACE: Generation using Associated Code Editscited by 16
  8. 2023Better Language Models of Code through Self-Improvementcited by 14
  9. 2022Summarize and Generate to Back-translate: Unsupervised Translation of Programming Languagescited by 12
  10. 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Searchcited by 12
  11. 2023Towards Causal Deep Learning for Vulnerability Detectioncited by 9
  12. 2023Code Representation Pre-training with Complements from Program Executionscited by 8
5 more
  1. 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representationcited by 7
  2. 2024BLens: Contrastive Captioning of Binary Functions using Ensemble Embeddingcited by 3
  3. 2023Neuro-symbolic Zero-Shot Code Cloning with Cross-Language Intermediate Representationcited by 2
  4. 2025Deep Learning-Based Identification of Inconsistent Method Names: How Far Are We?cited by 2
  5. 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Codecited by 0