Multimodal models extend a language model to consume (and sometimes produce) images, audio, or video by mapping each modality into the same embedding space the LLM already operates in.
Vision Transformer (ViT): split an image into fixed-size patches, linearly project each patch into a vector, prepend a CLS token, add position embeddings, and run a standard transformer encoder — treating patches exactly like tokens.
LLaVA bridges a frozen vision encoder to an LLM with a single learned projection ( for the LLM, 1024 for CLIP):
- image → patchify
- patches → linear projection (applied per patch)
- patch embeddings → prepend CLS, add position embeddings
- sequence → CLIP encoder (24 layers)
- CLIP output → projection (per token)
- visual embeddings → concatenate with text embeddings
- full sequence → LLM transformer

Handling arbitrary resolution:
- LLaVA-NeXT — split a high-res image into multiple crops, encode each, concatenate
- Qwen2-VL — replace learned absolute position embeddings (which fixed the image size) with 2D-RoPE, encoding position as (row, column) coordinates generated on the fly → generalizes to any resolution and aspect ratio
CLIP is trained with contrastive learning: maximize the similarity of text/image embeddings for correct pairings and minimize it for mismatches. This shared space is what lets a projection align vision features with language.
Current paradigm: understanding uses a ViT encoder → features; generation uses diffusion operating in pixel space.
See also: Self-Attention, Positional Encoding, Embeddings, Transformers and LLMs