acceptodds
Under review as a conference paper at ICLR 2027

Attention Sensitivity in Vision Transformers: Analysis and Robust Small-Data Training

Abstract

Vision Transformers (ViTs) have achieved strong performance in large-scale computer vision tasks but often generalize poorly when trained on small datasets. Recent studies suggest that flat attention is associated with poor generalization, yet how attention patterns affect local sensitivity to perturbations remains insufficiently understood. To study this relationship, we analyze how bounded input shifts induce perturbations in attention logits and use this formulation to characterize attention-level sensitivity. Empirically, models trained on small datasets exhibit higher sensitivity to such perturbations and flatter attention patterns than models pre-trained on large-scale datasets. We further provide a local sensitivity analysis showing that the softmax Jacobian vanishes as attention distributions approach a sharp, one-hot pattern, thereby attenuating the first-order loss variation propagated through attention. This analysis also clarifies that temperature-based sharpening alone does not necessarily reduce sensitivity. Building on this local analysis and the empirical sensitivity gap, we propose Gradient-Guided Robust Attention Sharpening (GRASP), a training-time regularization framework that enforces prediction consistency under gradient-guided attention perturbations and implicitly encourages sharper attention patterns. Extensive experiments demonstrate that GRASP consistently improves ViT generalization in small-data training and out-of-distribution evaluation, while providing additional gains in target-domain fine-tuning.

Primary area:
applications to computer vision, audio, language, and other modalities
Keywords:
vision transformers, attention, robustness, data-efficient learning

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_9ySQOpenReview ↗
Rating
3
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies training ViTs, including PiT and Swin, from scratch on small datasets. Based on an analysis of the local sensitivity of attention to input perturbations, it proposes GRASP, a consistency regularization method to improve ID and OOD generalization. The experimental results show consistent improvements across multiple datasets and architectures, with additional gains when GRASP is combined with existing methods.

Critical strengths
  1. The observation that scratch-trained models are more vulnerable to gradient-guided attention perturbations than pre-trained models is interesting and may inspire further research.

  2. The experimental results are good, with consistent improvements across multiple datasets and ViT, PiT, and Swin architectures. The experiments also evaluate the combination of GRASP with several existing methods.

Critical weaknesses
  1. The theoretical support is relatively weak, despite the good experimental results. The proofs establish several properties under restricted conditions, but the resulting explanation of the training mechanism appears stronger than what is actually proved. The following points need clarification:

a) Proposition 3.3: It assumes that A approaches a one-hot distribution and then shows that the Jacobian vanishes. It mainly describes the saturation property of softmax. It does not explain why training would make A approach a one-hot distribution.

b) Proposition 4.1: The implication depends on sufficient separation between token-wise gradients. But, the paper neither proves nor experimentally verifies whether this condition holds during training.

c) Input perturbation analysis: assuming a bounded logit Jacobian and then deriving bounded logit perturbations is a standard conditional argument. It does not establish that GRASP reduces this Jacobian bound.

  1. The novelty over existing attention adversarial regularization methods needs clarification. The authors should clearly explain what GRASP adds compared with these methods.

  2. The sensitivity comparisons may use different perturbation strengths. According to Eq.11, the perturbation magnitude depends on the magnitude of G. Pre-trained models, GRASP-trained models, and ordinary scratch-trained models may have different CE confidence levels, gradient scales, and downstream parameter scales. Therefore, using the same T_G does not guarantee the same logit perturbation strength. The authors should clarify how this is controlled. Moreover, the perturbation constraint changes during the derivation, and Eq.11 has not been shown to be the worst-case perturbation under the original norm budget.

Questions for authors
  1. How does the theoretical analysis support the claimed training mechanism beyond the one-hot limit in Proposition 3.3? In particular, does the gradient separation required by Proposition 4.1 hold during training, and is there theoretical or experimental evidence that GRASP reduces the logit Jacobian bound?

  2. What are the main methodological differences between GRASP and existing attention adversarial regularization methods? Please clarify which aspects constitute the new contribution.

  3. Are the sensitivity comparisons conducted under the same actual logit perturbation budget across scratch-trained, pre-trained, and GRASP-trained models? Since Eq.11 depends on the magnitude of G, how are differences in gradient scale controlled?

  4. Please also clarify whether Eq.11 is a worst-case perturbation under the original norm constraint or only under the subsequently introduced variance constraint.

Reviewer_kJaqOpenReview ↗
Rating
1(−1)
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper analyzes attention sensitivity in Vision Transformers (ViTs) trained from scratch on small datasets. It models input shifts as bounded attention-logit perturbations, derives a gradient-guided worst-case perturbation direction, and shows via the softmax Jacobian that sharper attention can attenuate first-order loss variation propagated through attention. Motivated by this analysis, the paper proposes GRASP, a Jensen–Shannon-divergence consistency regularizer that enforces prediction stability between the original and gradient-guided perturbed attention outputs. Experiments cover small-data training, ImageNet-scale OOD evaluation, and domain-shift fine-tuning across ViT, PiT, and Swin.

Critical strengths
  1. The paper provides a clear chain from input perturbations to attention-logit perturbations, a gradient-guided worst-case direction, and a local sensitivity argument linking attention sharpness to the softmax Jacobian. This gives the proposed regularizer a principled motivation beyond direct temperature sharpening.

  2. GRASP is a training-only consistency objective with no inference overhead, and the empirical results show consistent gains across multiple architectures, datasets, and OOD/fine-tuning settings.

Critical weaknesses
  1. Insufficient motivation in light of current practice. From the perspective of the field’s current development, the motivation for studying how to better train ViTs from scratch on small datasets is not sufficiently justified. At present, for small-scale labeled data, a more general and efficient paradigm is to fine-tune a foundation model, such as DINOv3, rather than training from scratch. The experimental results in this paper also support this concern: linear probing DINOv3 achieves 95%+ accuracy on CIFAR100, Flowers, and similar datasets, far exceeding the from-scratch results reported in this paper (only 60–70%).

  2. Uninformative and potentially misleading Figure 1. Figure 1 neither presents the large-scale pre-trained ViT attention characteristics claimed in the caption nor conveys useful information.

Questions for authors

Please address the issues raised in the weaknesses.

Reviewer_GhWHOpenReview ↗
Rating
3(+1)
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper investigates attention sensitivity in Vision Transformers trained on small datasets. The authors model input-induced changes in attention logits and analyze their propagation through the softmax Jacobian. Based on this analysis, Gradient-Guided Robust Attention Sharpening (GRASP) constructs gradient-guided attention perturbations and enforces prediction consistency between the original and perturbed branches. Experiments cover training from scratch, ImageNet distribution shifts, pretrained fine-tuning, and additional detection and segmentation tasks. The results demonstrate consistent improvements.

Critical strengths

1, The paper addresses a relevant problem and provides a concrete attention-level perspective on poor generalization in small-data ViT training.

2, Experiments show consistent improvements across ViT, PiT, and Swin on six datasets, with uncertainty estimates reported for the main comparisons.

3, ImageNet distribution-shift evaluation and downstream detection and segmentation experiments support applicability beyond the original classification setting.

4, The paper includes useful comparisons with temperature sharpening, FGSM training, SAM, longer training, and alternative regularization objectives.

5, Figure 3 clearly illustrates the training pipeline, and the appendix reports the additional training cost. The method introduces no additional inference branch.

Critical weaknesses

1, The worst-case direction is derived under a fixed attention-weighted variance, whereas the initial perturbation model uses an Lq budget. These constraints generally produce different maximizers. For example, an L2 budget yields a direction proportional to JG rather than G. The implementation also needs an explicit connection to a controlled perturbation budget.

2, Vanishing sensitivity in the one-hot limit does not establish that lower attention entropy generally implies lower sensitivity. Finite distributions can have lower entropy but larger Jacobian norms. Furthermore, the sharpening argument depends on gradient separation, which can shrink during training. Direct measurements are needed to support this explanation.

3, The experiments do not sufficiently isolate the proposed mechanism from general consistency regularization. Equal-norm random attention perturbations, conventional logit-gradient perturbations, and direct entropy regularization would strengthen the novelty claim, particularly under matched training budgets.

4, The scratch-versus-pretrained sensitivity comparison may be confounded by gradient scale. Since the perturbation depends on the task gradient, a fixed temperature does not guarantee equally strong perturbations across models. Comparisons under matched perturbation norms or effective variances, together with strength sweeps, are needed.

5, The implementation should clarify the loss used to compute G, whether its gradient is detached, and the procedure for perturbing multiple layers simultaneously. Figure 3 should show the gradient-construction step. The differing baseline values and uncertainty reporting across Tables 2 and 3 also require clearer run accounting.

Questions for authors

see weaknesses

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.