mlsanityData to 7 Oct 2026

Energy-bounded Learning for Robust Models of Code

arXiv 2112.11226 ↗First posted 20 Dec 2021cs.LG cs.AI cs.PLcited by 1

Not on the map. Why?

Abstract (arXiv)

In programming, learning code representations has a variety of applications, including code classification, code search, comment generation, bug prediction, and so on. Various representations of code in terms of tokens, syntax trees, dependency graphs, code navigation paths, or a combination of their variants have been proposed, however, existing vanilla learning techniques have a major limitation in robustness, i.e., it is easy for the models to make incorrect predictions when the inputs are altered in a subtle way. To enhance the robustness, existing approaches focus on recognizing adversarial samples rather than on the valid samples that fall outside a given distribution, which we refer to as out-of-distribution (OOD) samples. Recognizing such OOD samples is the novel problem investigated in this paper. To this end, we propose to first augment the in=distribution datasets with out-of-distribution samples such that, when trained together, they will enhance the model's robustness. We propose the use of an energy-bounded learning objective function to assign a higher score to in-distribution samples and a lower score to out-of-distribution samples in order to incorporate such out-of-distribution samples into the training process of source code models. In terms of OOD detection and adversarial samples detection, our evaluation results demonstrate a greater robustness for existing source code models to become more accurate at recognizing OOD data while being more resistant to adversarial attacks at the same time. Furthermore, the proposed energy-bounded score outperforms all existing OOD detection scores by a large margin, including the softmax confidence score, the Mahalanobis score, and ODIN.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 40 of its 69 references that are in the map. First posted on arXiv 20 Dec 2021.

Builds on

40 of 69 references.

References · 40

  1. 2017Attention Is All You Needcited by 59,932
  2. 2013Intriguing properties of neural networkscited by 5,114
  3. 2016Towards Evaluating the Robustness of Neural Networkscited by 2,976
  4. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  5. 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
  6. 2017Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networkscited by 1,325
  7. 2015DeepFool: a simple and accurate method to fool deep neural networkscited by 1,315
  8. 2020Energy-based Out-of-distribution Detectioncited by 1,296
  9. 2016Adversarial Machine Learning at Scalecited by 934
  10. 2015Gated Graph Sequence Neural Networkscited by 792
  11. 2017Adversarial Examples for Evaluating Reading Comprehension Systemscited by 568
  12. 2019Your Classifier is Secretly an Energy Based Model and You Should Treat it Like Onecited by 402
28 more
  1. 2018Adversarial Attacks on Neural Networks for Graph Datacited by 395
  2. 2018Adversarial Attack on Graph Structured Datacited by 300
  3. 2018code2vec: Learning Distributed Representations of Codecited by 249
  4. 2018Learning Confidence for Out-of-Distribution Detection in Neural Networkscited by 245
  5. 2016Understanding Neural Networks through Representation Erasurecited by 223
  6. 2017Learning to Represent Programs with Graphscited by 219
  7. 2017Generating Natural Adversarial Examplescited by 182
  8. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  9. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  10. 2018Tree-to-tree Neural Networks for Program Translationcited by 93
  11. 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 90
  12. 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
  13. 2019Adversarial Examples for Models of Codecited by 61
  14. 2018Generative Code Modeling with Graphscited by 59
  15. 2018Structured Neural Summarizationcited by 53
  16. 2020Semantic Robustness of Models of Source Codecited by 43
  17. 2020On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformationscited by 41
  18. 2020Adversarial Robustness for Codecited by 36
  19. 2018Open Category Detection with PAC Guaranteescited by 35
  20. 2019Automatic Testing and Improvement of Machine Translationcited by 35
  21. 2020A Systematic Literature Review on the Use of Deep Learning in Software Engineering Researchcited by 35
  22. 2015Learning Local Image Descriptors with Deep Siamese and Triplet Convolutional Networks by Minimising Global Loss Functionscited by 33
  23. 2020Testing Machine Translation via Referential Transparencycited by 19
  24. 2021Deep Learning for Android Malware Defenses: a Systematic Literature Reviewcited by 18
  25. 2020TreeCaps: Tree-Based Capsule Networks for Source Code Processingcited by 16
  26. 2017DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learningcited by 8
  27. 2019PatchNet: A Tool for Deep Patch Classificationcited by 5
  28. 2019Learning Blended, Precise Semantic Program Embeddingscited by 5

Built on by

Cited by year

Citing papers per year: 2022: 1.

1 paper.