Why do ViTs work so well?
This is a quick note on why vision transformers (ViTs) work so well. The performance of large ViTs nowadays surpasses that of more traditional convolutional neural networks (CNNs) on many benchmarks. This does not mean that ViTs are the best model architecture for all vision problems, or that convolutional networks are obsolete. By no means! It is still worth understanding why ViTs work so well in practice.
The short answer is that certain properties of the model architecture in combination with large-scale pretraining make the ViT a strong and flexible general-purpose vision backbone. The ViT’s performance can be attributed to several related factors:
- Weak inductive biases
- Global context
- Good scaling with data and model size
- Compatible with self-supervised learning
- Same architecture as language models
A slightly more detailed discussion of these points is provided below. Before that, we start with a short refresher on ViT architecture. Its inductive biases and suitability for large-scale pretraining are discussed afterwards.
ViT architecture
Originally, the ViT architecture was introduced by [Dosovitskiy et al., 2021]. More exhaustive reviews can be found in [Khan et al., 2022; Palanisamy et al., 2025].
The ViT employs a patch-based image representation. Here, an image is split into non-overlapping patches, each of which is flattened and linearly projected into an embedding space. A positional encoding is added to each patch embedding in order to retain spatial information.
Following this, a learnable class token is introduced in order to aggregate information from all patches into a final representation. It is prepended to the sequence of patch embeddings and then processed by a standard transformer encoder. This encoder stacks multiple blocks of multi-head self-attention and feed-forward nets, each with residual connections and layer normalization.
Finally, the output corresponding to the class token can be used for classification or other learning tasks. A final MLP head is typically used for this purpose. The following figure visualizes the ViT model:
The key component of the ViT is the self-attention mechanism (see also this post). It relates all patch embeddings to each other, despite their spatial distance. This allows the model to capture long-range dependencies and global context at each layer.
Inductive biases
Learning algorithms come with some form of prior knowledge or inductive biases, i.e. architectural properties that encode certain structural assumptions about the data or the problem at hand. For example, CNNs involve a notion of locality, weight sharing and translation equivariance, and hierarchical feature processing. The local convolution operation allows CNNs to focus on fine details, edges and texture.
The patch-centric processing of ViTs, on the other hand, enables them to focus on global patterns, context and shape. While CNNs see increasingly wide image parts only after many layers (when the receptive field has grown enough), attention is a global operation that relates all regions within each layer. Put differently, a conv layer represents a high-pass filter, whereas self-attention acts as a low-pass filter [Park and Kim, 2022].
Generally speaking, though, ViTs carry weaker inductive biases than CNNs [Cordonnier et al., 2020]. While this means that ViTs are more flexible and expressive than CNNs in principle, it also implies that they may require more data. In this context, it has been observed that the performance of ViTs scales well with data and model size [Zhai et al., 2022].
Discussion
Beyond weak inductive biases, a number of other factors contribute to the success of the ViT. The patching scheme of ViTs is a good match for self-supervised learning. In fact, pretraining paradigms such as MAE, DINO and I-JEPA (see here and here) have been developed specifically for ViTs. It is certainly also an advantage that vision and language transformers basically share the same architecture. This allows for leveraging related improvements and enables multimodal learning approaches.
Also, there are architectural improvements that address the quadratic complexity of self-attention. It is noted that tokenizing patches (instead of pixels) is not only a meaningful prior, but also a form of compute and memory reduction. Apart from this, the efficiency of applying attention to images has been improved by introducing hierarchical, locality-aware mechanisms [Liu et al., 2021; Yang et al., 2021; Wang et al., 2021]. A recent survey of these and other developments is provided in [Papa et al., 2024].
Interestingly, some of the aforementioned ViT efficiency improvements correspond to CNN-like inductive biases. Conversely, ConvNeXt is a modern CNN model that draws inspiration from the ViT architecture and training routines [Liu et al., 2022]. Among other things, it uses a patch-style stem (strided, non-overlapping convolution) as well as generally large kernels and receptive fields. DINOv3, a ViT-based vision foundation model, has been distilled into various lightweight ConvNeXt variants [Siméoni et al., 2025]. In this sense, current model architectures often combine elements from both ViTs and CNNs.
All in all, the ViT is an interesting model architecture for vision applications with distinctive inductive biases. It establishes an alternative to CNNs that is particularly well-suited when a large amount of training data is available.