The core problem: everything must become tokens

Transformers still win across every modality at scale, and they speak tokens — discrete or continuous embeddings, each representing a semantic unit. Text subwords are roughly meaningful; a single pixel is not. So the central challenge of multimodality is finding the image/audio equivalent of the BPE tokenizer: convert non-text into tokens a transformer can digest (input), and generate them back out (output). This lecture is almost entirely about the input side.

CLIP — contrastive language-image pre-training (2021)

In the GPT-3 era, vision was still ImageNet/ResNet supervised learning. CLIP asked: can we leverage the web's noisy image-text pairs the way LMs leverage noisy text? The objective is simple — encode each image to a vector Iᵢ and each caption to Tᵢ, and make matched pairs align far more than mismatched ones (a 2N-way softmax classification over the batch):

maximize the diagonal (Iᵢ·Tᵢ), minimize off-diagonal I₁I₂I₃I₄ T₁T₂T₃T₄

Vision encoder: a ViT (beat ResNets) — chop the image into patches (14×14), treat each patch as a token, add positional embeddings, run a transformer, attention-pool to one vector. The best model is ViT-L/14 @ 336². Images are resized (short side to 336) and center-cropped — a heuristic that's fine for classification-centric work. Text encoder: a GPT-2-style transformer, using the EOS activation as the sequence vector. Data: 400M web pairs (CLIP, unreleased) / LAION-5B (OpenCLIP, which bootstrapped CLIP itself for filtering).

Why this mattered (and its limits)

Zero-shot CLIP (dot-product the image against label texts) beat a ResNet trained on 1.2M hand-labeled ImageNet images — leveraging noisy organic web data instead of Mechanical Turk. Notably, a bag-of-words CLIP objective is more efficient than predicting the exact caption tokens (for classification, fine-grained token order doesn't matter). Downsides: CLIP needs huge batches (~32K) and a softmax over the whole batch (not decomposable like LM training).

SigLIP — sigmoid loss (Google)

SigLIP replaces CLIP's multi-class softmax with a per-pair binary classification (aligned or not): diagonal entries are +1, off-diagonal −1, with a log_sigmoid loss. This decouples the loss from batch size — so small batches actually work better (CLIP degrades), and it parallelizes cleanly (each device holds some pairs and rotates text shards around to cover the off-diagonal blocks, like DDP). Trained on WebLI (~billion pairs, plus OCR'd text-image pairs, multilingual), it's far more efficient than CLIP, with ~32K as its critical batch size.

CLIPSigLIP
Lossmulti-class softmax over batchper-pair sigmoid (binary)
Batch couplingloss tied to batch sizedecoupled — small batches OK
Parallelismfull-batch softmaxshard + rotate

The template

Every VLM follows the same recipe — take a pre-trained vision encoder + a pre-trained LM and stitch them with an adapter, then mid/post-train (not from scratch):

image
vision encoder
CLIP / SigLIP
adapter
project to LM space
LM (with text tokens)
→ text out

The image vectors get mapped into the LM's token-embedding space and concatenated with text embeddings; the whole sequence runs through a standard transformer. Output is always text (these models ingest images but don't generate them).

ModelEncoderLMAdapterKey addition
LLaVA (2023)CLIPVicunalinear WGPT-4-synthesized instruction data (from MS-COCO)
LLaVA-OneVision (2024)SigLIPQwen-22-layer MLPmulti-image + video; AnyRes
Qwen-VL (2023)OpenCLIPQwencross-attn → 256 tokensimage/box/ref tags; trains encoder
Qwen2-VL (2024)fine-tuned ViTQwen-22×2 compress → 66/patchdynamic resolution; M-RoPE
Qwen3-VL (2025)SigLIP-2Qwen-3 (dense/MoE)DeepStack256K context, interleaved M-RoPE, video timestamps

LLaVA → OneVision: data and resolution

LLaVA trains in two stages: (1) freeze encoder + LM, train only the projector W (alignment — make image vectors look like token embeddings); (2) freeze the encoder, fine-tune W + LM on the synthesized image→text data. OneVision upgrades the parts and adds multi-image/video, via the key resolution trick:

AnyRes — handle any resolution

A fixed 336² encoder can't read a document. So split a high-res image into encoder-sized tiles, encode each separately, and concatenate the vectors (plus one downsampled global view); interpolate down if there are too many. Token budgets are then allocated by modality: a single image gets the full view + up to 9 crops; multiple images get base resolution each; video uses fewer tokens/frame (up to ~32 frames) to avoid context blow-up. A nice surprise: cross-modal transfer — single-image OCR training generalizes to multi-image, and single-image visual prompting generalizes to video.

Qwen-VL series: dynamic resolution & M-RoPE

Qwen2-VL made resolution truly dynamic (a big picture → ~11K tokens, a tiny equation → ~8), via AnyRes tiles + 2×2 compression to ~66 tokens/patch. It also introduced multimodal RoPE (M-RoPE): positions are now 3D (time, height, width), with RoPE computed per axis and concatenated. Qwen3-VL refines this:

Note: the vision encoder is far smaller than the LM (often <1B params) — patch encoding is a local operation with little knowledge/reasoning; the capability lives in the LM.

Map images to discrete tokens, then just train an LM

VLMs only generate text. Chameleon (Meta, 2024) instead maps everything to discrete tokens so you can analyze and generate images uniformly (interleaved text+image). The image tokenizer is a VQ-VAE: encode an image to a continuous vector, round to the nearest of ~8K codebook codes, decode to reconstruct (trained on reconstruction loss); a 512² image → 1024 tokens. Then training is just standard LM training — no adapter, no separate encoder.

image
VQ-VAE encode
nearest codebook code
~8K codes
discrete tokens
like text → one LM
⚠️ Elegant, but it underperformed

Calling image patches "tokens" doesn't hide that they behave differently from text: text is low-entropy (predictable next word), image tokens are high-entropy (which shade of blue?). Mixing them caused training instability (parameter norms blowing up), patched with QK-norm + z-loss. And discretization loses fine detail (bad for OCR), plus multimodal weighting is tricky. VQ-VAE generation faded once diffusion proved better.

Golden rules & takeaways

This rounds out the course: from tokenization and architecture through systems, scaling, data, alignment, reasoning — and now seeing.

References

Primary source is the lecture itself. Key works named:

  1. Radford et al. (2021) — CLIP · Dosovitskiy et al. (2020) — ViT
  2. Schuhmann et al. (2022) — LAION-5B / OpenCLIP
  3. Zhai et al. (2023) — SigLIP
  4. Liu et al. (2023) — LLaVA · Li et al. (2024) — LLaVA-OneVision
  5. Bai et al. (2023) — Qwen-VL · Wang et al. (2024) — Qwen2-VL
  6. Chameleon Team (2024) — Chameleon
  7. van den Oord et al. (2017) — VQ-VAE