Imbalanced Gradients: A New Cause of Overestimated Adversarial Robustness

Linxi Jiang, Xingjun Ma, Zejia Weng, James Bailey, Yu-Gang Jiang

Introduction

In the ongoing development of adversarial machine learning, researchers frequently encounter a frustrating cycle: new defenses are proposed, only to be quickly circumvented by more sophisticated attacks. A primary reason for this is gradient masking (or obfuscated gradients), where a model's gradients become uninformative for optimization, creating a false sense of security.

This paper identifies a more nuanced and deceptive failure mode: Imbalanced Gradients (IG). Unlike traditional gradient masking, IG occurs in models where gradients are mathematically sound and pass standard sanity checks. However, because one term in a multi-part loss function dominates the gradient signal, the resulting optimization path is steered toward suboptimal regions where the model appears robust. To expose this vulnerability, the authors introduce the Gradient Imbalance Ratio (GIR) and the Margin Decomposition (MD) attack.

The Imbalanced Gradient Phenomenon

Standard adversarial attacks typically aim to maximize a margin loss, defined as $L = z_{max} - z_y$, where $z_y$ is the logit of the correct class and $z_{max}$ is the maximum logit among incorrect classes. The gradient of this loss is the sum of two components: $\nabla_x z_{max}$ and $\nabla_x (-z_y)$.

Imbalanced Gradients occur when the magnitude of one of these components significantly outweighs the other. As illustrated in Figure 1, if the gradient of the correct class term ($\nabla_x (-z_1)$) dominates, the combined gradient might point toward a region where the sample remains correctly classified, even if a successful adversarial example exists in a different direction.

Toy illustration showing how imbalanced gradients steer attacks toward suboptimal regions.

The authors identify label smoothing—a common regularization technique—as a major culprit. By encouraging uniform logits for incorrect classes, label smoothing flattens the $z_{max}$ landscape, thereby shrinking its gradient and inflating the relative influence of the correct class term. This creates a "suboptimal direction trap" that standard PGD attacks fail to escape.

The Margin Decomposition Attack

To overcome the limitations of standard margin loss, the authors propose the Margin Decomposition (MD) attack. This strategy rebalances the conflicting loss terms through a two-stage optimization process:

  1. Stage 1 (Exploration): The attack alternately optimizes the individual terms ($z_{max}$ and $-z_y$) using large steps. By focusing on the non-dominant term, the attack can reduce the GIR and navigate out of flat or misleading regions of the loss landscape.
  2. Stage 2 (Refinement): After finding a more promising region, the attack switches back to the full margin loss to fine-tune the adversarial perturbation and maximize classification error.

The authors also developed an ensemble version (MDE) that integrates with the AutoAttack framework, providing a more robust evaluation standard.

Experimental Results

The study evaluated 24 state-of-the-art defense models on CIFAR-10 and ImageNet. The results reveal a widespread vulnerability to IG. As shown in Figure 2, many models that appeared robust under standard evaluations exhibit high Gradient Imbalance Ratios. When these models are subjected to the MD attack, their evaluated robustness drops significantly—by over 4% in extreme cases like the "Bilateral" defense.

GIR across models and its impact on attack success and loss landscapes.

Key findings include:

  • State-of-the-Art Performance: The MD Ensemble (MDE) outperformed AutoAttack on 16 out of 20 CIFAR-10 defense models.
  • Scalability: On ImageNet, the MD attack was more effective than the entire AutoAttack ensemble at evaluating the robustness of Vision Transformers (XCiT).
  • Stealthiness: Models suffering from IG pass all standard tests for obfuscated gradients, making GIR a necessary metric for reliable robustness claims.

Conclusion

Imbalanced Gradients represent a subtle form of gradient masking that can lead to dangerously overconfident robustness claims. By quantifying this phenomenon with GIR and providing the MD attack as a solution, this work offers a more rigorous path forward for adversarial defense research. Future work should focus on developing training regularizers that explicitly minimize gradient imbalance to ensure models are truly robust, rather than just difficult to optimize.

Summary updated

BibTeX
@article{jiang2024imbalanced,
  author = {Linxi Jiang and Xingjun Ma and Zejia Weng and James Bailey and Yu-Gang Jiang},
  title = {{Imbalanced Gradients: A New Cause of Overestimated Adversarial Robustness}},
  journal = {Machine Learning},
  year = {2024},
  doi = {10.1007/s10994-023-06328-7},
}
Figure