Research map / Architectures and efficiency / Attention and transformers
Curved Representation Space of Vision Transformers
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Shows that the penultimate-layer representation of Vision Transformers is locally curved along linear input perturbations, which explains why ViT/Swin are both more robust and underconfident than CNNs.
Problem
Transformers appear more robust to corruptions/adversarial perturbations than CNNs yet are underconfident, which contradicts the intuition that robustness increases with confidence; the reason is not understood.
Approach
Analyze how the penultimate-layer output moves when the input moves linearly along FGSM directions, measuring direction change between steps (theta); CNNs show near-linear movement while Transformers show curved trajectories in some regions, which both enlarges the distance traveled to the decision boundary and hides a nearby boundary that random jumps can reveal. Also gives an attention-nonlinear
Key results
- Transformers (ViT-B/16, Swin-T) are underconfident (positive sECE) while CNNs (ResNet50, MobileNetV2) are overconfident on ImageNet validation.
- Data in curved regions (large theta^(1)) retain high accuracy after I-FGSM attack with eps=.001 or .002, explaining the higher robustness of Transformers.
- Applying a random jump (eps_r=.05) before FGSM travel substantially reduces the distance to the decision boundary for Swin-T, so misclassification needs smaller perturbations.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use a Transformer rather than a CNN | ImageNet classifiers · ImageNet validation set | representation-space curvedness | Mixed |
| Locate data in a curved rather than linear region | ViT-B/16 and Swin-T · ImageNet validation set | distance to decision boundary | Helped |
| Add a small random-noise jump before computing the FGSM direction | Swin-T · ImageNet validation set | distance to decision boundary | Helped |
| Set the jump direction to the FGSM direction determined after a random jump | Swin-T · ImageNet validation set | distance to decision boundary | Helped |
| Add GELU rather than ReLU | representation-space components · ImageNet validation set | curvedness | Helped |
| Add LayerNorm and self-attention | Swin-T · ImageNet validation set | curvedness | Helped |
| Use knowledge distillation with a CNN teacher | DeiT-Ti · ImageNet validation set | curvedness: $.243 \pi$ -> $.209 \pi$ | Hurt |
| Use knowledge distillation with a CNN teacher | DeiT-Ti · ImageNet validation set | adversarial robustness | Hurt |
Surprising findings
- ConvNeXt-Tiny, a CNN, follows the Transformer trend (curved space, underconfidence) rather than the CNN trend, suggesting curvedness depends on components (GELU, LayerNorm) rather than architecture family.
- DeiT-Ti-Distilled with a CNN teacher shows CNN-like behavior, indicating knowledge distillation can reduce curvedness.
Limitations
- Analysis is restricted to FGSM-based travel directions and penultimate-layer features.
- Explanation of attention nonlinearity is theoretical/low-dimensional and the authors leave further detailed analysis to future work.
- Only pretrained PyTorch models on ImageNet are studied, not effects of training recipes or datasets.
Experimental setup
Datasets: ImageNet
Benchmarks: ImageNet
Metrics: ECE signed ECE accuracy after I-FGSM attack direction change theta distance to decision boundary
Baselines: ResNet50 MobileNetV2 ConvNeXt-Tiny DeiT-Ti DeiT-Ti-Distilled
Builds on: FGSM I-FGSM expected calibration error
Closest papers by meaning
- Hide & Seek: Transformer Symmetries Obscure Sharpness & Riemannian Geometry Finds It (ICML 2025 · similarity 0.85)
- Transformers Learn Low Sensitivity Functions: Investigations and Implications (ICLR 2025 · similarity 0.85)
- From Alexnet to Transformers: Measuring the Non-linearity of Deep Neural Networks with Affine Optimal Transport (CVPR 2025 · similarity 0.85)
- Predictive Geometry of Hidden Trajectories in Transformers (NeurIPS 2026 · similarity 0.85)
- What Does It Mean to Be a Transformer? Insights from a Theoretical Hessian Analysis (ICLR 2025 · similarity 0.85)
- Vision Transformers Beat WideResNets on Small Scale Datasets Adversarial Robustness (AAAI 2025 · similarity 0.85)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
