Skip to content

Summary: Vision and language

Modern AI does not treat images and language as separate problems. CLIP (Radford et al. 2021) crystallized the architectural pattern: an image encoder + a text encoder trained jointly on ~400 million web (image, text) pairs with a contrastive loss; matching pairs close in a shared embedding space, mismatched pairs far. The trained embedding space is the asset, and many useful applications fall out of it: zero-shot classification (encode class names as text, pick the closest), image-text retrieval (text-to-image and image-to-text search via nearest-neighbour), captioning (add a language-model decoder with cross-attention to image features), visual question answering (captioning + a question input). Modern vision-language models (VLMs) generalize: one trained system handles classification, retrieval, captioning, VQA, and more from a pre-trained image encoder, a pre-trained language model, and a bridge module that connects them. The economic frame closes Phase 3: image-text pairs are abundant on the web; CLIP-style pre-training exploits that abundance.

  • CLIP’s two-tower setup. Image encoder (ViT or ResNet) + text encoder (transformer) trained jointly on ~400M web (image, text) pairs. Contrastive loss (InfoNCE) on a shared, L2-normalized embedding space: matching pairs close in cosine similarity, mismatched pairs far. The trained geometry of the joint embedding space encodes cross-modal semantic structure.
  • Worked cosine (body): unit-length img = [0.6, 0.8], matching txt_cat = [0.5, 0.866] → cos ≈ 0.993; unrelated txt_car = [0.8, -0.6] → cos = 0.0. The shared-space geometry is the asset; downstream applications read value from it.
  • Zero-shot classification. Build a text prompt per candidate class (“a photo of a {class}”); encode each with CLIP’s text encoder; at inference, encode the image and pick the class whose text embedding is closest. No training on the target task. Competitive with fully-supervised models on many benchmarks at the time of publication. Prompt engineering (template wording; ensembling multiple templates) materially affects accuracy; this was one of the first cases in modern AI where prompt design moved downstream metrics.
  • Image-text retrieval. Same embedding space supports text-to-image and image-to-text search via nearest-neighbour lookup. Engine behind modern photo-gallery search.
  • Captioning. Add a language model decoder (transformer generating text token-by-token) with cross-attention to image features; train on image-caption pairs. Modern architectures: BLIP, CoCa, LLaVA and successors.
  • Visual Question Answering (VQA). Image + question → answer. Captioning architecture with an additional text input. Modern general-purpose VLMs handle captioning and VQA from one trained system; the standalone-VQA-architecture era has largely been subsumed.
  • Modern VLMs. Image encoder + language model + bridge module (adapter or learnable query tokens) trained on image-text pairs and image-question-answer triples; handles many downstream tasks from one trained system. Deep mechanics live in T24 per the Phase-0 arc.
  • The economic frame. Image-text pairs are abundant on the web. CLIP-scale (400M-pair) training was feasible because the data was already there (alt text, captions, surrounding text). Same shift as L10’s “labels expensive, unlabeled abundant” but applied across modalities: stop paying for hand-labels when the world has enough natural-occurring structure to exploit.

If you have ever searched a photo gallery by typing what you wanted, used a text-to-image system, asked a screen-reader to describe an image, or interacted with a “vision-language” AI feature, CLIP-style pre-training is doing the connecting work, often as one component inside a larger system. Even text-to-image diffusion (L12) uses a CLIP text encoder as its conditioning signal. The same architectural pattern (two encoders, contrastive pretraining on naturally-paired data) is the foundation under most modern multimodal vision. Prompt engineering for zero-shot classification, multi-template ensembling, and domain-specific CLIP variants (BiomedCLIP for medical, RemoteCLIP for satellite, etc.) are the working practitioner’s standard tools.

Image and text are different modalities; CLIP showed that a single shared embedding space can hold both, learned from naturally-paired web data. Phase 3 closes on this lesson and the next two.