Summary
Originally planned as more reinforcement learning, this lecture was reallocated to an overview of multimodal models on the grounds that the course would be incomplete without them. It traces the lineage from CLIP and SigLIP as image encoders, through the standard vision-language model template (encoder plus projector plus language model) as built by the LLaVA and Qwen series, and ends with Chameleon’s discrete-token alternative. The focus is almost entirely on the input side — how non-text data becomes something a transformer can consume — rather than on generation. The framing question throughout is what plays the role of the BPE tokenizer for images.
Key Takeaways
- Transformers speak tokens, so every modality must be converted into discrete or continuous tokens where each token carries a semantic unit. A subword qualifies; a single pixel does not. Text tokenization is a mild annoyance, but for images there is no obvious equivalent.
- CLIP trains an image encoder and a text encoder so that matched pairs have high dot products, which amounts to 2N softmax classification problems over a batch. It used 400 million scraped image-text pairs, a ViT-L/14 at 336x336 with attention pooling, and a GPT-2 style text encoder whose EOS activation represents the sequence. The headline result was that zero-shot CLIP beat a ResNet trained on 1.2 million annotated ImageNet images. Notably, training a stronger model to predict caption tokens did worse than bag-of-words CLIP for representation quality.
- CLIP’s weaknesses are batch-related: it needs batches around 32,000, and the softmax spans the whole batch so it does not decompose the way language-model training does. SigLIP replaces the multi-class objective with a per-pair sigmoid — is this image and text aligned, yes or no — which decouples the loss from the batch size, permits a rotating shard schedule across devices to cover off-diagonal blocks, and trains far more cheaply (roughly five days on 32 TPUv4 versus ten days on 256 TPUv3).
- The VLM template is to stitch, not to pretrain from scratch: a pretrained vision encoder, a projector into the language model’s embedding space, and a pretrained LM. LLaVA used CLIP ViT-L/14, a single linear matrix W, and Vicuna, trained in two stages — freeze everything and train W for alignment, then unfreeze the language model. Its 158,000 training examples were synthesized by prompting GPT-4 with human MS COCO captions and bounding boxes.
- Fixed 336x336 crops destroy fine detail, which breaks OCR. AnyRes handles this by tiling an image into encoder-sized pieces plus one downsampled global view and concatenating the resulting vectors, interpolating down when there are too many. LLaVA-OneVision budgets tokens by modality: up to nine crops for a single image, base resolution for multiple images, and fewer tokens per frame for video with a cap around 32 frames.
- Capability transfers across modality boundaries without matching training data. OCR trained only on single images supports multi-image GUI screenshot tasks, and visual prompting (circling a region) trained only on single images generalizes to tracking a highlighted player across video frames.
- The Qwen line shows the adapter evolving: one layer of cross-attention to a fixed 256 tokens in Qwen-VL, then dynamic resolution with 2x2 patch merging and M-RoPE over height, width and time in Qwen2-VL, then in Qwen3-VL interleaving RoPE frequencies so every axis sees both low and high frequencies, explicit video timestamp tokens rather than implicit positional time, a square-root per-token loss normalization so long video examples do not dominate, and DeepStack, which injects vision embeddings directly into the language model’s residual stream instead of treating the encoder as a black box. Context reaches 256K, trained in stages of 8K, 32K and 256K.
- Vision encoders stay under about a billion parameters while the language model can be 72 billion, because patch encoding is a local operation with little reasoning or knowledge in it; the capability lives in the language model.
- Chameleon takes the opposite approach and discretizes images into tokens via a VQ-VAE, turning a 512x512 image into 1,024 tokens from an 8,000-entry codebook, so that text and images are generated by one ordinary language model with no adapter and interleaved output. It is elegant but was unstable, because image tokens have much higher entropy than text tokens and parameter norms grow; QK-norm and z-loss mitigated it. The approach lost ground because discretization destroys fine detail needed for OCR and diffusion became the better generation path. The lecturer’s speculation about frontier omni models is continuous encoders for understanding plus diffusion for generation.
Extracted Notes
- None yet.