CLIP
CLIP is a multimodal model and pretraining method that aligns image and text representations in a shared embedding space.
Build a Text-to-Image Generator (from Scratch)
Contrastive language-image pretraining is a training technique that aligns image and text representations by contrasting matching and nonmatching pairs.
- How it is used
- Measures image–text similarity for image retrieval and as a judge or guide for text-to-image generation.
- How deep it goes
- Builds encoders, projections, a batch similarity matrix, and a symmetric training objective, then implements retrieval.
- Examples
- Uses Flickr 8k classroom and beach prompts for retrieval, then compares top-five matches from pretrained CLIP.
- What you can do after
- Build it from scratch to align image–caption pairs and retrieve images, or apply pretrained OpenAI CLIP for prompt-based search.
Read how Build a Text-to-Image Generator (from Scratch) explains CLIP →
Learn Generative AI with PyTorch
A multimodal Transformer model that learns aligned image and text representations for comparing and matching visual and textual inputs.
- How it is used
- Connects visual and textual inputs for multimodal understanding, image classification, and text-to-image generation.
- How deep it goes
- Explains dual encoders, preprocessing, embeddings, and batch contrastive learning, then connects CLIP to DALL-E 2 generation.
- Examples
- Uses paired image–description batches, a training-similarity diagram, and DALL-E 2 prompts such as an astronaut riding a unicorn.
- What you can do after
- Apply it via DALL-E 2 to understand prompt conditioning and generate images from textual descriptions.
AI-Powered Search
CLIP is a multimodal model trained to align images and their associated text in a shared embedding space.
- How it is used
- Enables multimodal search pipelines that retrieve images from text, images, or combined queries.
- How deep it goes
- Explains joint training, shared embeddings, normalization, indexing, encoding, and vector queries without detailing Transformer internals.
- Examples
- Uses movie posters, “singing in the rain,” superhero queries, and a DeLorean image for text, visual, and hybrid retrieval.
- What you can do after
- Apply it via Python and a vector-search engine to build normalized image indexes and multimodal retrieval functions.
Hugging Face in Action
CLIP is a multimodal model trained to align images and text in a shared representation space.
- How it is used
- Classifies images using natural-language labels and relates visual content to textual descriptions.
- How deep it goes
- Explains training alignment, encoder roles, and inference code without deriving the underlying neural-network mechanics.
- Examples
- Uses a dog image with cat, dog, tiger, and train labels, producing dog as the most likely object.
- What you can do after
- Apply CLIP through Hugging Face Transformers to classify an image with user-provided text labels.
Related concepts
- multimodalkind of · A multimodal model is a model that processes, generates, or relates information represented in two or more data modalities, such as text, images, audio, or video.
- encoderhas part · An encoder is a component that transforms input data into an encoded representation for subsequent processing, reconstruction, comparison, or transmission.
- contrastive learninguses · Contrastive learning is a representation-learning technique that trains a model to bring representations of related examples closer and separate representations of unrelated examples.
- latent diffusion modelpart of · A latent diffusion model is a generative model that performs iterative denoising in a learned latent space to synthesize data such as images.
- text encoderhas part · A text encoder is a neural-network model that transforms textual input into numerical representations for conditioning or other downstream computation.
- embeddingproduces · A numerical vector representation of an item or input that encodes features or relationships useful for computational tasks.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



