Interpretability and Adversarial Examples

Consider a deployed image classifier that labels a chest X-ray as "pneumonia" with 99.7% confidence. A radiologist wants to know why. Did the network find a real infiltrate? Or did it latch onto a hospital-specific watermark stamped in the corner? At the same time, a security researcher discovers something troubling. Adding a perturbation invisible to the human eye flips the same network's prediction to "healthy." These two problems — explaining what a network has learned and breaking what it has learned — turn out to be two faces of the same coin. Both are questions about the local geometry of the function the network computes. Interpretability methods try to attribute a prediction to input features. They use gradients, perturbations, or surrogate models to answer "what mattered?" Adversarial examples exploit the same gradient information in reverse. They ask "what tiny change would matter most?" A classifier's decision boundary can pass extremely close to a correctly classified point. This can happen in some high-dimensional direction. Yet the point sits deep inside its class region along directions humans perceive as meaningful. Understanding this geometry is essential for deploying deep networks in medicine, finance, autonomous driving, and any setting where trust and safety are non-negotiable. This article builds the machinery from the ground up. It covers gradient-based saliency maps and their sanity checks. It covers perturbation-based attribution (occlusion, LIME, SHAP). It covers the fast gradient sign method and projected gradient descent for generating adversarial examples. It also covers adversarial training as the leading defense. Throughout we connect the two threads explicitly. Saliency and adversarial perturbations are both linearizations of the network around an input. Improving one often (but not always) improves the other. By the end you will be able to derive FGSM and PGD from first principles. You will implement a gradient saliency map and an occlusion map. You will explain why naive saliency maps can be fooled. You will also reason about the accuracy–robustness tradeoff that adversarial training induces.

Key takeaways
  • Saliency maps use the gradient of the output with respect to the input to highlight influential pixels/features, but raw gradients are noisy and can be manipulated.
  • Perturbation-based methods (occlusion, LIME, SHAP) treat the model as a black box and estimate feature importance by observing output changes when features are masked or perturbed.
  • Adversarial examples are small, often imperceptible input perturbations, found via gradient ascent on the loss, that cause misclassification.
  • FGSM is a one-step linear-approximation attack; PGD is its iterative, stronger cousin — the current default for evaluating robustness.
  • Adversarial training (min-max optimization: minimize loss against a worst-case perturbation) is the most reliable known defense, at the cost of accuracy and compute.
  • Interpretability and adversarial robustness are linked through the same local gradient geometry — a model's explanation can itself be attacked.
The core insight

Interpretability and adversarial vulnerability both stem from the same source: the local, often highly non-robust, gradient geometry of a high-dimensional learned decision function.

The idea

Interpretability in deep learning means producing a human-understandable explanation for a model's prediction. Feature attribution is the dominant paradigm: assign each input feature (pixel, word, tabular column) a real-valued score indicating how much it contributed to the output. Gradient-based methods compute ∂fc(x)/∂xi\partial f_c(x) / \partial x_i, the sensitivity of the class-cc logit or probability to feature ii, exploiting the same backpropagation machinery used for training. Perturbation-based methods instead treat the network as a black box, measuring fc(x)−fc(x∖i)f_c(x) - f_c(x \setminus i), the change in output when feature ii is removed or altered, possibly averaged over many subsets (as in Shapley-value methods). An adversarial example is an input x′=x+δx' = x + \delta such that δ\delta is small under some norm (∥δ∥∞≤ϵ\|\delta\|_\infty \le \epsilon is standard), x′x' looks unchanged to a human, yet the model's prediction on x′x' differs from its prediction on xx (untargeted attack) or matches a specific attacker-chosen class (targeted attack). Adversarial examples exist because a deep network's decision boundary, while achieving low error on the data distribution, can pass surprisingly close to individual data points in directions orthogonal to the manifold of "natural" variation. The network is locally almost-linear in many directions (a consequence of piecewise-linear activations like ReLU and near-linear layers), so a well-aligned perturbation of tiny magnitude, when summed over thousands of input dimensions, produces a large change in the pre-activation logits — this is the linear explanation of adversarial vulnerability. The connective tissue between the two topics is the gradient of the loss with respect to the input, ∇xL(f(x),y)\nabla_x \mathcal{L}(f(x), y). Saliency maps visualize this gradient (or a variant of it) to explain a prediction. Adversarial attacks use this same gradient, but instead of visualizing it, they walk along it to change the prediction. This shared object explains why saliency maps can be brittle (a small adversarial-style perturbation that leaves the prediction almost unchanged can drastically alter the saliency map) and why the search for robust interpretability and adversarial robustness are studied together under the umbrella of GAN Training Dynamics and Failure Modes-adjacent research on stable, trustworthy generative and discriminative models.

How it works

We separate the mechanism into three pipelines: (1) gradient-based attribution, (2) perturbation-based attribution, and (3) adversarial example generation, followed by (4) the standard defense.

1. Gradient (vanilla) saliency. For input x∈Rdx \in \mathbb{R}^d and target class cc, compute

S(x)i=∣∂fc(x)∂xi∣,S(x)_i = \left| \frac{\partial f_c(x)}{\partial x_i} \right|,

a single backward pass. Variants smooth this out:

  • SmoothGrad: average the gradient over many noisy copies of xx to reduce visual noise.
  • Integrated Gradients: integrate the gradient along a straight-line path from a baseline x0x_0 (e.g., all-black image) to xx, which satisfies a completeness axiom (attributions sum exactly to fc(x)−fc(x0)f_c(x) - f_c(x_0)).
  • Grad-CAM: use gradients flowing into the last convolutional layer, weighted and summed with the layer's activations, to produce a coarse class-discriminative heatmap.

2. Perturbation-based attribution.

  • Occlusion: slide a gray/black patch over the image, recording the drop in fcf_c at each location; large drops indicate important regions. Cost is one forward pass per patch position, O(d/k2)O(d/k^2) forward passes for patch size kk.
  • LIME: sample perturbed versions of xx (e.g., randomly zero out superpixels), fit a local, interpretable linear (or sparse linear) model to the black-box outputs on these samples, and read off the linear model's weights as attributions.
  • SHAP: define attribution via Shapley values from cooperative game theory — the unique attribution scheme satisfying efficiency, symmetry, dummy, and additivity axioms, approximated because exact computation is O(2d)O(2^d).

3. Adversarial example generation. Fast Gradient Sign Method (FGSM) — a single step in the direction that locally maximizes the loss:

x′=x+ϵ⋅sign(∇xL(f(x),y)).x' = x + \epsilon \cdot \mathrm{sign}\big(\nabla_x \mathcal{L}(f(x), y)\big).

This is the first-order (linear) approximation to the constrained maximization max⁡∥δ∥∞≤ϵL(f(x+δ),y)\max_{\|\delta\|_\infty \le \epsilon} \mathcal{L}(f(x+\delta), y): linearizing L\mathcal{L} around xx, L(x+δ)≈L(x)+δ⊤∇xL\mathcal{L}(x+\delta) \approx \mathcal{L}(x) + \delta^\top \nabla_x \mathcal{L}, and the δ\delta maximizing δ⊤g\delta^\top g subject to ∥δ∥∞≤ϵ\|\delta\|_\infty \le \epsilon is exactly ϵ⋅sign(g)\epsilon \cdot \mathrm{sign}(g) (Hölder duality between ℓ∞\ell_\infty and ℓ1\ell_1). Projected Gradient Descent (PGD) — the iterative, stronger version, essentially multi-step FGSM with a projection back onto the ϵ\epsilon-ball after every step:

x(t+1)=ΠB∞(x,ϵ)(x(t)+α⋅sign(∇xL(f(x(t)),y))).x^{(t+1)} = \Pi_{B_\infty(x,\epsilon)}\Big(x^{(t)} + \alpha \cdot \mathrm{sign}\big(\nabla_x \mathcal{L}(f(x^{(t)}), y)\big)\Big).

PGD is widely treated as a near-worst-case first-order attack and is the standard benchmark for "adversarial robustness."

4. Adversarial training (defense). Replace the standard empirical risk minimization objective with a robust (min-max) objective:

min⁡θ  E(x,y)∼D[max⁡∥δ∥∞≤ϵL(fθ(x+δ),y)].\min_{\theta} \; \mathbb{E}_{(x,y)\sim \mathcal{D}} \Big[ \max_{\|\delta\|_\infty \le \epsilon} \mathcal{L}(f_\theta(x+\delta), y) \Big].

The inner maximization is approximated at each training step using PGD (or FGSM for speed), and the outer minimization is a standard gradient step on θ\theta using the adversarial example in place of the clean one. ```

# ---- Gradient saliency map ---- function GRADIENT_SALIENCY(model, x, target_class): x.requires_grad = True logits = model.forward(x) loss = logits[target_class] loss.backward() # one backprop pass return abs(x.grad) # same shape as x

# ---- Occlusion-based attribution ---- function OCCLUSION_MAP(model, x, patch_size, baseline_value): base_score = model.forward(x)[target_class] heatmap = zeros_like(x) for each top-left position p in stride grid over x: x_occluded = copy(x) x_occluded[patch at p] = baseline_value score = model.forward(x_occluded)[target_class] heatmap[patch at p] += (base_score - score) # accumulate drop return heatmap # normalize by overlap count if strided

# ---- FGSM attack ---- function FGSM(model, x, y, epsilon): x.requires_grad = True loss = cross_entropy(model.forward(x), y) grad = gradient(loss, x) x_adv = x + epsilon * sign(grad) x_adv = clip(x_adv, valid_input_range) # e.g. [0,1] for images return x_adv

# ---- PGD attack ---- function PGD(model, x, y, epsilon, alpha, num_steps): x_adv = x + uniform_noise(-epsilon, epsilon) # random start (recommended) x_adv = clip(x_adv, valid_input_range) for t in 1..num_steps: x_adv.requires_grad = True loss = cross_entropy(model.forward(x_adv), y) grad = gradient(loss, x_adv) x_adv = x_adv + alpha * sign(grad) delta = clip(x_adv - x, -epsilon, epsilon) # project onto L_inf ball x_adv = clip(x + delta, valid_input_range) # project onto valid range return x_adv

# ---- Adversarial training (outer loop) ---- function ADVERSARIAL_TRAIN(model, data_loader, epsilon, alpha, num_steps, epochs): for epoch in 1..epochs: for (x, y) in data_loader: x_adv = PGD(model, x, y, epsilon, alpha, num_steps) # inner max loss = cross_entropy(model.forward(x_adv), y) # outer min update_parameters(model, gradient(loss, model.parameters)) return model ```

Figure
Shared gradient pathway: attribution reads it, attacks follow it, training hardens against it
Input x (e.g. image, label y) Network f_θ(x) forward + backward pass ∇ₓ L(f(x), y) shared gradient Saliency map visualize |∂f/∂x| "what did the model look at?" FGSM / PGD attack step along sign(∇) "what tiny change flips the label?" Adversarial training min-max over δ hardens boundary adversarial examples become training data Same tensor, opposite use: explain vs. exploit vs. defend

Complexity & correctness

Gradient saliency. One forward pass plus one backward pass, i.e., the same O(cost of one training step)O(\text{cost of one training step}) as ordinary backpropagation — typically O(L⋅w2)O(L \cdot w^2) time for an LL-layer network with width ww per layer (dominated by matrix multiplications), and O(L⋅w)O(L \cdot w) auxiliary memory to store activations for the backward pass. This is why gradient saliency is cheap and ubiquitous. Correctness caveat: the raw gradient is only a first-order local approximation; it does not certify that the highlighted pixels are causally necessary, only that infinitesimal perturbation there changes the logit fastest. Saturating activations (e.g., a ReLU firmly in its flat regime, or a softmax near 0/1) can make the gradient vanish for features that are nonetheless important, motivating Integrated Gradients, which fixes this via the fundamental theorem of calculus:

IGi(x)=(xi−x0,i)∫01∂fc(x0+t(x−x0))∂xi dt,\text{IG}_i(x) = (x_i - x_{0,i}) \int_0^1 \frac{\partial f_c(x_0 + t(x-x_0))}{\partial x_i}\, dt,

guaranteeing ∑iIGi(x)=fc(x)−fc(x0)\sum_i \text{IG}_i(x) = f_c(x) - f_c(x_0) exactly (completeness), at the cost of O(m)O(m) forward/backward passes for an mm-step Riemann approximation of the integral.

Occlusion. O(d/k2)O(d/k^2) forward passes for a dd-dimensional input and k×kk\times k patches (or O(d)O(d) if occluding one feature at a time), each an O(one forward pass)O(\text{one forward pass}) cost — so total time O((d/k2)⋅fwd-cost)O((d/k^2)\cdot \text{fwd-cost}). No gradient needed, so it works for non-differentiable models too, but it can miss feature interactions: occluding two jointly-necessary pixels separately may show no effect individually.

LIME/SHAP. LIME costs O(N)O(N) black-box queries for NN sampled perturbations, plus fitting a linear model, O(N⋅d′)O(N \cdot d') for d′d' interpretable features (e.g., superpixels) — cheap and model-agnostic, but the explanation depends on the sampling distribution and kernel width, hence not guaranteed stable across random seeds. Exact Shapley values require evaluating the model on all 2d2^d feature subsets (an exponential-time coalitional game computation); this is proven to be the unique attribution satisfying efficiency, symmetry, dummy, and additivity, but practically approximated via sampling (KernelSHAP, O(N)O(N) samples) or exploiting model structure (TreeSHAP, polynomial time for tree ensembles).

FGSM. O(1)O(1) forward and backward pass — as cheap as one training step. It is a provably optimal single linear step under the ℓ∞\ell_\infty-ball constraint (by the Hölder-duality argument above), but because real networks are only locally, not globally, linear, one step often undershoots the true worst-case perturbation.

PGD. O(T)O(T) forward/backward passes for TT steps — T×T\times the cost of FGSM. PGD approximately solves the inner maximization max⁡∥δ∥∞≤ϵL(x+δ,y)\max_{\|\delta\|_\infty\le\epsilon} \mathcal{L}(x+\delta,y), a non-convex problem in general (since L∘f\mathcal{L}\circ f is non-convex in xx), so PGD gives no global optimality guarantee, but empirically with random restarts and enough steps it is accepted as a strong proxy for the worst case, and is far harder to "gradient mask" against than FGSM.

Adversarial training. Each training step now costs O(T)O(T) times a normal step (for the inner PGD loop), so total training time is O(T⋅epochs⋅∣D∣/B⋅fwd-bwd cost)O(T \cdot \text{epochs} \cdot |\mathcal{D}|/B \cdot \text{fwd-bwd cost}) for batch size BB — often 3–10× slower than standard training in practice (T∈[3,10]T \in [3,10] typically for reasonable defenses via fast variants). Its correctness rests on solving a min-max game: if the inner maximization were solved exactly, the outer minimization would converge (under standard SGD assumptions) to parameters that are locally loss-robust within the ϵ\epsilon-ball around every training point — but since PGD only approximately solves the inner problem, the resulting robustness is only empirical, not certified, and can be broken by stronger, unseen attacks (a repeated historical pattern — see Pitfalls). Certified defenses (randomized smoothing, interval bound propagation) trade some accuracy for provable guarantees but are outside adversarial training's scope.

The tradeoff. There is a well-documented accuracy–robustness tradeoff: making a classifier robust to ℓ∞\ell_\infty-perturbations of radius ϵ\epsilon tends to reduce clean accuracy, because the robust optimum forces the decision boundary to keep a margin of at least ϵ\epsilon everywhere, which can conflict with fitting the true (non-robust but predictive) features present in the data — some features that are predictive for clean accuracy are, by construction, non-robust (small perturbations flip them), and adversarial training suppresses reliance on them.

Worked example

Take a small logistic-regression-style linear classifier operating on a 4-pixel toy "image" x=(x1,x2,x3,x4)x = (x_1,x_2,x_3,x_4), with weight vector w=(2,−1,3,−4)w = (2, -1, 3, -4) for class "cat" (logit z=w⊤xz = w^\top x, sigmoid probability). Suppose the true image is x=(0.9,0.1,0.8,0.2)x = (0.9, 0.1, 0.8, 0.2), giving

z=2(0.9)+(−1)(0.1)+3(0.8)+(−4)(0.2)=1.8−0.1+2.4−0.8=3.3,z = 2(0.9) + (-1)(0.1) + 3(0.8) + (-4)(0.2) = 1.8 - 0.1 + 2.4 - 0.8 = 3.3,

a confident "cat" prediction (σ(3.3)≈0.964\sigma(3.3) \approx 0.964).

Saliency: the gradient of zz with respect to xx is simply ww itself (linear model), so ∣∇xz∣=(2,1,3,4)|\nabla_x z| = (2, 1, 3, 4) — pixel 4 has the largest-magnitude gradient despite the smallest input value, because its weight is largest in magnitude. This already illustrates a subtlety: raw gradient saliency measures sensitivity, not the pixel's actual contribution to the current logit. The actual per-feature contribution to zz is wixi=(1.8,−0.1,2.4,−0.8)w_i x_i = (1.8, -0.1, 2.4, -0.8), which ranks pixel 1 and 3 as the true drivers of the positive logit — pixel 4 contributes negatively despite having the largest gradient magnitude. This gap between "sensitivity" and "contribution" is exactly why Integrated Gradients multiplies the gradient by (xi−x0,i)(x_i - x_{0,i}) rather than reporting the gradient alone.

FGSM attack with ϵ=0.05\epsilon = 0.05, attacking the "cat" logit to push it toward "not cat" (untargeted, so we ascend the loss, i.e., move xx in the direction that decreases zz, which is −sign(w)-\mathrm{sign}(w) scaled by ϵ\epsilon for a class where lower zz means the loss for label "cat" increases):

δ=ϵ⋅sign(−w)=0.05⋅(−1,1,−1,1)=(−0.05,0.05,−0.05,0.05).\delta = \epsilon \cdot \mathrm{sign}(-w) = 0.05 \cdot (-1,1,-1,1) = (-0.05, 0.05, -0.05, 0.05).
x′=(0.85,0.15,0.75,0.25).x' = (0.85, 0.15, 0.75, 0.25).

New logit:

z′=2(0.85)−1(0.15)+3(0.75)−4(0.25)=1.7−0.15+2.25−1.0=2.8.z' = 2(0.85) - 1(0.15) + 3(0.75) - 4(0.25) = 1.7 - 0.15 + 2.25 - 1.0 = 2.8.

The logit dropped from 3.33.3 to 2.82.8 (σ(2.8)≈0.943\sigma(2.8)\approx 0.943) — a real but modest change from one FGSM step, changing each pixel by at most 0.050.05, imperceptible in an actual image with 8-bit intensities (a shift of about 13/255 gray levels).

PGD, run for T=3T=3 steps with step size α=0.03\alpha = 0.03 and the same ϵ=0.05\epsilon=0.05 box, would repeat this signed-gradient step three times, clipping to stay within ±0.05\pm 0.05 of the original xx each time; since the model is linear here the gradient direction never changes, so PGD converges immediately to the same corner of the ℓ∞\ell_\infty ball as one large FGSM step — x∗=(0.85,0.15,0.75,0.25)x^* = (0.85, 0.15, 0.75, 0.25) — illustrating that for (locally) linear models FGSM is already optimal, while for deep nonlinear networks the direction changes step to step and PGD typically finds a substantially harder (lower-loss-for-attacker) point than FGSM.

QuantityClean xxFGSM x′x'PGD (3 steps)
x4x_40.200.250.25
logit zz3.302.802.80
P(cat)P(\text{cat})0.9640.9430.943
∥δ∥∞\|\delta\|_\infty00.050.05

Now suppose adversarial training is applied: the model retrains using (x′,y=cat)(x', y=\text{cat}) instead of (x,y)(x,y) at every step. Because x′x' has systematically smaller cat-aligned features (the attack pushes toward z=2.8z=2.8), the optimizer must increase reliance on the still-robust, high-weight features (x1,x3x_1, x_3) and can no longer coast on borderline sensitivity to x2,x4x_2, x_4; over many epochs the learned weights shift toward larger ∣w1∣,∣w3∣|w_1|, |w_3| and smaller ∣w2∣,∣w4∣|w_2|, |w_4|, precisely the "suppress non-robust features" mechanism described in Complexity & correctness.

Common pitfalls & traps

PitfallWhy it happensConsequence
Trusting raw gradient saliency as ground truthGradient measures local sensitivity, not causal contribution; saturating units can zero the gradient for important featuresMisleading heatmaps that don't match human intuition or true feature importance
Saliency maps unchanged by randomizing model weights (failed sanity check)Some methods (e.g., naive Guided Backprop) are dominated by input edge-detection artifacts, not learned weightsAn "explanation" method that explains the input, not the model
Confusing FGSM success with true robustness evaluationFGSM is a weak, single-step attack; models can appear robust to it via gradient maskingFalse sense of security — PGD or stronger attacks later break the model
Gradient masking (obfuscated gradients)Some defenses make gradients uninformative (e.g., non-differentiable preprocessing) without removing the underlying vulnerabilityBlack-box or adaptive attacks still succeed; robustness claims are illusory
Evaluating robustness only in-distribution, with fixed ϵ\epsilonReal threat models may allow different norms (ℓ2\ell_2, ℓ0\ell_0), unbounded semantic perturbations, or adaptive attackersOverestimating deployed robustness
Ignoring the accuracy–robustness tradeoff when reporting resultsRobust accuracy and clean accuracy are both context-dependent; reporting only one hides the costMisleading comparisons between defenses

Pioneers & history

!A researcher's portrait placeholder representing the adversarial-examples and interpretability research lineage

Origins · 1 minIan J. Goodfellow and how this was discovered
IJ
Ian J. Goodfellow
b. 1985 · Co-discovered adversarial examples' linear explanation and proposed FGSM and adversarial training, while also inventing GANs, tying interpretability and generative modeling into one intellectual thread

History
2013
— Szegedy et al. demonstrate that imperceptible perturbations reliably fool state-of-the-art image classifiers, coining "adversarial examples."
2014
— Goodfellow, Shlens, and Szegedy propose the linear explanation of adversarial vulnerability and introduce the Fast Gradient Sign Method.
2016
— Ribeiro, Singh, and Guestrin introduce LIME, popularizing model-agnostic local surrogate explanations.
2017
— Madry et al. formalize adversarial training as a min-max robust optimization problem and establish PGD as the standard strong first-order attack.
2018
— Athalye, Carlini, and Wagner show that many published defenses rely on "obfuscated gradients" and break under adaptive attacks, resetting evaluation standards field-wide.

Where this matters

Interpretability tooling built on saliency and attribution methods is embedded in production ML platforms (e.g., model cards and explanation dashboards in cloud ML services) and is a regulatory expectation in domains like credit scoring and medical diagnosis, where "right to explanation" rules require some human-interpretable justification for automated decisions. Radiology and pathology AI tools use Grad-CAM-style heatmaps so clinicians can sanity-check whether a model is looking at the lesion rather than a scanner artifact. Autonomous vehicle perception stacks and biometric authentication systems are stress-tested against adversarial patches and perturbations before deployment, since a single misclassified stop sign or spoofed face can have safety consequences. Financial fraud-detection and spam-filtering systems face adversaries who actively probe models for blind spots, making adversarial robustness a live security concern, not just an academic curiosity. Adversarial training and its variants are now standard benchmarks (e.g., RobustBench) used by researchers building on GAN Training Dynamics and Failure Modes-related generative defenses, gradients-based attack/defense loops, and general robust classification pipelines across vision, speech, and tabular domains.

Ask the tutor: How does the accuracy–robustness tradeoff change as the perturbation budget ϵ\epsilon grows, and is there a principled way to choose ϵ\epsilon for a given deployment?

Are adversarial examples a bug in specific architectures, or a general phenomenon?

They are general. Adversarial examples have been demonstrated across convolutional networks, transformers, linear models, and even some non-neural classifiers, because the underlying cause — a high-dimensional input space where the decision boundary can lie close to data points along directions not aligned with human-perceptible features — is a property of the learning problem and geometry, not one specific architecture. The linear explanation (Goodfellow et al., 2014) shows that even a purely linear classifier can be fooled if the input dimensionality is high enough: summing many small, well-aligned per-pixel perturbations produces a large logit change. This is why defenses focus on training procedures and loss landscapes rather than architecture tweaks alone.

Does higher clean accuracy imply better interpretability or robustness?

No — these are largely independent axes. A model can achieve very high clean accuracy while relying on spurious, non-robust, or non-human-interpretable features (the "Clever Hans" phenomenon), making it both hard to trust and easy to attack. Conversely, adversarially trained models are often somewhat more interpretable: their saliency maps tend to align better with human-perceptible object boundaries, because robust training suppresses reliance on brittle, high-frequency, non-robust features. This observed correlation (robust models having more "human-aligned" gradients) is one of the more striking empirical links between the two topics, though it comes at a cost in clean accuracy.

Why does adversarial training reduce clean accuracy?

Adversarial training optimizes a robust objective that requires the model to be correct not just at each training point but within an entire ϵ\epsilon-ball around it. Some features that are strongly predictive of the true label in the clean data distribution are "non-robust" — an adversary can flip them with a tiny perturbation — and the robust objective actively discourages relying on them. Removing access to these predictive-but-fragile features leaves less signal for the model to fit, which typically lowers accuracy on the clean, non-adversarial test distribution. This tradeoff is empirically consistent across datasets and architectures, though its severity depends on ϵ\epsilon and model capacity.

How should I evaluate whether a proposed defense actually works?

Never trust robustness numbers reported only against a fixed, weak attack (e.g., a single FGSM step) or against the exact attack the defense was designed to withstand. Best practice is to run multiple strong attacks (PGD with random restarts, adaptive white-box attacks tailored to the defense's specific mechanism, and ideally a black-box transfer attack), check for signs of gradient masking (e.g., robustness that vanishes under a slightly different loss surrogate or increases with more optimization steps in a suspicious way), and, where feasible, compare against certified robustness bounds that give provable guarantees rather than empirical resistance to known attacks.

What is the difference between targeted and untargeted adversarial attacks?

An untargeted attack only needs to cause any misclassification — it maximizes the loss for the true label, pushing the prediction away from the correct class in whatever direction is easiest. A targeted attack must cause the model to output a specific attacker-chosen wrong class, which is a harder optimization problem since it constrains the direction of the perturbation. Practically, targeted attacks are implemented by minimizing the loss with respect to the target label rather than maximizing loss with respect to the true label, and they typically require larger perturbation budgets or more iterations than untargeted attacks to succeed reliably.

Can perturbation-based methods like LIME and SHAP explain any model, including non-differentiable ones?

Yes, that is their main advantage over gradient-based methods: they only require query access to the model's output (a forward pass), not differentiability, so they apply equally to decision trees, random forests, gradient-boosted models, or black-box APIs. The cost is computational — LIME requires many perturbed samples per explanation and its result depends on sampling and kernel choices, while exact Shapley values are exponential in the number of features, requiring approximations (KernelSHAP) or model-specific shortcuts (TreeSHAP for tree ensembles) to be practical at scale.

Is there a fundamental tradeoff between interpretability and adversarial robustness, or can we have both?

They are not fundamentally opposed; empirically, robust models often show more human-aligned saliency maps, suggesting the two can be complementary rather than conflicting. However, achieving both simultaneously with high clean accuracy remains an open challenge: robust training reduces reliance on brittle predictive features (helping interpretability) but also reduces raw predictive power (hurting accuracy), and no known method fully decouples robustness, interpretability, and accuracy without sacrificing at least one to some degree.

Before this