Mechanistic Understandings of Representation Vulnerabilities and Engineering Robust Vision Transformers

Chashi Mahiul Islam, Samuel Jacob Chacko, Mao Nishino, Xiuwen Liu
2/7/2025
cs.CVcs.LG

No confident code implementation found for this paper.

Abstract

While transformer-based models dominate NLP and vision applications, their underlying mechanisms to map the input space to the label space semantically are not well understood. In this paper, we study the sources of known representation vulnerabilities of vision transformers (ViT), where perceptually identical images can have very different representations and semantically unrelated images can have the same representation. Our analysis indicates that imperceptible changes to the input can result in significant representation changes, particularly in later layers, suggesting potential instabilities in the performance of ViTs. Our comprehensive study reveals that adversarial effects, while subtle in early layers, propagate and amplify through the network, becoming most pronounced in middle to late layers. This insight motivates the development of NeuroShield-ViT, a novel defense mechanism that strategically neutralizes vulnerable neurons in earlier layers to prevent the cascade of adversarial effects. We demonstrate NeuroShield-ViT's effectiveness across various attacks, particularly excelling against strong iterative attacks, and showcase its remarkable zero-shot generalization capabilities. Without fine-tuning, our method achieves a competitive accuracy of 77.8% on adversarial examples, surpassing conventional robustness methods. Our results shed new light on how adversarial effects propagate through ViT layers, while providing a promising approach to enhance the robustness of vision transformers against adversarial attacks. Additionally, they provide a promising approach to enhance the robustness of vision transformers against adversarial attacks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{islam2025mechanistic,
  title  = {Mechanistic Understandings of Representation Vulnerabilities and Engineering Robust Vision Transformers},
  author = {Chashi Mahiul Islam and Samuel Jacob Chacko and Mao Nishino and Xiuwen Liu},
  year   = {2025},
  eprint = {2502.04679},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.04679v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.04679.svg)](https://codeofpaper.com/paper/2502.04679)

Discussion