CLIP
A dual-encoder multimodal model that learns to align text and images in one shared embedding space.
Contrastive Language-Image Pre-training (CLIP) learns to place captions and images near each other in the same vector space, which is why later image systems often reuse it to understand prompts instead of asking it to generate pixels directly.
At a glance
- Family
- clip
- Source type
- Research
- Released
- January 2021
- Authors
- Alec Radford, Jong Wook Kim, Chris Hallacy, et al.
- Modalities
- Text, Image, Multimodal
- Parameter count
- 400 million parameters
What It Is
Contrastive Language-Image Pre-training (CLIP) is a multimodal model from OpenAI that learns from paired text and images. Instead of producing a paragraph or painting a picture, it learns representations: a text encoder turns a caption into a vector, an image encoder turns an image into a vector, and the model is trained so matching pairs land close together.Inputs And Outputs
CLIP takes either text, images, or both. Its immediate outputs are embeddings and similarity scores rather than generated pixels. In practice, people use those outputs to rank images against text, retrieve matching examples, classify images with text labels, or supply conditioning signals to another model such as a diffusion pipeline.Architecture
The core pattern is a dual encoder. One tower reads tokenized text, and the other reads image patches. Each tower maps its input into the same shared embedding space, then a similarity step compares the two vectors. During training, matched caption-image pairs are pulled closer together and mismatched pairs are pushed farther apart, so the shared space becomes useful for cross-modal comparison.Similarity
ScoresShared
Embedding
SpaceText
ProjectionImage
ProjectionText
EncoderImage
EncoderText
TokensImage
PatchesShared
Embedding
Space to Similarity
ScoresText
Projection to Shared
Embedding
SpaceImage
Projection to Shared
Embedding
SpaceText
Encoder to Text
ProjectionImage
Encoder to Image
ProjectionText
Tokens to Text
EncoderImage
Patches to Image
Encoder