ViT cuts an image into
p×p patches, flattens and linearly projects them into tokens (prepending a [CLS] token for classification plus position embeddings), then feeds them into a standard Transformer encoder; token count
T=(H/p)(W/p) — for 224×224 input and patch 16,
T=14×14=196 (197 with [CLS]). vs CNNs: CNNs have built-in translation-equivariance and locality inductive biases (weight sharing, local connectivity) that are efficient on small data; ViT only has patch-level positional priors, its attention is global, and it lacks pixel-level locality — hence data hunger: ViT-B/16 trained from scratch on ImageNet-1K (1.28M images) reaches ~74% top-1, clearly trailing same-scale CNNs (~76%), while after JFT-300M (300M images) pretraining, ViT-L/16 reaches ~87.8% top-1, surpassing CNNs by ~1–2 points.