Table of Contents
Fetching ...

When Flatness Does (Not) Guarantee Adversarial Robustness

Nils Philipp Walter, Linara Adilova, Jilles Vreeken, Michael Kamp

TL;DR

The paper formalizes how relative flatness in the penultimate layer relates to adversarial robustness, showing flatness yields local, but not global, guarantees. By deriving a closed-form expression for the penultimate-layer Hessian and bounding loss changes via a loss-based adversarial framework, it links curvature, model confidence, and input perturbations. Empirical findings validate the theory and reveal the Uncanny Valley: adversarial examples often lie in large, flat, high-confidence regions, challenging the notion that flat minima imply robust correctness. The work suggests that achieving true global robustness requires notions of flatness that decouple feature-space stability from final-layer confidence and aligns robustness analysis with input-space geometry and model confidence.

Abstract

Despite their empirical success, neural networks remain vulnerable to small, adversarial perturbations. A longstanding hypothesis suggests that flat minima, regions of low curvature in the loss landscape, offer increased robustness. While intuitive, this connection has remained largely informal and incomplete. By rigorously formalizing the relationship, we show this intuition is only partially correct: flatness implies local but not global adversarial robustness. To arrive at this result, we first derive a closed-form expression for relative flatness in the penultimate layer, and then show we can use this to constrain the variation of the loss in input space. This allows us to formally analyze the adversarial robustness of the entire network. We then show that to maintain robustness beyond a local neighborhood, the loss needs to curve sharply away from the data manifold. We validate our theoretical predictions empirically across architectures and datasets, uncovering the geometric structure that governs adversarial vulnerability, and linking flatness to model confidence: adversarial examples often lie in large, flat regions where the model is confidently wrong. Our results challenge simplified views of flatness and provide a nuanced understanding of its role in robustness.

When Flatness Does (Not) Guarantee Adversarial Robustness

TL;DR

The paper formalizes how relative flatness in the penultimate layer relates to adversarial robustness, showing flatness yields local, but not global, guarantees. By deriving a closed-form expression for the penultimate-layer Hessian and bounding loss changes via a loss-based adversarial framework, it links curvature, model confidence, and input perturbations. Empirical findings validate the theory and reveal the Uncanny Valley: adversarial examples often lie in large, flat, high-confidence regions, challenging the notion that flat minima imply robust correctness. The work suggests that achieving true global robustness requires notions of flatness that decouple feature-space stability from final-layer confidence and aligns robustness analysis with input-space geometry and model confidence.

Abstract

Despite their empirical success, neural networks remain vulnerable to small, adversarial perturbations. A longstanding hypothesis suggests that flat minima, regions of low curvature in the loss landscape, offer increased robustness. While intuitive, this connection has remained largely informal and incomplete. By rigorously formalizing the relationship, we show this intuition is only partially correct: flatness implies local but not global adversarial robustness. To arrive at this result, we first derive a closed-form expression for relative flatness in the penultimate layer, and then show we can use this to constrain the variation of the loss in input space. This allows us to formally analyze the adversarial robustness of the entire network. We then show that to maintain robustness beyond a local neighborhood, the loss needs to curve sharply away from the data manifold. We validate our theoretical predictions empirically across architectures and datasets, uncovering the geometric structure that governs adversarial vulnerability, and linking flatness to model confidence: adversarial examples often lie in large, flat regions where the model is confidently wrong. Our results challenge simplified views of flatness and provide a nuanced understanding of its role in robustness.
Paper Structure (40 sections, 9 theorems, 81 equations, 16 figures, 1 table)

This paper contains 40 sections, 9 theorems, 81 equations, 16 figures, 1 table.

Key Result

Lemma 6

Let $f=g(\mathbf{w}\phi(x))$ be a model with $\phi$$L$-Lipschitz and $\|\phi(x)\|\geq r$, and $\xi,x\in\mathcal{X}$ with $\|\xi - x\|\leq \delta$, then there exists a $\Delta>0$ with $\Delta \leq L\delta r^{-1}$, such that $\phi(\xi)=\phi(x)+\Delta A\phi(x)$, where $A$ is an orthogonal matrix.

Figures (16)

  • Figure 1: Flatness shapes robustness through the network. Flatness in parameter space (left) implies a minimum robustness radius in feature space (center), which maps back to warped but bounded regions in input space (right). This illustrates how local flatness in the weight space of the penultimate layer translates into localized but non-uniform robustness in the input space.
  • Figure 2: Loss geometry.(a) We report the distribution of the loss increase for varying scaling values. (b) We show for one example how the basin formes as we increase the scaling. We use the normalized loss to plot all in one axis. (c) We show examples of samples exhibiting different basin widths. (d) We plot the sharpness measured at the test data ($s=1$) and the basin width.
  • Figure 3: Uncanny Valley. On the PGD-trajectory, sharpness quickly peaks and then decreases to zero, while loss keeps increasing.
  • Figure 4: Loss geometry forVGG11 .(a) We report the distribution of the loss increase for varying scaling values. (b) We show for one example how the basin formes as we increase the scaling. We use the normalized loss to plot all in one axis. (c) We show examples of samples exhibiting different basin widths. (d) We plot the sharpness measured at the test data ($s=1$) and the basin width.
  • Figure 5: Loss geometry forVGG11 on CIFAR-100.(a) We report the distribution of the loss increase for varying scaling values. (b) We show for one example how the basin formes as we increase the scaling. We use the normalized loss to plot all in one axis. (c) We show examples of samples exhibiting different basin widths. (d) We plot the sharpness measured at the test data ($s=1$) and the basin width.
  • ...and 11 more figures

Theorems & Definitions (21)

  • Definition 1: Prediction-change adversarial example szegedy2014intriguing
  • Definition 2: Prediction-change Pointwise Robustness
  • Definition 3: Prediction-change Dataset Robustness
  • Definition 4: Loss-change adversarial example
  • Definition 5: Loss-change robustness
  • Definition 6: Loss-change dataset robustness
  • Lemma 6
  • Proposition 7
  • Proposition 8
  • Lemma 8
  • ...and 11 more