Transformers eat vision (2020)
The Vision Transformer (ViT) breaks an image into a grid of small patches (e.g. 16×16), embeds each patch as a vector, and feeds the sequence of patch embeddings into a standard transformer encoder. No convolutions. Pretrained on enough data, ViT matches or beats CNNs across vision benchmarks.
This was a shock. The CNN inductive biases (locality, translation invariance) had been treated as essential for vision. ViT showed that with enough data and compute, attention can learn those biases instead of having them baked in.
The patches → tokens trick
A 224×224 image with 16×16 patches gives 196 patches. Each patch is flattened to a 768-d vector via a linear projection (or, equivalently, a Conv2d with kernel=16, stride=16). Add a learned position embedding and a [CLS] token. Now you have a sequence of 197 tokens — feed it into a standard transformer encoder.
Modern vision foundation models
ViT is the architecture; the weights people actually use are pretrained foundation models: CLIP (OpenAI; image-text contrastive), DINOv2 (Meta; self-supervised), SAM (Meta; segmentation), SigLIP (Google; image-text). These are downloadable backbones that turn vision tasks into "embed the image, train a head" — far easier than training a network from scratch.