Adversarial Examples for Models of Code
summary
Claims a first adversarial attack on models of code and provides a concrete algorithm DAMP that computes gradients on token embeddings to propose new variable names, plus a dead-code insertion trick. It breaks code2vec, GGNN and GNN‑FiLM more often than TFIDF and random baselines, with dead-code attacks being harder and GNN‑FiLM showing more robustness. Defenses include adversarial training and an outlier-variable removal that trades ~2% accuracy loss for much higher robustness; 100% robustness with NoVars is possible but costs ~20% accuracy. GitHub hosts the code.
AI-written summary · about
chapters (16)
- 0:00Intro
- 0:48Name-based bug detection
- 0:59Learning Distribution Representation of Code
- 1:19Neural Networks are Vulnerable to Adversarial Examples
- 1:40Adversarial examples for models of code
- 2:27Background: Neural networks in 30 seconds
- 3:26Background: Distributed Representations ("embeddings")
- 4:25What does "adding noise" mean in programs?
- 4:45Adding noise: renaming variables
- 5:17Discrete Adversarial Manipulation of Programs (DAMP)
- 7:48Examples - Code Vec
- 8:56Examples - Code2Vec (Dead code)
- 9:40Results - Code2Vec Robustness (%) (lower is better)
- 11:13Results - Graph Neural Nets Robustness (%) (lower is better)
- 11:56Defending against adversarial attacks
- 12:58Results - Code2Vec Performance vs. Robustness (higher is better) Performance
related talks
21mTricking Neural Networks : Explore Adversarial Attacks
38mUsing adversarial samples to robustify your Neural Network Models
25mTricking Neural Networks : Explore Adversarial Attacks
36mAdversarial Attacks on Deep Learning
48mStay Ahead of Adversarial AI in OT/ICS Environments – Mitigating CWE-1039
21mAdversarial Attacks
36mAdversarial Machine Learning: How Secure Is ML?
31mThe dark side of deep learning
