Semantic Robustness of Models of Source Code

02/07/2020
by   Goutham Ramakrishnan, et al.
1

Deep neural networks are vulnerable to adversarial examples - small input perturbations that result in incorrect predictions. We study this problem in the context of models of source code, where we want the network to be robust to source-code modifications that preserve code functionality. We define a natural notion of robustness, k-transformation robustness, in which an adversary performs up to k semantics-preserving transformations to an input program. We show how to train robust models using an adversarial training objective inspired by that of Madry et al. (2018) for continuous domains. We implement an extensible framework for adversarial training over source code, and conduct a thorough evaluation on a number of datasets and two different architectures. Our results show (1) the increase in robustness following adversarial training, (2) the ability of training on weak adversaries to provide robustness to attacks by stronger adversaries, and (3) the shift in attribution focus of adversarially trained models towards semantic vs. syntactic features.

READ FULL TEXT

page 12

page 17

research
06/11/2020

Backdoors in Neural Models of Source Code

Deep neural networks are vulnerable to a range of adversaries. A particu...
research
06/13/2020

ClustTR: Clustering Training for Robustness

This paper studies how encouraging semantically-aligned features during ...
research
02/22/2020

Robustness to Programmable String Transformations via Augmented Abstract Training

Deep neural networks for natural language processing tasks are vulnerabl...
research
08/26/2022

Lower Difficulty and Better Robustness: A Bregman Divergence Perspective for Adversarial Training

In this paper, we investigate on improving the adversarial robustness ob...
research
03/22/2021

Adversarially Optimized Mixup for Robust Classification

Mixup is a procedure for data augmentation that trains networks to make ...
research
02/11/2020

Adversarial Robustness for Code

We propose a novel technique which addresses the challenge of learning a...
research
07/31/2021

Adversarial Robustness of Deep Code Comment Generation

Deep neural networks (DNNs) have shown remarkable performance in a varie...

Please sign up or login with your details

Forgot password? Click here to reset