mlsanityData to 14 Oct 2026

Learning Defect Prediction from Unrealistic Data

arXiv 2311.00931 ↗First posted 2 Nov 2023cs.LGcited by 5

Not on the map. Why?

Abstract (arXiv)

Pretrained models of code, such as CodeBERT and CodeT5, have become popular choices for code understanding and generation tasks. Such models tend to be large and require commensurate volumes of training data, which are rarely available for downstream tasks. Instead, it has become popular to train models with far larger but less realistic datasets, such as functions with artificially injected bugs. Models trained on such data, however, tend to only perform well on similar data, while underperforming on real world programs. In this paper, we conjecture that this discrepancy stems from the presence of distracting samples that steer the model away from the real-world task distribution. To investigate this conjecture, we propose an approach for identifying the subsets of these large yet unrealistic datasets that are most similar to examples in real-world datasets based on their learned representations. Our approach extracts high-dimensional embeddings of both real-world and artificial programs using a neural model and scores artificial samples based on their distance to the nearest real-world sample. We show that training on only the nearest, representationally most similar samples while discarding samples that are not at all similar in representations yields consistent improvements across two popular pretrained models of code on two code understanding tasks. Our results are promising, in that they show that training models on a representative subset of an unrealistic dataset can help us harness the power of large-scale synthetic data generation while preserving downstream task performance. Finally, we highlight the limitations of applying AI models for predicting vulnerabilities and bugs in real-world applications

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 26 of its 47 references that are in the map. First posted on arXiv 2 Nov 2023.

Builds on

26 of 47 references.

References · 26

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  4. 2020Scaling Laws for Neural Language Modelscited by 6,586
  5. 2017Billion-scale similarity search with GPUscited by 2,497
  6. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  7. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
  8. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  9. 2014Distributed Representations of Sentences and Documentscited by 678
  10. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  11. 2022Beyond neural scaling laws: beating power law scaling via data pruningcited by 528
  12. 2021Unified Pre-training for Program Understanding and Generationcited by 366
14 more
  1. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
  2. 2017Learning to Represent Programs with Graphscited by 220
  3. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
  4. 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 126
  5. 2018Automated Vulnerability Detection in Source Code Using Deep Representation Learningcited by 114
  6. 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
  7. 2018Generative Code Modeling with Graphscited by 60
  8. 2021Self-Supervised Bug Detection and Repaircited by 59
  9. 2020A Survey on Contextual Embeddingscited by 48
  10. 2019Neural Program Repair by Jointly Learning to Localize and Repaircited by 40
  11. 2019How Often Do Single-Statement Bugs Occur? The ManySStuBs4J Datasetcited by 36
  12. 2018The Impact of Class Rebalancing Techniques on the Performance and Interpretation of Defect Prediction Modelscited by 29
  13. 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
  14. 2022On the Use of Fine-grained Vulnerable Code Statements for Software Vulnerability Assessment Modelscited by 5

Built on by

Cited by year

Citing papers per year: 2023: 2; 2024: 3.

5 papers.