A Mechanistic Analysis of Adversarial Fine-tuning of Vision Transformers

Hannah Gao, Isha Agarwal, Dylan Hadfield-Menell, Rachel Ma
5/28/2026
cs.CVcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

The widespread use of image classification models in high-risk, real-world situations necessitates making these models robust to slight disturbances or perturbations, such as blurring or sharpening, in the input images. While vision transformers (ViTs) play an integral role in many modern-day multi-modal models like Vision-Language-Models (VLMs) and Vision-Language-Action (VLA) models, they have received a lack of attention in the setting of robustness.

Show full abstract

In this work, we analyze the effects of adversarial fine-tuning, a popular method for improving model robustness to image perturbations, on a ViT's performance on perturbed and regular images through a mechanistic lens. We adversarially train a ViT on low-frequency and high-frequency image corruptions, and attempt to explain changes in downstream model performance through an examination of the model's attention mechanisms, internal representations, and knowledge evolution. Overall, our results suggest that, while fine-tuning on inputs with common corruptions improves model performance and certainty on new instances of corrupted data, these improvements do not transfer to other classes of corruptions not seen in the training. Additionally, despite observing changes in visual attention and knowledge evolution across layers, we found that adversarial training did not lead to fundamental changes in the sparse representations learned by ViTs.

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{gao2026mechanistic,
  title  = {A Mechanistic Analysis of Adversarial Fine-tuning of Vision Transformers},
  author = {Hannah Gao and Isha Agarwal and Dylan Hadfield-Menell and Rachel Ma},
  year   = {2026},
  eprint = {2606.07593},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.07593v1}
}

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/2606.07593.svg)](https://codeofpaper.com/paper/2606.07593)

Discussion