Home Knowledge Base The Vision Transformer (ViT)

The Vision Transformer (ViT) showed that the Transformer architecture built for language works just as well on images, and that insight is the bridge to today's multimodal models. Instead of processing pixels with convolutions, a ViT cuts an image into a grid of small patches, treats each patch as a token, and feeds the sequence into a standard Transformer encoder. Once an image is "just a sequence of tokens," it can share an architecture — and eventually a single model — with text, which is exactly what vision-language and multimodal systems exploit.\n\n``svg\n\n \n Vision Transformers & Multimodal Models — Seeing with a Transformer\n cut an image into patches, treat them as tokens — the same trick that lets one model jointly understand images and text\n \n ViT: an image becomes a sequence of tokens\n \n \n \n \n \n \n \n \n \n split into patches\n \n CLS\n \n 1\n \n 2\n \n 3\n \n 4\n patch tokens + a [CLS] token\n \n \n \n + linear embedding & positional encoding\n \n \n \n Transformer Encoder\n self-attention lets every patch see every other patch\n \n \n \n class label / image features\n no convolutions — but needs large-scale pre-training\n \n \n \n From image tokens to multimodal\n image emb\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n text emb\n CLIP\n contrastive training aligns\n matching image–text pairs\n on the diagonal → zero-shot\n \n VLM: give an LLM eyes\n \n vision\n encoder (ViT)\n \n projector\n \n LLM\n \n answer\n \n \n \n \n \n \n \n text prompt\n \n \n \n One unifying idea\n image patches, words — even audio frames — all become tokens in one Transformer.\n That shared token space is why a single architecture can see, read, and — in “omni” models — map any modality to any other.\n\n``\n\nA ViT turns an image into patch tokens. The image is split into fixed-size patches (often 16×16 pixels), each patch is flattened and linearly projected into an embedding, and learned positional encodings are added so the model knows where each patch sat. A special classification token is prepended, the whole sequence runs through Transformer encoder layers where self-attention lets every patch attend to every other, and the output at the classification token is used to predict the label. There are no convolutions anywhere in the core model.\n\nViT trades inductive bias for scale. Convolutional networks bake in helpful assumptions — locality and translation equivariance — that ViTs lack, so on small datasets a ViT actually underperforms a comparable CNN. Its advantage appears with scale: pre-trained on very large image collections, a ViT matches or beats the best CNNs, because attention can learn flexible, long-range relationships that convolutions cannot. Data-efficient training recipes and distillation later narrowed the data requirement.\n\nCLIP aligns vision and language in a shared space. Trained contrastively on hundreds of millions of image–caption pairs, CLIP pairs an image encoder (usually a ViT) with a text encoder and pushes matching image–text embeddings together while pushing mismatched ones apart. The result is a joint embedding space where an image and its description land near each other, enabling zero-shot classification and image–text retrieval without task-specific training. CLIP's image encoder became the visual front-end for much of what followed.\n\nVision-language models give a language model eyes. Systems such as LLaVA, Flamingo, and GPT-4V connect a pretrained vision encoder to a large language model through a small projection or adapter, so image-derived tokens enter the LLM's context alongside the text prompt. The LLM can then answer questions about a picture, read documents, or describe scenes. "Omni" or any-to-any models push this further, mapping among text, images, audio, and video within one model, so a single system can both perceive and generate across modalities.\n\nThe payoff and the open problems. Tokenizing every modality unifies perception and language under one Transformer, which is why progress in one area now lifts the others, and why frontier assistants are natively multimodal. The hard parts are the cost of high-resolution and video inputs, hallucination on fine visual detail, and the resolution-versus-token-count trade-off — more patches mean sharper vision but a longer, more expensive sequence. Better visual tokenization and grounding are where much of the current research sits.\n\n| Stage | What it does | Key idea |\n|---|---|---|\n| Vision Transformer | image → patch tokens → encoder | patches are tokens |\n| CLIP | align image and text embeddings | one contrastive shared space |\n| Vision-language model | vision encoder feeds an LLM | image tokens in the LLM's context |\n| Omni / any-to-any | map among many modalities | one model perceives and generates |\n\nRead vision transformers and multimodal models through a tokenize-everything lens rather than a new-vision-network lens: the breakthrough is not a better image classifier but the realization that once patches, words, and audio frames are all tokens, one Transformer can attend across them — turning separate vision and language systems into a single model that sees and reads at once.\n

visual language modelvlmllavagpt4vmultimodal llmvision language modelimage question answering

Related Topics

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.