Lesson 8.10advanced3 h

Multimodal models

One model, many senses: CLIP, vision-language models, text-to-image, speech and video

Frontier models now see, hear and draw. Under the hood a small set of ideas does almost all the work: a contrastive objective that aligns images and text in one space (CLIP, the InfoNCE of 5.8 Self-supervised and contrastive learning), a projector that turns image patches into tokens an LLM can read (5.7 Vision Transformers, 7.4 Inside the block: residuals, LayerNorm, FFN and embeddings), cross-attention that lets a diffusion model follow a prompt (8.9 Generative models II: Diffusion and flow matching), and encoder–decoder transformers for speech (7.7 Encoder–decoder: T5, BART and choosing an architecture). Knowing them lets you read any multimodal model card, build multimodal RAG (9.7 Advanced RAG patterns), and give agents eyes (10.8 Coding agents and computer use).

You'll be able to

  • Write CLIP's symmetric InfoNCE loss and explain zero-shot classification
  • Describe how vision-language models connect a vision encoder to an LLM and what visual tokens cost
  • Explain text conditioning in diffusion models via cross-attention and joint attention
  • Summarize how Whisper and modern speech models process audio
  • Identify evaluation benchmarks and typical failure modes of multimodal models

Key ideas

  1. CLIP aligns image and text encoders with a symmetric InfoNCE loss over an N×N similarity matrix; cosine similarity then enables zero-shot classification and retrieval.
  2. Vision-language models project vision-encoder patches into LLM token space (LLaVA recipe); images cost hundreds to thousands of tokens, and frontier models train natively multimodal.
  3. Text-to-image diffusion reads the prompt through cross-attention (U-Net) or joint attention (DiT), sharpened by classifier-free guidance.
Show 4 more key ideas
  1. Whisper is an encoder–decoder transformer over log-Mel spectrograms with task tokens; speech LLMs and codec-token generators extend the VLM recipe to audio.
  2. Video models diffuse spatiotemporal latents with transformer backbones — the same math at far higher compute.
  3. Early fusion (discrete tokens for every modality) vs late fusion (continuous features + separate generator) is the key architectural choice for unified models.
  4. Typical failures: object hallucination, counting, spatial reasoning, small text; evaluate with MMMU/MathVista/DocVQA and task-specific sets.

Suggested path through this lesson