Adversarial Robustness Overestimation and Instability in TRADES

Jonathan Weiping Li, Ren-Wei Liang, Cheng-Han Yeh, Cheng-Chang Tsai, Kuanchun Yu, Chun-Shien Lu, Shang-Tse Chen

TL;DR

TRADES, a cornerstone method for adversarial training, can suffer from intermittent "robustness overestimation" due to gradient masking, making models appear highly secure when they are actually vulnerable. This paper identifies the hyperparameter triggers behind this instability and introduces a clever, real-time "active healing" mechanism that injects Gaussian noise to bump the model out of deceptive local minima.

What Problem Does This Paper Address?

Adversarial training is the primary defense mechanism used to make deep neural networks robust against malicious, perturbed inputs. TRADES (TRadeoff-inspired Adversarial DEfense) is one of the most popular and trusted baselines in this domain. It works by minimizing a loss function that balances standard cross-entropy loss with a Kullback-Leibler (KL) divergence term that keeps the model's outputs for clean and adversarial examples close together.

However, the authors discovered a worrying flaw: under certain conditions, TRADES exhibits probabilistic robustness overestimation. A model might show excellent validation accuracy against standard white-box attacks (like PGD-10), giving engineers a false sense of security. Yet, when evaluated against a more rigorous benchmark like AutoAttack (specifically the black-box Square Attack), its performance plummets. The paper reveals that this happens because the model learns to cheat during training via gradient masking—creating a highly rugged, jagged loss landscape that confuses gradient-based optimization attacks without actually making the model robust.

Methods

To diagnose and resolve this instability, the authors leverage two key diagnostic metrics:

  • First-Order Stationary Condition (FOSC): Measures the convergence capability of multi-step adversarial examples. A high FOSC score indicates poor convergence, signaling the presence of gradient masking.
  • Step-wise Gradient Cosine Similarity (SGCS): Evaluates the alignment of gradients across attack steps to assess landscape smoothness.

Instead of relying on computationally expensive hyperparameter grid searches or complete retraining when a model fails, the authors propose a novel active healing solution (Algorithm 1):

  1. During the validation phase of each epoch, the framework monitors the FOSC score.
  2. If the FOSC score exceeds a predefined threshold (indicating the onset of gradient masking), the algorithm intervenes in the next epoch.
  3. It injects standard Gaussian noise ($\mathcal{N}(0, 0.1)$) directly into the input images for the first ten batches of the subsequent epoch. This artificial perturbation disrupts the fragile, masked logit relations and forces the model to take a large optimization step, effectively escaping the problematic local minima.

Datasets

The authors validated their findings and solution across three standard image classification benchmarks:

  • CIFAR-10
  • CIFAR-100 (used as the primary default due to its higher class complexity)
  • Tiny-ImageNet-200

Key Insights and Ideas

  • Hyperparameter Triggers: Robustness overestimation isn't entirely random. The authors found that smaller batch sizes, lower $\beta$ values (which control the weight of the robust loss term), larger learning rates, and higher dataset class complexity all positively correlate with increased training instability.
  • The Push-Pull Trap: Because TRADES optimizes logit-to-logit relationships rather than logit-to-label relationships, the model can overfit to the specific perturbations generated during training. This results in a highly fractured loss landscape.

    Figure 1: Comparison of the data loss landscapes for regular and unstable cases under the same configuration. Following the same setting of Wu et al. (2024); Engstrom et al. (2018); Chen et al. (2021), we plot the loss landscape function z = loss(x · r1 + y · r2), where r1 = sign(∇if(i)) (i is the input data) and r2 ∼Rademacher(0.5). The x and y axes represent the magnitude of the perturbation added in each direction and the z axis represents the loss. One can observe that the loss landscape of the unstable case is highly rugged, which is not expected for a robust model.
  • Natural "Self-Healing": Intriguingly, the authors observed that some unstable training runs naturally fixed themselves. When a model accidentally encountered a highly challenging batch, it triggered a massive gradient step that flattened the loss landscape. This "self-healing" phenomenon directly inspired their proactive noise-injection fix.

    Figure 2: Comparison between the FOSC, SGCS, and PGD-10 validation accuracy. Under the same configuration but with different seeds, the values for the regular case are displayed in (a), while the unstable case is shown in (b). Note that for clearer visualization, we scaled FOSC up by 10. Although the PGD-10 validation accuracy shows only slight fluctuations, both FOSC and SGCS exhibit significant changes within the same epoch, indicating that we can indeed observe gradient masking through this relation.

Key Results

The quantitative impact of the instability—and the success of the fix—is striking:

  • The Flaw Exposed: Under identical default configurations on CIFAR-100, a "Regular" run achieved a reliable AutoAttack accuracy of 20.27%. However, an "Unstable" run showed an inflated PGD-10 validation accuracy of 28.72% but crashed to just 10.42% under AutoAttack.
  • The Cure Works: By applying the active healing noise injection, the "Fixed" models completely eliminated the robustness gap. They achieved 24.50% PGD-10 accuracy and 19.99% AutoAttack accuracy, successfully matching the performance of stable runs without sacrificing clean accuracy or adding significant computational overhead.

Limitations and Future Work

While the paper provides an elegant fix, it focuses almost exclusively on the vanilla TRADES framework. TRADES is a foundational baseline, but many modern, state-of-the-art defense variants exist. Future work will need to determine whether these advanced iterations inherit the same probabilistic gradient masking flaws. Additionally, the authors note that the broader family of logit pairing techniques requires a more unified theoretical analysis to fully map out when these security overestimations are likely to occur.

Summary updated

BibTeX
@misc{li2024adversarial,
  author = {Jonathan Weiping Li and Ren-Wei Liang and Cheng-Han Yeh and Cheng-Chang Tsai and Kuanchun Yu and Chun-Shien Lu and Shang-Tse Chen},
  title = {{Adversarial Robustness Overestimation and Instability in TRADES}},
  year = {2024},
  eprint = {2410.07675},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.07675},
}
Figure