NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Flatness-aware Adversarial Attack

Mingyuan Fan, Xiaodan Li, Cen Chen, Yinggui Wang · OpenReview

Abstract

The transferability of adversarial examples can be exploited to launch black-box attacks. However, adversarial examples often present poor transferability. To alleviate this issue, by observing that the diversity of inputs can boost transferability, input regularization based methods are proposed, which craft adversarial examples by combining several transformed inputs. We reveal that input regularization based methods make resultant adversarial examples biased towards flat extreme regions. Inspired by this, we propose an attack called flatness-aware adversarial attack (FAA) which explicitly adds a flatness-aware regularization term in the optimization target to promote the resultant adversarial examples towards flat extreme regions. The flatness-aware regularization term involves gradients of samples around the resultant adversarial examples but optimizing gradients requires the evaluation of Hessian matrix in high-dimension spaces which generally is intractable. To address the problem, we derive an approximate solution to circumvent the construction of Hessian matrix, thereby making FAA practical and cheap. Extensive experiments show the transferability of adversarial examples crafted by FAA can be considerably boosted compared with state-of-the-art baselines.

Introduction

Adversarial transferability—the ability of an attack crafted on a local proxy model to deceive an unknown target model—is a central challenge in AI security. A long-standing empirical assumption has been that "flat" adversarial examples, where the loss landscape is less sensitive to small perturbations, transfer better. However, research from East China Normal University and Alibaba Group (accepted at NeurIPS 2024) challenges this notion, providing a theoretical framework that identifies second-order gradient information as a critical missing piece in the transferability puzzle.

Theoretical Framework: Beyond Simple Flatness

The authors decouple transferability into local effectiveness and transfer-related loss. They derive a theoretical upper bound for transfer loss consisting of three components: inherent model differences, first-order gradients (flatness), and second-order gradients (Hessian). Their key insight is that flatness alone is insufficient; an adversarial example can be locally flat but still fail to transfer if the curvature (second-order gradient) is high.

Figure 1: Visualization of how different optimization objectives (y1 vs y3) lead to distinct "best solutions," illustrating the shift in optimal points when considering higher-order regularization.

The Flatness-aware Adversarial Attack (FAA)

To make this theory practical, the researchers developed the Flatness-aware Adversarial Attack (FAA). Directly calculating Hessian matrices is computationally prohibitive. FAA circumvents this by using a surrogate loss that penalizes gradient norms in a small region around the perturbation. Through a Taylor expansion approximation, the attack captures essential higher-order information using only first-order gradients, ensuring both theoretical soundness and computational efficiency.

Key Results and Evaluation

FAA was rigorously tested on the ImageNet dataset and against real-world black-box systems, consistently outperforming state-of-the-art (SOTA) methods like SSA and RAP.

Cross-Architecture Transferability

FAA achieved an unprecedented average 90% attack success rate (ASR) against transformer architectures (such as ViT and Swin) using a simple ResNet50 proxy. This demonstrates that the attack's theoretical grounding allows it to bridge the gap between disparate model architectures more effectively than previous methods.

Figure 2: Detailed performance comparison of FAA against various proxy and target model combinations, showing consistent gains in transferability across different architectures.

Real-World Impact

The attack proved highly effective against commercial and advanced AI systems:

  • Google Cloud Vision: Achieved ~70% success on classification and ~80% on object detection tasks.
  • Multimodal LLMs: Successfully deceived GPT-4 (56% ASR) and Claude 3 (62% ASR) into misidentifying objects.
  • Defensive Robustness: FAA maintained its performance lead even when targeting models protected by adversarial training.

Conclusion

By moving beyond the simple "flatness" heuristic and incorporating second-order curvature information, FAA provides a more robust and theoretically sound approach to adversarial attacks. This work not only sets new performance benchmarks but also offers a foundation for developing more resilient AI defenses by understanding the intrinsic limits of transferability.

Source Code: https://github.com/fmy266/TPA

Summary updated

BibTeX
@misc{fan2023flatness,
  author = {Mingyuan Fan and Xiaodan Li and Cen Chen and Yinggui Wang},
  title = {{Flatness-aware Adversarial Attack}},
  year = {2023},
  eprint = {2311.06423},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.06423},
}
Figure