---
title: "Towards Robust Vision Transformer — paper by Mao et al. (2022)"
description: "How Robust Vision Transformer combines architectural choices, position-aware attention scaling and patch augmentation to improve robustness."
canonical: "https://research.elamur.ai/free/en/papers/mao-2022-robust-vision-transformer/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/mao-2022-robust-vision-transformer/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2022](https://md.research.elamur.ai/free/en/papers/2022/) / Towards Robust Vision Transformer

# Towards Robust Vision Transformer

Paper · 2022 · Xiaofeng Mao, Gege Qi, Yuefeng Chen et al.

**Authors:** Xiaofeng Mao, Gege Qi, [Yuefeng Chen](https://md.research.elamur.ai/free/en/authors/yuefeng-chen/), Xiaodan Li, Ranjie Duan, Shaokai Ye, [Yuan He](https://md.research.elamur.ai/free/en/authors/yuan-he/) and [Hui Xue](https://md.research.elamur.ai/free/en/authors/hui-xue/) · **Year:** 2022 · **Venue:** IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**209** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W3163203812|W4312957757) · [IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings](https://openalex.org/S4210176548) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/2105.07926)
- [DOI 10.1109/cvpr52688.2022.01173](https://doi.org/10.1109/cvpr52688.2022.01173)
- [arXiv 2105.07926](https://arxiv.org/abs/2105.07926)
- [OpenAlex](https://openalex.org/W4312957757)

Citations: OpenAlex, 2026-10-14.

## Deep dive: Towards Robust Vision Transformer

How Robust Vision Transformer combines architectural choices, position-aware attention scaling and patch augmentation to improve robustness. · about 35 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

An image classifier can perform well on familiar photographs and still fail when those photographs are corrupted, deliberately perturbed, or replaced by drawings. *Towards Robust Vision Transformer* investigates how the internal design of a vision [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) affects these failures. Its starting point is that improvements in ordinary classification accuracy do not reliably indicate improvements in robustness. A change that makes a network more accurate or computationally efficient can also make its predictions more fragile. The authors therefore examine the components of vision Transformers separately before combining the choices that perform well across several kinds of difficult input.

The resulting architecture is Robust Vision Transformer, abbreviated RVT. It combines a convolutional image-to-patch embedding, a carefully chosen progression of spatial resolutions, an appropriate attention-head configuration, convolution inside the feed-forward network, and averaging of output-token features instead of classification through a dedicated token. These choices reflect a recurring distinction in the experiments: local processing can help when it extracts visual detail or exchanges information between nearby tokens, but restricting attention to local windows can hurt robustness. RVT retains the ability to connect distant image regions while introducing local processing where the authors find it useful.

The paper also introduces position-aware attention scaling, or PAAS, and patch-wise augmentation. PAAS learns how strongly each pair of token positions should influence attention scores. It supplies position information through a learned scaling matrix rather than through the usual position embedding. Patch-wise augmentation applies simple transformations to individual image patches after ordinary image-level augmentation. The intention is to expose the network to more variation in relationships between patches, instead of making every patch undergo the same transformation. RVT trained with both additions is designated RVT*.

The experiments use ImageNet-1K for training and ordinary classification evaluation, alongside adversarial attacks, image corruptions, and distribution changes. RVT-Ti* reaches 79.2% Top-1 accuracy on the ImageNet-1K validation set with 1.3G FLOPs and 10.9M parameters. RVT-S* reaches 81.9% standard accuracy, and its ImageNet-C result is 49.4 mean corruption error, where lower is better. The authors also report strong results on sketches and rendered images, and claim leading positions on several robustness leaderboards. These findings support RVT as a useful combination of architectural and training choices under the tested conditions.

The qualification matters. Robustness is not a single property that every benchmark measures equally well. The appendix identifies configurations that improve performance on several distribution changes while remaining weak against a particular attack. The attention visualizations offer an explanation for PAAS, but they do not establish a general defense against adversarial manipulation. The paper’s strongest contribution is an empirical design argument: evaluate the robustness of individual components, preserve useful long-range interactions, and verify the resulting system across different failure conditions instead of relying on standard accuracy alone.

### Ideas worth borrowing

Audit components against failure conditions. The authors treat robustness as a criterion for choosing architectural parts, rather than as a final score attached to an already completed design. This makes it possible to discover that a seemingly beneficial modification has a hidden cost. The same approach applies wherever an engineering system is assembled from interchangeable stages: establish a baseline, change a component, and examine both ordinary performance and behavior under stress. A component deserves adoption because it supports the intended operating conditions, not merely because it improves the most convenient benchmark.

Separate local processing from local attention. The paper finds benefits from convolutional patch embedding and convolutional feed-forward processing, while finding a robustness cost from restricting attention to local windows. These findings make sense together once locality is understood as an operation-specific choice. Nearby information can enrich a representation without becoming a hard boundary on what information may interact. Elsewhere, this suggests placing local constraints where they express a useful assumption, while preserving broader communication when distant evidence may be necessary for a reliable decision.

Keep content and position distinguishable. PAAS gives positional influence its own learned matrix and applies that matrix directly to content-based attention scores. The reusable idea is a separation of responsibilities: one term expresses what the current input contains, while another expresses which positional relationships tend to matter. This can make an architectural assumption easier to identify and examine. In another system, the same principle could guide the separation of structural preferences from input-dependent evidence, provided the resulting interaction is tested rather than assumed to improve reliability.

Vary relationships between parts. Patch-wise augmentation asks what ordinary augmentation leaves unchanged. If the whole image receives the same transformation, the patches change together. Transforming patches individually creates a different kind of variation, affecting how stable a decision remains when local pieces change differently. The broader lesson is to augment the relationships used by the representation, not only the raw input. Applying this elsewhere requires care about meaning: changing a part of a structured input is useful only when the intended target remains appropriate.

Preserve an economical representation of evidence. The authors replace a special classification token with averaging across output-token features and select an attention-head configuration while keeping total feature dimensionality fixed. These are different interventions, but both question whether a more specialized internal arrangement is actually necessary. Their results encourage engineers to compare a sophisticated aggregation mechanism with a simpler alternative. The point is not that averaging or additional heads always win; it is that a familiar architectural convention should remain open to controlled comparison.

Use disagreements between benchmarks as evidence. The appendix gives examples in which favorable results on corruption or distribution-shift tests coexist with poor adversarial performance. Such disagreement is informative because it shows that a single ranking conceals different vulnerabilities. This idea transfers directly to [evaluation and benchmarks](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/): report separate failure categories, inspect exceptions, and resist converting a collection of tests into an unsupported claim of universal reliability. A system can become useful in a particular difficult setting without becoming robust in every relevant sense.

### How Mova uses it

Mova is a small, transparent language system implemented in Rust. RVT addresses image classification, and the paper does not establish any implemented connection to Mova. There is therefore no basis for saying that Mova already uses its architecture, PAAS, or augmentation procedure. Its immediate value for Mova is methodological: it offers a concrete example of separating ordinary performance from several forms of failure, then using that distinction to choose components.

A plausible application would begin with component-level evaluation. A transparent language system can expose intermediate decisions and make them available for inspection. Mova could use that property to compare a proposed component with the existing behavior under both familiar inputs and controlled variations. The borrowed principle is the structure of the comparison. The image benchmarks themselves would not transfer, and a language evaluation would need to define which variations should preserve the intended interpretation before treating inconsistent behavior as a robustness failure.

The paper’s treatment of locality is also relevant as a design question. RVT benefits from operations that combine nearby information, yet preserves attention across distant positions. For Mova, an analogous question would be whether a local processing rule helps identify useful structure while still allowing information elsewhere in an input to affect the final decision. This is a possible line of investigation, not a result about language. The image experiments do not establish which range of context Mova should use or how that context should be represented.

PAAS suggests a more specific possibility if Mova were to use an attention mechanism. A separately represented positional preference could make the influence of position easier to distinguish from evidence supplied by the current input. That separation could suit a system intended to be inspectable. However, the usefulness of a learned position-pair matrix would depend on Mova’s actual architecture and input organization. Nothing in the paper demonstrates that an image-oriented positional mechanism is appropriate for text, and Rust implementation alone provides no reason to expect the same behavior.

Patch-wise augmentation supplies a related evaluation idea, but it requires an especially careful translation. Image patches can receive the paper’s selected transformations while retaining the image’s classification target. Altering pieces of language can change the intended meaning. Mova could therefore borrow the question—whether independently varying parts of an input exposes a hidden dependence—without borrowing the transformations themselves. Any language counterpart would need an explicit account of which changes preserve the target interpretation and which changes should cause the answer to change.

The most concrete potential use is a robustness report that remains decomposed. Instead of describing an architectural change as simply better, Mova could record its effect on ordinary inputs, selected input variations, and inspectable intermediate decisions. This would follow the paper’s strongest empirical lesson: apparently similar improvements can behave differently across tests. It would also keep claims proportionate to evidence. A successful comparison would establish improved behavior under its stated conditions, while leaving broader questions open.

The distinction between a mechanism and its explanation is equally useful. RVT’s authors interpret attention maps and feature visualizations as support for their design. Mova could make similar use of internal traces as diagnostic evidence while checking final behavior independently. A representation that looks orderly may help explain a result, but it does not on its own establish correctness. For a transparent language system, this is a practical boundary: inspection should make failures easier to understand, while evaluation determines whether the proposed change actually addresses them.

### The problem and its context

#### Good classification results can conceal fragility

The paper addresses a mismatch between the way vision architectures were commonly improved and the conditions under which their predictions might fail. According to the authors, much work on vision Transformers emphasized ordinary accuracy and computational cost. Those are important measures, but neither directly answers whether predictions survive an attack, a corrupted photograph, or a change in visual style. A network can therefore improve along the usual development criteria while becoming less dependable under a different input condition.

The introduction uses PVT-Small to make this problem concrete. The authors report 26.6% robust accuracy under FGSM and state that this is 14.1% below the original DeiT-S comparison. The important point is not merely that one architecture scores poorly. PVT’s changes can support strong ordinary classification while weakening performance under the attack. That example motivates an investigation into architecture itself, rather than an assumption that higher standard accuracy will carry robustness along with it.

Robustness here covers several distinct situations. Adversarial robustness concerns inputs deliberately changed to provoke a wrong prediction. Corruption robustness concerns distortions such as those represented by the ImageNet-C benchmark. Generalization under distribution shift concerns inputs whose appearance differs from the training distribution, including sketches and other visual representations. The paper studies these situations together because all concern reliability beyond ordinary evaluation, but its own exceptional cases show why they must remain distinguishable.

#### How vision Transformers reached this point

The authors place vision Transformers after the success of Transformer architectures in language applications, naming [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) among the motivating examples. In computer vision, [An Image is Worth 16x16 Words](https://md.research.elamur.ai/free/en/papers/dosovitskiy-2020-image-worth-16x16-words-transformers/) established an image-classification approach based on a pure Transformer. The image becomes a sequence of patches, and self-attention allows information from distant regions to interact. In the paper’s account, this offered an attractive relationship between speed and classification performance.

Subsequent architectures modified different parts of that design. [Training data-efficient image transformers & distillation through attention](https://md.research.elamur.ai/free/en/papers/touvron-2020-training-data-efficient-image-transformers/) addressed training efficiency. [Swin Transformer](https://md.research.elamur.ai/free/en/papers/liu-2021-swin-transformer-hierarchical-vision-transformer/) changed the attention arrangement. Other approaches introduced convolutional processing or pooling. [Rethinking Spatial Dimensions of Vision Transformers](https://md.research.elamur.ai/free/en/papers/heo-2021-rethinking-spatial-dimensions-vision-transformers/) belongs to the line of work examining spatial structure. RVT’s authors regard these changes as useful architectural material, while arguing that their effects on robustness need separate examination.

This background explains why the paper does not propose a completely unrelated architecture. Its building blocks come from design choices already being explored in vision Transformers. The distinctive step is to examine those choices through robustness tests and select a combination on that basis. The investigation asks whether the location and form of a modification matter: convolution at the input, convolution inside a feed-forward network, and restriction of attention are all ways to introduce locality, but they need not have equivalent consequences.

#### Earlier robustness research

The paper describes an extensive preceding literature on convolutional networks. Approaches included stronger augmentation, architectural redesign or search, altered training procedures, changes to numerical representations and weights, and modified pooling or activation functions. This establishes that robustness could depend on many engineering choices. It does not, however, establish that an intervention helpful for a convolutional architecture will remain helpful in a Transformer. The authors use that uncertainty to motivate a targeted study.

The adversarial background includes [Explaining and Harnessing Adversarial Examples](https://md.research.elamur.ai/free/en/papers/goodfellow-2014-explaining-harnessing-adversarial-examples/) and [Intriguing properties of neural networks](https://md.research.elamur.ai/free/en/papers/szegedy-2013-intriguing-properties-neural-networks/). In the paper’s account, early robustness evaluation concentrated on deliberately constructed perturbations. The authors then broaden the practical context: real inputs also suffer corruption and natural distribution changes. A useful robustness study should therefore do more than ask whether a network resists a particular adversarial procedure.

[Benchmarking Neural Network Robustness to Common Corruptions and Perturbations](https://md.research.elamur.ai/free/en/papers/hendrycks-2019-benchmarking-neural-network-robustness-common/) supplies the ImageNet-C setting. ImageNet-R and ImageNet-Sketch address changes in visual presentation, with the discussion of ImageNet-R connected to [The Many Faces of Robustness](https://md.research.elamur.ai/free/en/papers/hendrycks-2021-many-faces-robustness-critical-analysis/). These benchmarks make different demands. A classifier facing a sketch cannot depend on the same color and texture information available in an ordinary photograph, whereas an adversarially perturbed photograph tests another kind of instability.

Earlier studies of vision Transformers had already reported favorable robustness comparisons with convolutional networks. The paper describes work on adversarial robustness, limited transfer of adversarial examples between architectural families, and later studies of corruption and distribution shift. RVT advances a narrower and more actionable question: which components within a vision Transformer help or hurt? Rather than treating an architectural family as uniformly robust, it investigates the decisions that determine the behavior of particular members of that family.

### The method, step by step

#### Start with controlled architectural questions

The authors use DeiT-Ti as the baseline for their component analysis. They examine patch embedding, position information, Transformer blocks, and the final classification mechanism. Each category contains choices that can change both ordinary accuracy and behavior under difficult input. Holding a recognizable baseline makes the comparisons interpretable: the question becomes what happens when a particular part is changed, rather than whether two substantially different complete systems happen to receive different scores.

The broad sequence is to test components, assemble the favorable choices into RVT, and then add the new positional and augmentation techniques. The resulting architecture is implemented at different capacities, designated RVT-Ti, RVT-S, and RVT-B. The star designation identifies the versions using PAAS together with patch-wise augmentation. This naming distinction matters throughout the results because some reported gains come from the architecture assembled from earlier findings, while others include the additional techniques.

From architectural tests to augmented RVT The steps in order.

#### Turn images into useful patch features

A vision Transformer first needs a sequence of representations derived from the image. The original patch approach divides an image into fixed regions and projects each region into a token representation. The paper discusses patch sizes of 16×16 and 32×32 in this context. Its concern is that direct projection gives limited explicit support for extracting elementary visual structures, including edges and corners, before the Transformer begins comparing patches.

The authors compare linear projection with a convolutional embedder and a tokens-to-token embedder. The convolutional alternative builds local visual information into the initial representation. The attention-based alternative, associated with [Tokens-to-Token ViT](https://md.research.elamur.ai/free/en/papers/yuan-2021-tokens-token-vit-training-vision/), brings neighboring image elements into the tokenization process. Both are intended to give the later Transformer richer local features than an unstructured projection supplies. The comparison therefore tests whether the quality of the initial representation affects robustness as well as classification accuracy.

The tokens-to-token approach performs best in the component discussion, but the authors identify a computational drawback: its complexity grows quadratically as image size expands. They choose the convolutional embedder for RVT because it provides a more economical compromise. This is an important part of the method. RVT is not assembled by taking whichever component wins a single accuracy comparison; the authors also consider computational burden and the behavior of alternatives across robustness settings.

#### Organize the progression of spatial resolution

The next design choice concerns how image resolution changes through the network. A staged architecture can begin with a larger spatial representation and reduce its spatial size while increasing feature capacity. The paper relates this design to the progression used in convolutional networks. In a Transformer, changing the number and arrangement of spatial tokens changes both the information available at each stage and the cost of attention.

For the stage-distribution experiment, the authors create variants V2–V6 while preserving 12 Transformer blocks overall. They redistribute blocks across spatial scales rather than simply increasing depth. The stage with the largest spatial input is described as 56×56, with subsequent stages reducing the spatial dimensions. This comparison isolates a useful architectural question: given a fixed total of blocks, where should those blocks operate along the progression from detailed spatial information to a more compact representation?

The authors select V2 as their preferred balance. Their discussion favors reducing spatial resolution in later processing and warns against allocating too many blocks to large spatial representations. Those blocks can increase FLOPs and memory consumption while weakening the measured robustness. This result should not be read as an instruction to discard spatial detail immediately. It supports a particular allocation of computation across stages under the tested setup.

#### Choose how attention is divided

Multi-head attention distributes the representation across several attention operations. Each head can form its own pattern of relationships between tokens. The authors test different head counts while reducing the dimensionality assigned to each head as the count rises. Total feature dimensionality therefore remains unchanged. This makes the comparison more informative than one in which extra heads simply bring a larger overall representation.

The tested head counts are 1, 2, 4, 6, 8, and 12. The paper reports improvement in both standard and robust accuracy as the count rises up to 8. Its interpretation is that a suitable collection of heads can capture complementary aspects of the input without excessive redundancy. The authors connect this question to [Are Sixteen Heads Really Better than One?](https://md.research.elamur.ai/free/en/papers/michel-2019-sixteen-heads-really-better-than/), while grounding their architectural choice in their own vision experiments.

This result concerns the organization of a fixed feature budget. It does not show that adding attention heads without limit improves robustness. Nor does it establish the same preferred configuration for every network capacity. The method uses the experiment as a practical guide for constructing RVT: attention should offer enough distinct views of the input to be useful, while the arrangement remains compact enough to avoid wasting representation on repeated information.

#### Keep broad attention and add local exchange elsewhere

The paper distinguishes global self-attention from attention confined to local windows. Global attention allows a token to interact with every token in the sequence. A windowed version limits those interactions to a region. The computational appeal is clear in the authors’ discussion: restricted attention is more efficient as image size grows. The robustness concern is that important evidence may be separated across distant image regions.

In their component comparison, local attention reduces robust accuracy. The authors suggest that weakened access to long-range relationships may explain the result. RVT therefore preserves broader attention instead of treating locality as a universal improvement. This is a design decision supported by their tests, not a proof that every local-window architecture must fail. Its role is to keep the communication mechanism that the authors find valuable while seeking efficiency and local structure through other parts of the network.

The feed-forward network provides one such location. In the ordinary arrangement described by the paper, this stage transforms each token separately. Adding a depth-wise convolution allows nearby token information to participate in the transformation. The result retains global attention and also creates a route for local exchange. The authors find that this convolutional feed-forward design improves both ordinary and robust accuracy, showing why the exact placement of local processing matters.

#### Aggregate output tokens for classification

A conventional vision Transformer can use a dedicated classification token, written CLS, whose final representation supplies the input to the classifier. The authors compare this with averaging the output-token features. Averaging gathers information from the image-token sequence directly, instead of depending on an additional token to collect it. The change also fits the architecture’s emphasis on spatial feature processing.

Their comparison favors removing CLS: adversarial robustness improves substantially in the qualitative account, while standard accuracy receives a smaller benefit. The authors interpret this in part through translation invariance, connecting averaging to the aggregation used in convolutional classifiers. The empirical result supports the replacement in their setup. It does not on its own establish that every possible spatial transformation leaves the resulting network invariant, since several earlier operations still determine how position affects its representations.

These component choices form RVT before the new training additions are applied. The authors report that their benefits work together in the assembled architecture. This combined system is important because favorable isolated comparisons do not automatically guarantee a favorable complete design. RVT’s later evaluation tests whether the selected pieces coexist usefully, rather than stopping at a collection of independent architectural observations.

#### Understand the attention calculation

PAAS modifies scaled dot-product attention. Queries, keys, and values are different projections of the current token representations. A query describes what a token is seeking; keys provide vectors against which it is compared; values carry the information combined after those comparisons. The paper expresses the standard operation as follows.

```
Attention(Q, K, V) = Softmax(QKᵀ / √d)V
```

Q is the matrix of queries, K the matrix of keys, and V the matrix of values. Each has N rows and d columns in the paper’s formulation. N is the sequence length, and d is the dimensionality of each query, key, or value vector. The superscript ᵀ means transpose, so QKᵀ contains pairwise query–key dot products. Dividing by √d rescales those scores. Softmax turns the scores into attention weights, and multiplication by V produces the weighted combination of value vectors.

The scaling step helps prevent dot products from entering a range associated with very small gradients. In the ordinary operation, every position pair receives the same dimensionality-based scale. The content of the current input determines the dot product, but the scale itself does not distinguish one pair of positions from another. PAAS changes this part of the operation by making the scale depend on which positions are interacting.

#### Make attention scaling position-aware

The paper introduces a learned matrix Wₚ with N rows and N columns. Each entry corresponds to a query position and a key position. The matrix therefore supplies a positional influence for every token pair, while remaining independent of the current image content. The modified attention operation is:

```
Attention(Q, K, V) = Softmax(QKᵀ ⊙ (Wₚ / √d))V
```

Q, K, V, N, and d retain the meanings given above. Wₚ is the learned position-importance matrix. The symbol ⊙ denotes element-wise multiplication: each query–key score is multiplied by the corresponding position-specific scaling entry. Softmax again converts the resulting scores into weights, and V supplies the information combined with those weights.

The distinction between content and position is central to the explanation. QKᵀ depends on the current token representations and expresses content-based compatibility. Wₚ depends on positions and expresses a learned preference over their interactions. The authors describe this as separating influences that conventional positional embedding can mix together. In RVT, PAAS replaces the traditional position embedding rather than merely adding another positional signal alongside it.

The position matrix can also act like a soft filter. The authors visualize attention under an adversarial input and argue that small learned multipliers reduce the influence of irrelevant relationships. Their interpretation is that the operation can suppress distracting interactions before they dominate attention. This explanation is supported by the displayed example and by downstream comparisons, but the equation itself should not be mistaken for a guaranteed noise-removal procedure. Its behavior depends on the learned entries and the content scores they scale.

PAAS is applied across multiple Transformer blocks in the augmented RVT. The placement experiment matters because a positional signal introduced in a single place may influence processing differently from a signal supplied repeatedly. The authors find gains as more blocks use PAAS, followed by saturation. They also compare repeated use of ordinary learned position embeddings, allowing them to distinguish a benefit from multiple insertion points from a benefit specific to their scaling mechanism.

#### Augment patches after augmenting the image

Patch-wise augmentation begins after ordinary image-level augmentation. The authors retain that existing stage, then transform individual patches. Their motivation is specific to the representation: a vision Transformer processes both the content inside patches and relationships among patches. Applying the same transformation across the whole image changes the input, but does not provide the same diversity as changing different patches independently.

Patches are transformed using random resized cropping, random horizontal flipping, and random Gaussian noise. For resized cropping, the scale is sampled from [0.85, 1.0]. The patch is then restored to its original size while keeping the aspect ratio unchanged. Gaussian noise uses mean 0 and standard deviation 0.01. Each transformation has application probability p=0.1. Here p denotes the probability that the transformation is applied, instead of a property of the attention mechanism.

The authors use the combination of these basic transformations in their final augmentation setup. Their ablation discussion reports that combining them gives a smaller additional benefit than one might expect from image-level augmentation, but remains preferable to using an individual transformation alone. Other augmentation parameters follow Kornia, while the broader training hyper-parameters follow DeiT. The experiments run on NVIDIA 2080Ti GPUs. The main training and evaluation setting uses ImageNet-1K without requiring another large pretraining dataset.

The resulting method has distinct sources of change. RVT changes the architecture; PAAS changes the way position enters attention; patch-wise augmentation changes training inputs. Keeping these contributions separate makes the later results easier to interpret. The complete augmented system can perform well without establishing that every gain comes from the same mechanism, and the paper’s controlled comparisons are intended to identify which parts contribute under which conditions.

### Experiments and results

#### What the evaluation measures

ImageNet-1K supplies the training data and the standard classification evaluation. Standard performance is reported as Top-1 accuracy: whether the highest-ranked class is correct. The main experiments do not depend on pretraining with another large dataset. This matters when assessing the contribution because the reported improvements are presented as consequences of architectural and training choices within that setting, rather than as the result of obtaining additional large-scale training data.

The adversarial evaluation attacks the ImageNet-1K validation set using FGSM and PGD. FGSM supplies a single-step attack, whereas the reported PGD configuration uses t=5 steps with step size α=0.5. The maximum perturbation magnitude is ε=1 for both. Here t is the number of attack steps, α controls the size of a step, and ε bounds the permitted perturbation. These settings define the particular attack results; they do not represent an exhaustive search over adversarial procedures.

ImageNet-A adds a test involving naturally difficult adversarial examples. ImageNet-C measures behavior under generated corruptions, with 15 corruption types and five severity levels. Its metric is mean corruption error, abbreviated mCE, for which lower values indicate better performance. ImageNet-R and ImageNet-Sketch assess changes in visual presentation. The latter is particularly relevant to the authors’ discussion of shape because sketches remove much of the color and texture information present in ordinary photographs.

The comparison includes convolutional and Transformer-based architectures, as well as robustness-oriented training methods built around ResNet-50. The convolutional reference points include [Deep Residual Learning for Image Recognition](https://md.research.elamur.ai/free/en/papers/he-2015-deep-residual-learning-image-recognition/), [EfficientNet](https://md.research.elamur.ai/free/en/papers/tan-2019-efficientnet-rethinking-model-scaling-convolutional/), and the RegNet family associated with [Designing Network Design Spaces](https://md.research.elamur.ai/free/en/papers/radosavovic-2020-designing-network-design-spaces/). The purpose is to assess the joint relationship among accuracy, computational requirements, and robustness, rather than to compare only a narrow set of Transformer variants.

#### Standard accuracy and computational requirements

The architecture-only RVT-Ti reaches 78.4% Top-1 accuracy on the ImageNet-1K validation set. Adding PAAS and patch-wise augmentation produces RVT-Ti*, which reaches 79.2%. This comparison is useful because it separates the architecture assembled from favorable components from the version containing the additional positional and training methods. Both results concern standard classification, so they also show that the robustness-oriented design does not depend on accepting a decline in the ordinary task under this comparison.

RVT-Ti variants on ImageNet-1K validation Top-1 accuracy Adding PAAS and patch-wise augmentation improves standard classification accuracy.

**The numbers**

| System or setting | Top-1 accuracy % |
| --- | --- |
| RVT-Ti | 78.4 |
| RVT-Ti with PAAS and patch-wise augmentation (this paper) | 79.2 |

For RVT-Ti*, the paper reports 1.3G FLOPs and 10.9M parameters. The authors use these figures to argue that the network is competitive with popular convolutional alternatives while remaining relatively economical. FLOPs describe the computational work of the architecture, while the parameter count describes its learned numerical capacity. Neither measure is interchangeable with actual inference speed, but together they place the accuracy result in a practical resource context.

At the larger scale, RVT-S* reaches 81.9% standard accuracy. The paper states that this is 2.9% above ResNet-50 at the same computational cost in its comparison. The authors also compare this result with EfficientNet-B4, describing similar classification performance while noting that EfficientNet-B4 uses 380×380 input and has lower throughput. The comparison therefore concerns more than the accuracy value: input resolution and processing speed affect the usefulness of an architecture in practice.

RVT-B* is also evaluated, and the discussion reports improvements relative to the corresponding DeiT baseline. However, the authors observe that the incremental gains become smaller as capacity increases. This is an important qualification to the standard-performance story. The paper provides strong motivation for its smaller architectures, but does not establish that increasing capacity preserves the same advantage from the added techniques. Its stated benefit remains a balance across ordinary performance, robustness, and resource requirements.

#### Deliberately perturbed inputs

Under the reported FGSM and PGD evaluations, the authors find a strong relationship between architectural design and adversarial accuracy. Transformer-based networks often perform better than convolutional comparisons at similar scale and computational cost, but the result is not uniform across Transformer variants. Swin-T is discussed as an example where windowed attention supports efficiency while weakening adversarial robustness. TNT-S is another example of favorable standard accuracy failing to predict a favorable attack result.

The authors report that RVT-Ti and RVT-S improve FGSM accuracy by over 10% compared with earlier vision Transformer variants. PAAS and patch-wise augmentation extend the advantage in their discussion. That statement supports the architectural motivation, but it should remain attached to the reported attack. It does not mean that the same improvement applies to every perturbation budget, every attack procedure, or every architecture against which a reader might wish to compare.

The ordinary accuracy results make this distinction especially visible. An architecture can classify familiar inputs well while relying on relationships that are easy for a particular attack to disrupt. Conversely, selecting components for robustness can preserve or improve standard accuracy in this setting. RVT’s contribution is therefore not an asserted universal tradeoff between accuracy and robustness. It is a demonstrated combination that performs well on both under the authors’ evaluation.

#### Corrupted images

RVT-S* records 49.4 mCE on ImageNet-C. Because mCE is an error measure, a smaller value is favorable. The authors describe this as an improvement of 4.2 over the leading DeepAugment comparison in the leaderboard they discuss. The result supports the claim that their combined architecture and training procedure handles common image corruptions well, while the leaderboard claim remains specific to the comparisons and conditions of the paper.

The authors connect corruption robustness with the ability to use shape-related information across the image. Their explanation is that long-range attention makes such information easier to capture, reducing dependence on more fragile local appearance. This interpretation is consistent with the design choices they favor, particularly broad attention and explicit position information. It is still an explanation of the empirical pattern, instead of a separately proven causal account of every corruption result.

Training augmentation is a relevant fairness issue here. The paper explicitly excludes [RandAugment](https://md.research.elamur.ai/free/en/papers/cubuk-2020-randaugment-practical-automated-data-augmentation/) from its stated robustness comparison because some transformations overlap with the corruption conditions represented by ImageNet-C. The authors want to avoid attributing an advantage to general robustness when it could reflect exposure to related transformations. Their patch-wise augmentation uses simpler operations, although this design choice does not by itself resolve every possible relationship between augmentation and evaluation data.

#### Sketches and other visual representations

For out-of-distribution evaluation, the paper reports 35.0% accuracy on ImageNet-Sketch and 46.9% on ImageNet-R for RVT-S. These are separate results on separate datasets, not components of a combined score. They support the claim that the architecture can generalize to visual representations beyond the ordinary photographic setting. The sketch result is particularly informative for the authors’ argument that spatial and shape information matter when texture and color cues are unavailable.

The abstract and introduction also attribute leading leaderboard positions to RVT-S* across ImageNet-C, ImageNet-Sketch, and ImageNet-R. The distinction between RVT-S and RVT-S* should be preserved when reporting specific values: the out-of-distribution values stated above are assigned to RVT-S in the results discussion. The broader starred-version claim should not be used to silently relabel those measurements. A careful account can report both the numerical result and the authors’ leaderboard claim while keeping their attribution explicit.

ImageNet-A belongs to the evaluation suite, but its exact RVT scores are not stated in the narrative discussion. The appendix nonetheless uses it to show that architectural rankings can differ across tests. This is a useful boundary on the results section: the experiments support a broad robustness investigation, but the available numerical statements do not justify filling every benchmark cell or constructing a complete ranking from qualitative claims alone.

### What the ablations show

#### Better initial features help, with an important exception

The patch-embedding comparison supports extracting useful low-level information before the main Transformer processing. Both convolutional and tokens-to-token alternatives improve on the original linear embedding in the component discussion. The authors interpret this as evidence that edges, corners, and other local structure give the later network a better foundation. This finding supplies the rationale for RVT’s convolutional input stem.

The appendix complicates a simple ranking. The tokens-to-token embedder improves results on ImageNet-C and several natural distribution-shift benchmarks, yet its PGD robust accuracy is only 4.7%. This is not a minor detail beside the favorable results. It demonstrates that a representation helpful for ordinary generalization and some robustness conditions can remain vulnerable to a particular adversarial procedure. It also strengthens the authors’ case for using a collection of benchmarks when selecting components.

#### Position information matters more than its familiar forms suggest

Removing position information has a larger effect than the small differences among several ways of supplying it. The paper cites an earlier finding of a 4% decline in standard accuracy without position embeddings. Its own discussion reports an 8% accuracy decline on ImageNet-Sketch when position encoding is absent. The sketch result supports the idea that arrangement becomes especially important when texture cues are missing.

The authors compare learned absolute positions, sinusoidal absolute positions, learned relative positions, and input-conditioned positions. The relative-position approach connects to [Self-Attention with Relative Position Representations](https://md.research.elamur.ai/free/en/papers/shaw-2018-self-attention-relative-position-representations/). Their overall conclusion is that familiar alternatives have limited effects on robustness compared with the importance of having position information at all. Input-conditioned encoding performs poorly in their account, which they attribute to its sensitivity to changes in the input.

That interpretation should be separated from the observation. The observation concerns measured performance in the tested configurations. The explanation proposes that changing positional representations can introduce another route through which input changes destabilize the network. PAAS responds by making positional scaling input-independent. The experiments motivate this choice, but they do not establish that every input-dependent position mechanism must be fragile.

#### Stage allocation changes different kinds of robustness differently

Redistributing a fixed total of 12 blocks improves ordinary accuracy across the tested stage variants. This supports the usefulness of hierarchical image processing. Yet the adversarial results do not improve uniformly. Allocating more processing to large spatial representations can weaken robustness and increase resource consumption. The authors therefore favor V2 as a practical compromise across the measures they examine.

The appendix identifies V6 as a particularly informative exception. It performs poorly on adversarial tests while doing best on ImageNet-A and ImageNet-R within that stage comparison. This prevents a broad conclusion that one progression of resolutions is inherently the most robust. The stronger conclusion is conditional: stage allocation influences different failure conditions in different ways, so the preferred allocation depends on the evaluation objectives.

#### Head organization and the placement of locality matter

The head-count ablation keeps total feature dimensionality fixed while changing its division across heads. Improvement up to 8 heads suggests that the way a feature budget is organized can matter independently of its total size. The authors explain the result through more complete and less redundant attention. The comparison supports the importance of head configuration, while leaving the proposed representational explanation less directly established than the accuracy measurements.

The locality experiments provide another distinction. Restricting self-attention to windows hurts the measured robustness, whereas adding depth-wise convolution inside the feed-forward network helps. The latter supplies local exchange without removing the global attention route. Taken together, these comparisons argue against treating locality as a single property with a universally positive or negative effect. Its consequences depend on which operation is changed and what information remains able to travel through the network.

Replacing CLS with averaged output-token features also improves adversarial robustness in the component analysis. The authors connect the result to a more translation-tolerant aggregation of visual information. This comparison is useful because it questions an architectural convention at the point where the final decision is assembled. The paper’s evidence favors pooling for its construction, although the discussion does not provide an exact effect size for every benchmark.

#### Repeated PAAS helps until gains saturate

The PAAS ablation compares application in an individual block with application in multiple blocks. Performance improves as the positional mechanism is used more widely, but the benefit saturates after 5 blocks. This suggests that repeated positional guidance can be useful without implying that it must be inserted everywhere. The result also helps define the final augmented architecture rather than leaving placement as an unspecified implementation choice.

Ordinary learned position embeddings receive a comparable repeated-placement test. They show a similar broad trend, but do not reach the reported performance of PAAS on standard or robust accuracy. This matters because some benefit could otherwise be explained simply by supplying position information repeatedly. The comparison indicates that PAAS’s particular integration with attention contributes beyond the fact that the positional signal appears in multiple places.

The attention visualization adds a diagnostic perspective. It shows an adversarial input producing distracting attention in the comparison without PAAS, while the learned positional scaling reduces such activation in the displayed example. This supports the authors’ account of a soft filter over position pairs. It remains an illustration of behavior, however, rather than evidence that the same visual mechanism explains every successful prediction or every robustness gain.

#### Simple patch transformations provide useful diversity

The augmentation ablations compare random resized crop, horizontal flip, and Gaussian noise at patch level. Each improves both standard and robust accuracy in the authors’ account, with Gaussian noise providing the strongest robustness benefit among the tested individual choices. The experiments therefore support the use of modest local transformations rather than requiring a complicated patch-level augmentation policy.

Combining transformations gives only a limited further benefit, although the complete combination remains the authors’ preferred setting. This is different from assuming that more augmentation diversity must always produce a large additional gain. The result points toward the level at which augmentation is applied as an important part of the contribution. Independently transformed patches provide variation that image-wide transformations do not supply, even when the available patch operations are simple.

The discussion places this method alongside [mixup](https://md.research.elamur.ai/free/en/papers/zhang-2017-mixup-empirical-risk-minimization/) and other augmentation approaches, but the mechanism is specific to patch sequences. Its experiments do not establish that every way of disturbing patches is beneficial. They establish that the selected mild transformations, applied with the stated settings and after image-level augmentation, improve the tested configurations.

#### Transfer and visualization broaden the analysis

The combined PAAS and patch-wise augmentation techniques are tested on DeiT-Ti, ConViT-Ti, and PiT-Ti. The authors report average improvements exceeding 1% in standard accuracy and 5% in robust accuracy across the augmented comparisons. This supports some portability beyond the architecture assembled as RVT. Because the techniques are combined in this transfer experiment, the result does not independently identify the contribution of each technique within every receiving architecture.

Additional analyses visualize learned representations. The t-SNE comparison uses features from ImageNet validation images and ImageNet-C, with 10 randomly selected classes for readability. The authors describe RVT’s display as having tighter within-class grouping and clearer separation between classes. Feature-map comparisons also suggest less redundancy, while the displayed loss surface is flatter than the ResNet50 comparison. These analyses offer possible explanations and diagnostic context; the benchmark results remain the direct evidence for predictive robustness.

### Limitations

#### Limits the authors explicitly recognize

The authors acknowledge a restricted augmentation search because training resources are limited. They test the selected crop, flip, and Gaussian-noise operations instead of an exhaustive set of patch transformations. The final combination is therefore the preferred choice among the investigated options, not evidence that the entire augmentation design problem has been solved. Other transformations, probabilities, or interactions could behave differently without contradicting the reported results.

They also identify the need for multiple robustness benchmarks. The appendix’s tokens-to-token and stage-distribution examples show why: a configuration can improve natural distribution-shift performance while remaining weak under adversarial attack. This is an explicit limit on conclusions drawn from a narrow evaluation. The authors’ own evidence argues against describing an architecture as robust without specifying which tests support that description.

The complexity of the tokens-to-token embedder is another stated constraint. Its favorable component results do not make it the chosen RVT input mechanism because the authors consider its scaling with image size too costly for their preferred compromise. Their method is therefore a practical architecture selection, not a search for the highest score regardless of computation. The same qualification applies to their attention-head and stage choices.

The PAAS discussion itself uses a limited defense claim. It presents evidence of resistance to some white-box attacks and highlights FGSM, instead of establishing a general adversarial guarantee. That wording is appropriate to the experiments. A learned positional scaling mechanism may reduce harmful interactions in the tested setting without preventing every way an attacker could exploit the network.

#### Limits visible in the experimental setup

The attack settings define a bounded claim. PGD uses t=5, α=0.5, and ε=1 in the reported evaluation. These results demonstrate performance against that configured procedure. They do not establish behavior under longer optimization, different attack choices, or another perturbation budget. The paper’s attack discussion also does not give enough detail to infer every aspect of input scaling from the magnitude statement alone. Those details should remain unspecified rather than being supplied from assumptions.

ImageNet-C, ImageNet-R, and ImageNet-Sketch each operationalize a particular kind of difficulty. Success on them is valuable, but it does not cover every corruption or distribution change an application may encounter. Nor do these classification evaluations establish performance on a different visual task. The general architectural ideas may be reusable, but their effectiveness outside the tested tasks would require separate evidence.

The main study trains on ImageNet-1K. The appendix mentions experiments involving ImageNet-22K and subsequent [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/), but its narrative does not state detailed numerical outcomes for that setting. It is therefore possible to say that the authors investigate larger-data training, while remaining unable to quantify its effect from the stated results. The main numerical conclusions should stay attached to the training conditions for which the paper actually gives values.

RVT combines multiple design changes, and RVT* adds both PAAS and patch augmentation. The component studies help explain the construction, but they do not amount to an exhaustive analysis of every interaction. A component that helps the baseline may contribute differently after other parts change. The assembled architecture’s success verifies the usefulness of the combination under the evaluation, while leaving a complete causal decomposition unresolved.

The transfer experiment has a related limit. Testing the combined techniques on additional architectures supports portability, but does not prove that PAAS and patch augmentation contribute equally or independently in each case. A receiving architecture may benefit mainly from one addition, or from their interaction. The reported average gains cannot resolve that distinction by themselves.

#### Explanations are less conclusive than behavioral measurements

The paper repeatedly interprets successful designs through shape sensitivity, complementary attention, reduced feature redundancy, and suppression of irrelevant interactions. These are plausible explanations of the observed behavior. Their evidential status differs from a measured accuracy or corruption-error result. A benchmark demonstrates how frequently predictions succeed under its conditions; an explanatory visualization suggests why some of those successes may occur.

The PAAS equation also warrants careful reading. Its matrix supplies position-specific multipliers, and the authors describe learned small values as suppressing irrelevant relationships. The method discussion does not establish that every entry must have a particular sign or range, nor that the matrix will suppress every misleading interaction. It is a learned operation whose useful behavior is assessed empirically. The soft-mask explanation should not be expanded into an unreported mathematical guarantee.

The t-SNE displays show selected representations in a low-dimensional view. Their apparent grouping is useful for comparison, but does not establish that all classes are equally well separated or that every corrupted input remains stable. The same applies to the feature-map displays: less visible repetition supports a diagnostic interpretation of representational diversity, but is not a complete measurement of what information the network uses.

The loss-landscape comparison is similarly suggestive. The authors connect a flatter displayed surface with stability under changes to the input. That visualization does not independently establish robust behavior throughout the full input space. Its strongest role is to accompany the benchmark evidence and motivate further investigation into the relationship between optimization geometry and generalization.

#### The scope of the practical claim

RVT’s central practical claim is a favorable balance among ordinary accuracy, computational requirements, and measured robustness. It is not a claim that every component is optimal for every deployment. Resource priorities can differ, input resolution can change, and particular failure conditions can matter more than others. The authors’ choice of V2 and the convolutional embedder already illustrates how practical constraints shape the final architecture.

Leaderboard statements also describe a comparison at the paper’s evaluation point. They should be read as reports about the entries and conditions the authors discuss, rather than as timeless rankings. The durable contribution is the component-level investigation and the resulting mechanisms. Those remain useful even when a different setting changes which architecture receives the highest score.

For Mova or another language system, the transfer limit is stronger still. The paper provides image-classification evidence. It does not show that patch augmentation, spatial scaling matrices, or the same architectural compromises improve language interpretation. Borrowing its method of inquiry is well motivated; claiming that its visual mechanisms already solve language robustness would go beyond the evidence.

### What came after

[Masked Autoencoders Are Scalable Vision Learners](https://md.research.elamur.ai/free/en/papers/he-2021-masked-autoencoders-scalable-vision-learners/) is the citing work identified alongside RVT. The citation information establishes a connection between the papers, but does not describe how that work uses RVT’s findings. It therefore does not support a claim that the citing work adopts PAAS, uses patch-wise augmentation, reproduces the component study, or validates RVT’s robustness results.

The distinction is important because citation and technical inheritance are different relationships. A later discussion can cite a paper as background, as a comparison, or as evidence for a broader argument. Without an account of the citing work’s treatment, assigning it a particular role would create an unsupported research history. Even the ordering should remain cautious: the listed work carries a date earlier than the date attached to *Towards Robust Vision Transformer*, so the citation alone does not establish a simple chronological progression.

What RVT leaves for subsequent work is clearer than what this citation establishes. Its component analysis raises testable questions about where local processing belongs, how position should influence attention, and whether augmentation should vary relationships between input parts. Its appendix also supplies a methodological warning: improvements across several benchmarks can coexist with a serious weakness on another. These are concrete starting points for further investigation, while the documented connection to *Masked Autoencoders Are Scalable Vision Learners* remains a citation whose specific technical use is not established.

## Cite

Cite as Xiaofeng Mao, Gege Qi, Yuefeng Chen, Xiaodan Li, Ranjie Duan, Shaokai Ye, Yuan He and Hui Xue. 2022. Towards Robust Vision Transformer. IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1109/cvpr52688.2022.01173](https://doi.org/10.1109/cvpr52688.2022.01173) · [arXiv 2105.07926](https://arxiv.org/abs/2105.07926)

```bibtex
@inproceedings{mao2022robust,
  title = {{Towards Robust Vision Transformer}},
  author = {Xiaofeng Mao, Gege Qi, Yuefeng Chen, Xiaodan Li, Ranjie Duan, Shaokai Ye, Yuan He and Hui Xue},
  booktitle = {IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.01173},
  eprint = {2105.07926},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/cvpr52688.2022.01173}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
