Multimodal Systems
How AI systems perceive the world through multiple senses simultaneously. From CLIP's unified embedding space to GPT-4V's visual reasoning to Gemini's native multimodality—learn how modern systems bridge text, images, audio, and video.
Learning Objectives
- Understand what multimodal learning means and why it matters
- Explain contrastive learning and CLIP's shared embedding space
- Distinguish different multimodal architectures: fusion strategies and their trade-offs
- Understand how vision-language models like GPT-4V and LLaVA process images
- Explore the frontier: video understanding, audio integration, and native multimodality
- Recognize challenges: hallucination, grounding, and cross-modal alignment
The Multimodal Paradigm
Systems that can process, understand, and generate information across multiple modalities (text, images, audio, video) within a unified framework, enabling cross-modal reasoning and generation.
Humans understand the world through multiple senses simultaneously. When you read "the dog barked," you can imagine how a dog looks and sounds. Multimodal AI aims to develop this same cross-modal understanding: a system that can describe images, answer questions about videos, generate images from text, and reason across modalities.
The core challenge: different modalities have fundamentally different structures. Text is discrete tokens in sequence. Images are 2D grids of pixels. Audio is 1D waveforms. Video adds temporal dynamics. Multimodal systems must:
- Encode each modality into a representation
- Align representations so cross-modal relationships emerge
- Fuse information across modalities for unified reasoning
- Decode back to any target modality
Vision-Language Models: GPT-4V, Gemini, Claude 3, LLaVA—understand images and respond in text.
Text-to-Image: DALL-E, Stable Diffusion, Midjourney—generate images from text descriptions.
Any-to-Any: Emerging systems (Gemini 1.5, GPT-4o) can handle multiple input modalities and generate in multiple output modalities.
CLIP: The Foundation of Modern Multimodality
A model that learns a shared embedding space for images and text through contrastive learning on 400M image-text pairs from the internet. Any image and any text can be embedded and compared in the same vector space.
Image Encoder
ViT or ResNet
v ∈ ℝᵈ
Text Encoder
Transformer
t ∈ ℝᵈ
Contrastive Learning Objective
Given a batch of N (image, text) pairs, CLIP learns to predict which image goes with which text. The training creates N correct pairs and N²-N incorrect pairs within each batch.
The temperature τ controls how "peaked" the distribution is. After training, semantically related images and texts cluster together in embedding space.
Why CLIP Changed Everything
- Zero-shot classification: Describe any class in text, find matching images
- Open vocabulary: Not limited to pre-defined categories
- Transfer learning: CLIP embeddings work for downstream tasks
- Image generation: CLIP guides diffusion models via text embeddings
Image Search
Search images with natural language queries. Embed query, find nearest image embeddings.
Zero-Shot Classification
"A photo of a [cat/dog/bird]"—compare image to each text embedding, pick highest.
CLIP + Diffusion
Text encoder for Stable Diffusion. Guide image generation toward text description.
Content Moderation
Embed policy descriptions, flag images that embed close to prohibited content.
Vision-Language Models: Images as First-Class Input
While CLIP aligns image and text embeddings, Vision-Language Models (VLMs) go further: they process images directly within a language model, enabling visual reasoning, description, and question-answering.
Approach 1: Adapter-Based (LLaVA, MiniGPT-4)
Project visual features into the LLM's embedding space. The LLM treats visual tokens like text tokens. Often keeps LLM frozen, training only the projection.
Approach 2: Native Multimodal (Gemini, GPT-4V)
Train a single model from scratch on interleaved multimodal data. Images and text are processed by the same transformer with shared attention.
Approach 3: Q-Former (BLIP-2)
Use learnable "queries" that attend to image features and produce a fixed number of tokens. Bridges frozen vision encoder to frozen LLM efficiently.
Visual Tokenization Strategies
How do you convert a continuous image into discrete tokens for a transformer?
Text-to-Image: Generating Visual Content
The reverse direction: given text, generate images. Modern text-to-image combines text encoders (CLIP or T5), diffusion models, and conditioning mechanisms.
Text Encoding
CLIP text encoder maps prompt to embeddings
Latent Diffusion
U-Net denoises in latent space, guided by text
VAE Decode
Decode latent to pixel space
How Text Guides Generation
Text conditioning happens through cross-attention in the U-Net. At each attention layer:
DALL-E 3's Innovation: Caption Improvement
DALL-E 3 doesn't just use user prompts directly—it rewrites them with an LLM to be more detailed and unambiguous. "A cat" becomes "A fluffy orange tabby cat sitting alertly on a weathered wooden surface, soft natural lighting, photorealistic style." This dramatically improves prompt following.
Beyond Image-Text: Video, Audio, and More
Video Understanding
Challenge: Videos add temporal dimension. A 10s video at 30fps = 300 frames. Can't process each frame independently.
Approaches:
- Sample key frames + image understanding
- 3D convolutions (like 2D conv but across time)
- Temporal attention: attend across frames
- Token compression: represent video as fewer tokens
Systems: GPT-4V (limited), Gemini 1.5 (1M token context), Video-LLaVA, Sora (generation)
Audio Integration
Challenge: Audio is high-dimensional (44kHz = 44,000 samples/sec). Speech, music, environmental sounds all differ.
Approaches:
- Mel spectrograms → treat as images
- Audio tokenizers (EnCodec, SoundStream)
- Whisper embeddings for speech
Systems: GPT-4o (native audio), Gemini (audio input), AudioPaLM, MusicGen
Native Multimodality
Goal: One model that naturally handles any combination of input/output modalities.
Architecture:
- Unified tokenization across modalities
- Single transformer processes interleaved sequences
- Modality-specific heads for generation
Systems: Gemini, GPT-4o, Chameleon (Meta). These represent the frontier—truly unified perception.
Multimodal Fusion Strategies
How and when do you combine information from different modalities? This architectural choice significantly impacts what the model can learn.
Early Fusion
Combine at input level. Full cross-modal attention from the start.
Late Fusion
Process modalities separately, combine at the end.
Cross-Attention Fusion
Dedicated cross-attention layers for modality interaction.
Challenges in Multimodal AI
Hallucination
VLMs can "see" things that aren't there. When asked about an image, they may invent objects, attributes, or relationships based on statistical priors rather than visual evidence. "How many dogs are in the image?" might get "3" when there are 2—because 3 is common in training data.
Grounding
Does the model truly understand which parts of an image correspond to which words? Or is it pattern matching? Grounding tests require localization: "Where is the red ball?" should point to specific pixels.
Modality Imbalance
Text data is vastly more abundant and structured than image/video data. Models may rely too heavily on text priors, ignoring visual information when it conflicts with textual expectations.
Compositionality
"A red cube on a blue sphere" vs "a blue cube on a red sphere"—models struggle with binding attributes to objects and spatial relationships. Text-to-image often fails on precise compositions.
Efficiency
Images are expensive: one 224×224 image → 196 tokens. Videos explode: 10 seconds → thousands of tokens. Long-context multimodal is a major computational challenge.
Evaluation
How do you measure multimodal understanding? Benchmarks are limited. Models can game specific tests without true understanding. Human eval is expensive and subjective.
Common Misconceptions
"Multimodal models 'see' images like humans do"
VLMs process images as collections of patch embeddings. They don't have biological vision—no eye movements, no depth perception, no real-time continuous processing. Their "understanding" is statistical correlation.
The accurate framing: Multimodal models learn statistical associations between visual patterns and language. They can be remarkably capable, but their perception differs fundamentally from human vision.
"CLIP understands the meaning of images"
CLIP learns to match images and text that co-occur on the internet. It captures visual-linguistic correlations, not semantic understanding. It can be fooled by adversarial examples or distribution shifts.
The accurate framing: CLIP learns a powerful cross-modal embedding space that captures internet-scale correlations. This is useful but not equivalent to understanding. Always probe for failure modes.
"More modalities always means better understanding"
Adding modalities introduces training complexity, potential for modality conflict, and computational overhead. Poorly integrated modalities can degrade performance on individual tasks.
The accurate framing: Multimodality is valuable when modalities provide complementary information and are well-integrated. The architecture and training matter more than simply "more inputs."
Interactive Lab: Multimodal Embedding Space
Explore how CLIP-style models create a shared embedding space where images and text can be compared. See how semantic similarity works across modalities.
Key Observations
- Cross-modal alignment: "Dog" text embeds near dog image
- Semantic clusters: Animals cluster together, vehicles cluster together
- Similarity scores: Cosine similarity measures alignment
- Zero-shot: This enables classifying images with text descriptions
Check Your Understanding
What is CLIP's training objective?
How do adapter-based VLMs like LLaVA inject visual information?
What is a major challenge with VLMs (Vision-Language Models)?
In text-to-image models like Stable Diffusion, how does text guide the generation?
What distinguishes "native multimodal" models like Gemini from adapter-based approaches?