Proceedings

Generalization Analysis for Adversarial Vision Transformer

Download BibTeX Cite

Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 1279-1287.

https://doi.org/10.24963/ijcai.2026/143

Abstract

Vision Transformers (ViTs) exhibit notable susceptibility to adversarial attacks, presenting a significant challenge for their deployment in security-sensitive applications. Despite their considerable empirical successes, a rigorous theoretical foundation for ViT's adversarial generalization behavior has not been adequately established. To address this limitation, we leverage empirical Rademacher complexity to analyze the mechanism of perturbation accumulation through deep ViTs layers. We establish a high-probability generalization bound for ViTs in classification tasks under adversarial settings. Our theoretical framework elucidates the roles of several factors in mitigating perturbation effects, norm regularization of weight matrices (in both MLP and attention modules) and depth-wise propagation constraints on layer-wise norms. Extensive experiments on benchmark datasets corroborate our theoretical insights, bridging the gap between ViTs architecture design and adversarial robustness.

  1. [Attias et al., 2022] Idan Attias, Aryeh Kontorovich, and Yishay Mansour. Improved generalization bounds for ad- versarially robust learning. Journal of Machine Learning Research, 23:1-31, 2022.
  2. [Awasthi et al., 2020] Pranjal Awasthi, Natalie Frank, and Mehryar Mohri. Adversarial learning guarantees for lin- ear hypotheses and neural networks. In Proceedings of the International Conference on Machine Learning, pages 431-441, 2020.
  3. [Bai et al., 2021] Tao Bai, Jinqi Luo, Jun Zhao, Bihan Wen, and Qian Wang. Recent advances in adversar- ial training for adversarial robustness. arXiv preprint arXiv:2102.01356, 2021. IJCAI
  4. [Bai et al., 2023] Yu Bai, Fan Chen, Huan Wang, Caiming Xiong, and Song Mei. Transformers as statisticians: Prov- able in-context learning with in-context algorithm selec- tion. Advances in Neural Information Processing Systems, 36:57125-57211, 2023.
  5. [Bhojanapalli et al., 2021] Srinadh Bhojanapalli, Ayan Chakrabarti, Daniel Glasner, Daliang Li, Thomas Un- terthiner, and Andreas Veit. Understanding robustness of transformers for image classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10231-10241, 2021.
  6. [Chen et al., 2022] Zhaoyu Chen, Bo Li, Jianghe Xu, Shuang Wu, Shouhong Ding, and Wenqiang Zhang. To- wards practical certifiable patch defense with vision trans- former. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15148- 15158, 2022.
  7. [Deng et al., 2025] Haoyu Deng, Yanmei Fang, and Fangjun Huang. Patch attacks on vision transformer via skip atten- tion gradients. In Proceedings of the IEEE/CVF Confer- ence on Computer Vision and Pattern Recognition, pages 554-567, Singapore, 2025.
  8. [Deora et al., 2023] Puneesh Deora, Rouzbeh Ghaderi, Hos- sein Taheri, and Christos Thrampoulidis. On the opti- mization and generalization of multi-head attention. arXiv preprint arXiv:2310.12680, 2023.
  9. [Dosovitskiy, 2020] Alexey Dosovitskiy. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
  10. [Edelman et al., 2022] Benjamin L Edelman, Surbhi Goel, Sham Kakade, and Cyril Zhang. Inductive biases and vari- able creation in self-attention mechanisms. In Proceed- ings of the International Conference on Machine Learn- ing, pages 5793-5831, 2022.
  11. [Fang et al., 2023] Yuxin Fang, Shusheng Yang, Shijie Wang, Yixiao Ge, Ying Shan, and Xinggang Wang. Un- leashing vanilla vision transformer with masked image modeling for object detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6244-6253, 2023.
  12. [Gong et al., 2024] Huihui Gong, Minjing Dong, Siqi Ma, Seyit Camtepe, Surya Nepal, and Chang Xu. Random entangled tokens for adversarially robust vision trans- former. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 24554- 24563, 2024.
  13. [Gopal et al., 2025] Bhavna Gopal, Huanrui Yang, Mark Horton, and Yiran Chen. Safer: Sharpness aware layer- selective finetuning for enhanced robustness in vision transformers. arXiv preprint arXiv:2501.01529, 2025.
  14. [Gu et al., 2022] Jindong Gu, Volker Tresp, and Yao Qin. Are vision transformers robust to patch perturbations? In European Conference on Computer Vision, pages 404- 421, 2022.
  15. [Gu et al., 2024] Junyi Gu, Mauro Bellone, Tomáš Pivoňka, and Raivo Sell. Clft: Camera-lidar fusion transformer for semantic segmentation in autonomous driving. IEEE Transactions on Intelligent Vehicles, page 1-12, 2024.
  16. [Guo et al., 2023] Yong Guo, David Stutz, and Bernt Schiele. Robustifying token attention for vision transform- ers. In Proceedings of the IEEE/CVF International Con- ference on Computer Vision, pages 17557-17568, 2023.
  17. [Herrmann et al., 2022] Charles Herrmann, Kyle Sargent, Lu Jiang, Ramin Zabih, Huiwen Chang, Ce Liu, Dilip Kr- ishnan, and Deqing Sun. Pyramid adversarial training im- proves vit performance. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13419-13429, 2022.
  18. [Jain and Dutta, 2024] Samyak Jain and Tanima Dutta. To- wards understanding and improving adversarial robustness of vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 24736-24745, 2024.
  19. [Kim et al., 2021] Hyunjik Kim, George Papamakarios, and Andriy Mnih. The lipschitz constant of self-attention. In Proceedings of the International Conference on Machine Learning, pages 5562-5571, 2021.
  20. [Ledoux and Talagrand, 2013] Michel Ledoux and Michel Talagrand. Probability in Banach Spaces: isoperimetry and processes. Springer Science & Business Media, 2013.
  21. [Li et al., 2022] Yanghao Li, Hanzi Mao, Ross Girshick, and Kaiming He. Exploring plain vision transformer back- bones for object detection. In European conference on computer vision, pages 280-296, 2022.
  22. [Li et al., 2023a] Bonan Li, Yinhan Hu, Xuecheng Nie, Con- gying Han, Xiangjian Jiang, Tiande Guo, and Luoqi Liu. Dropkey for vision transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 22700-22709, 2023.
  23. [Li et al., 2023b] Hongkang Li, Meng Wang, Sijia Liu, and Pin-Yu Chen. A theoretical understanding of shallow vi- sion transformers: Learning, generalization, and sample complexity. In International Conference on Learning Rep- resentations, 2023.
  24. [Li et al., 2023c] Yingcong Li, Muhammed Emrullah Ildiz, Dimitris Papailiopoulos, and Samet Oymak. Transformers as algorithms: Generalization and stability in in-context learning. In Proceedings of the International Conference on Machine Learning, pages 19565-19594, 2023.
  25. [Madry et al., 2018] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018.
  26. [Mahmood et al., 2021] Kaleel Mahmood, Rigel Mahmood, and Marten Van Dijk. On the robustness of vision trans- formers to adversarial examples. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7838-7847, 2021.
  27. [Manzari et al., 2023] Omid Nejati Manzari, Hamid Ahmad- abadi, Hossein Kashiani, Shahriar B. Shokouhi, and Ah- mad Ayatollahi. Medvit: A robust vision transformer for generalized medical image classification. Computers in Biology and Medicine, 157:106791, 2023.
  28. [Mao et al., 2022] Xiaofeng Mao, Gege Qi, Yuefeng Chen, Xiaodan Li, Ranjie Duan, Shaokai Ye, Yuan He, and Hui Xue. Towards robust vision transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pat- tern Recognition, pages 12042-12051, 2022.
  29. [Mo et al., 2022] Yichuan Mo, Dongxian Wu, Yifei Wang, Yiwen Guo, and Yisen Wang. When adversarial training meets vision transformers: Recipes from training to ar- chitecture. In Advances in Neural Information Processing Systems, volume 35, pages 18599-18611, 2022.
  30. [Mustafa et al., 2022] Waleed Mustafa, Yunwen Lei, and Marius Kloft. On the generalization analysis of adversarial learning. In Proceedings of the International Conference on Machine Learning, pages 16174-16196, 2022.
  31. [Shao et al., 2022] Rulin Shao, Zhouxing Shi, Jinfeng Yi, Pin-Yu Chen, and Cho-jui Hsieh. On the adversarial ro- bustness of vision transformers. In Advances in Neural Information Processing Systems, 2022.
  32. [Sultana et al., 2022] Maryam Sultana, Muzammal Naseer, Muhammad Haris Khan, Salman Khan, and Fahad Shah- baz Khan. Self-distilled vision transformer for domain generalization. In Proceedings of the Asian conference on computer vision, pages 3068-3085, 2022.
  33. [Thisanke et al., 2023] Hans Thisanke, Chamli Deshan, Kavindu Chamith, Sachith Seneviratne, Rajith Vi- danaarachchi, and Damayanthi Herath. Semantic segmen- tation using vision transformers: A survey. Engineering Applications of Artificial Intelligence, 126:106669, 2023.
  34. [Tramèr et al., 2018] Florian Tramèr, Alexey Kurakin, Nico- las Papernot, Ian Goodfellow, Dan Boneh, and Patrick Mc- Daniel. Ensemble adversarial training: Attacks and de- fenses. In International Conference on Learning Repre- sentations, 2018.
  35. [Trauger and Tewari, 2024] Jacob Trauger and Ambuj Tewari. Sequence length independent norm-based gener- alization bounds for transformers. In Proceedings of the International Conference on Artificial Intelligence, pages 1405-1413, 2024.
  36. [Wang et al., 2024] Sibo Wang, Jie Zhang, Zheng Yuan, and Shiguang Shan. Pre-trained model guided fine-tuning for zero-shot adversarial robustness. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 24502-24511, 2024.
  37. [Wei et al., 2022] Zhipeng Wei, Jingjing Chen, Micah Gold- blum, Zuxuan Wu, Tom Goldstein, and Yu-Gang Jiang. Towards transferable adversarial attacks on vision trans- formers. In Proceedings of the International Conference on Artificial Intelligence, volume 36, pages 2668-2676, 2022.
  38. [Wen et al., 2023] Wen Wen, Han Li, Hong Chen, Rui Wu, Lingjuan Wu, and Liangxuan Zhu. Generalization bounds for adversarial metric learning. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, pages 4397-4405, 2023. IJCAI
  39. [Wen et al., 2025] Wen Wen, Han Li, Tieliang Gong, and Hong Chen. Towards generalization bounds of GCNs for adversarially robust node classification. In International Conference on Learning Representations, 2025.
  40. [Wu and Cheng, 2021] xinxing Wu and Qiang Cheng. Algo- rithmic stability and generalization of an unsupervised fea- ture selection algorithm. In Advances in Neural Informa- tion Processing Systems, volume 34, pages 19860-19875, 2021.
  41. [Wu et al., 2022] Boxi Wu, Jindong Gu, Zhifeng Li, Deng Cai, Xiaofei He, and Wei Liu. Towards efficient adversar- ial training on vision transformers. In European Confer- ence on Computer Vision, pages 307-325, 2022.
  42. [Xiao et al., 2022] Jiancong Xiao, Yanbo Fan, Ruoyu Sun, Jue Wang, and Zhi-Quan Luo. Stability analysis and gen- eralization bounds of adversarial training. Advances in Neural Information Processing Systems, 35:15446-15459, 2022.
  43. [Xiao et al., 2025] Chaoen Xiao, Sirui Peng, Lei Zhang, Jianxin Wang, Ding Ding, and Jianyi Zhang. A transformer-based adversarial network framework for steganography. Expert Systems with Applications, 269:126391, 2025.
  44. [Xu et al., 2023] Xiaoyun Xu, Shujian Yu, Zhuoran Liu, and Stjepan Picek. Mimir: Masked image modeling for mutual information-based adversarial robustness. arXiv preprint arXiv:2312.04960, 2023.
  45. [Yao et al., 2024] Yuchong Yao, Nandakishor Desai, and Marimuthu Palaniswami. Adversarial masked autoen- coders are robust vision learners. IEEE Transactions on Artificial Intelligence, 2024.
  46. [Yin et al., 2019] Dong Yin, Ramchandran Kannan, and Pe- ter Bartlett. Rademacher complexity for adversarially robust generalization. In Proceedings of the Interna- tional Conference on Machine Learning, pages 7085- 7094, 2019.
  47. [Yun et al., 2019] Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank Reddi, and Sanjiv Kumar. Are transformers universal approximators of sequence- to-sequence functions? In International Conference on Learning Representations, 2019.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards