CLIP (Contrastive Language-Image Pre-training) is a dual-encoder architecture that simultaneously trains an image encoder and a text encoder to map corresponding image-caption pairs to nearby vectors in a shared embedding space. Unlike traditional classifiers restricted to a fixed set of labels, CLIP learns directly from raw, noisy (image, text) pairs scraped from the internet, using a contrastive loss to maximize the cosine similarity between correct pairings while minimizing it for incorrect ones within the batch.
Glossary
CLIP

What is CLIP?
A neural network model trained on a massive dataset of image-text pairs to learn a joint embedding space where matched visual and textual concepts exhibit high cosine similarity.
This zero-shot capability allows CLIP to perform classification and retrieval on entirely new concepts without fine-tuning, simply by comparing an image embedding to text embeddings of candidate labels. The architecture typically pairs a Vision Transformer or ResNet with a standard text Transformer, processing modalities independently before projecting outputs into a normalized joint embedding space where semantic alignment is measured via dot-product similarity.
Key Features of CLIP
Contrastive Language-Image Pre-training (CLIP) learns a joint embedding space where matched image-text pairs have high cosine similarity, enabling zero-shot transfer to diverse visual classification tasks.
Dual-Encoder Architecture
CLIP uses a Bi-Encoder design with two separate towers: a Vision Transformer (ViT) or ResNet for images and a Transformer for text. Each encoder independently maps its input to a fixed-dimensional embedding vector. The two encoders do not share weights, allowing the text tower to pre-compute class embeddings offline for rapid zero-shot inference. This Two-Tower Model design enables efficient dot-product scoring between image and text representations.
Contrastive Pre-Training Objective
CLIP is trained with a symmetric InfoNCE loss over a massive batch of N image-text pairs. The objective maximizes the cosine similarity of the N correct pairs while minimizing similarity for the N² - N incorrect pairs:
- Image-to-Text: Each image must select its correct caption from the batch
- Text-to-Image: Each caption must select its correct image
- In-Batch Negatives: All other pairings within the batch serve as negative samples, creating an efficient training signal without explicit negative mining
Web-Scale Training Data (WIT)
CLIP was trained on 400 million image-text pairs collected from publicly available internet sources, known as the WebImageText (WIT) dataset. This dataset spans a vast diversity of visual concepts and natural language descriptions. Key characteristics:
- No human annotation or labeling required
- Covers everyday objects, scenes, text, logos, and abstract concepts
- The scale and diversity enable strong zero-shot generalization without task-specific fine-tuning
Zero-Shot Transfer Learning
CLIP can classify images into arbitrary categories without any task-specific training data. The process:
- Text Prompt Engineering: Convert class labels into natural language prompts (e.g., 'a photo of a {class}')
- Embed Class Prompts: Encode all text prompts through the text encoder
- Match: Compute cosine similarity between the image embedding and all text embeddings
- Predict: Select the class with highest similarity This enables CLIP to generalize to novel visual concepts it never explicitly saw during training.
Robustness to Distribution Shift
Unlike supervised models trained on fixed datasets like ImageNet, CLIP demonstrates remarkable robustness to natural distribution shifts. It achieves competitive accuracy on challenging benchmarks including:
- ObjectNet: Real-world images with unusual viewpoints and backgrounds
- ImageNet-R: Renditions, art, and cartoons of ImageNet classes
- ImageNet-Sketch: Black-and-white sketches
- ImageNet-A: Naturally adversarial examples that fool standard classifiers This robustness stems from learning from diverse, natural language supervision rather than memorizing dataset-specific features.
Multimodal Embedding Space
CLIP projects both images and text into a shared L2-normalized embedding space where semantic similarity is measured by cosine similarity. Properties of this joint space:
- Semantic Alignment: A photo of a dog is closer to the text 'a dog' than to 'a cat'
- Compositional Understanding: CLIP can bind attributes to objects (e.g., 'red cube' vs 'blue sphere')
- Cross-Modal Retrieval: Enables text-to-image and image-to-text search
- Linear Probe Quality: The learned representations transfer well to downstream tasks with simple linear classifiers
Frequently Asked Questions
Clear, technical answers to the most common questions about Contrastive Language-Image Pre-training, its architecture, and its impact on multimodal AI.
CLIP (Contrastive Language-Image Pre-training) is a neural network model developed by OpenAI that learns a joint embedding space for images and text by training on 400 million image-text pairs collected from the internet. Unlike traditional classifiers that predict fixed category labels, CLIP uses a Bi-Encoder architecture consisting of an image encoder (a Vision Transformer or ResNet) and a text encoder (a transformer). During training, the model maximizes the cosine similarity between the vector representations of matched image-text pairs while minimizing it for mismatched pairs within the same batch, using in-batch negatives. This contrastive objective forces the model to learn a semantic alignment between visual concepts and their natural language descriptions, enabling zero-shot transfer to arbitrary classification tasks without task-specific fine-tuning.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core architectural components, loss functions, and training techniques that underpin CLIP's ability to learn a joint vision-language embedding space.
Bi-Encoder Architecture
CLIP uses a dual-tower model with separate image and text encoders that process inputs independently. Each encoder produces a dense vector, and similarity is computed via cosine similarity across the batch. This design enables offline pre-computation of image or text embeddings for efficient retrieval at scale.
InfoNCE Loss
CLIP is trained with Information Noise-Contrastive Estimation, a symmetric cross-entropy objective that maximizes the cosine similarity of N correct image-text pairs while minimizing it for N² − N incorrect pairs. The temperature parameter controls the sharpness of the softmax distribution, penalizing hard negatives more aggressively.
In-Batch Negatives
CLIP treats all other text descriptions within a training batch as negative samples for a given image, and vice versa. This technique eliminates the need for explicit negative mining and scales naturally with batch size—CLIP was trained with a batch size of 32,768, creating a rich set of contrastive signals per step.
Cosine Similarity Scoring
After encoding, both image and text embeddings are L2-normalized to unit length. The dot product between normalized vectors equals cosine similarity, measuring only the angle between representations. This ensures the model focuses on directional semantic alignment rather than vector magnitude.
Zero-Shot Transfer
CLIP's joint embedding space enables zero-shot classification without fine-tuning. By encoding class labels as natural language prompts (e.g., 'a photo of a {class}') and computing similarity with an image, CLIP can classify objects it was never explicitly trained to recognize, achieving competitive results on unseen datasets.
Contrastive Pre-Training Dataset
CLIP was trained on 400 million noisy image-text pairs scraped from the public internet, far exceeding curated datasets like ImageNet. This web-scale supervision, combined with the contrastive objective, teaches the model to recognize a vast array of visual concepts described in natural language rather than fixed class labels.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us