CLIP
CLIP (Contrastive Language-Image Pre-training) is a neural network model developed by OpenAI that learns a shared Embedding space for images and text by training on approximately 400 million image-caption pairs scraped from the internet. The model consists of two encoders—one for images (typically a Vision Transformer or ResNet) and one for text—trained with a contrastive objective: representations of a matching image-text pair are pulled together, while mismatched pairs are pushed apart. The result is a model that can score how well any arbitrary text describes any image, without task-specific fine-tuning.
Think of it like a universal translator that converts both photographs and sentences into the same "meaning coordinates," so you can ask which of 1,000 photos best matches a sentence about a dog on a beach and get a ranked answer instantly.
CLIP enables zero-shot image classification by comparing an image embedding against a set of label embeddings such as "a photo of a cat" or "a photo of a dog" and returning the highest-scoring label. It also serves as the guidance signal in text-to-image models: Diffusion models like Stable Diffusion use CLIP text embeddings to steer generation toward the prompt.
import clip, torch
model, preprocess = clip.load("ViT-B/32")
image = preprocess(Image.open("cat.jpg")).unsqueeze(0)
text = clip.tokenize(["a cat", "a dog"])
with torch.no_grad():
logits, _ = model(image, text)
print(logits.softmax(dim=-1)) # probability per label
CLIP relates closely to Multimodal modeling, Embedding spaces, Zero-Shot learning, Latent Space geometry, and Diffusion-based image generation. Its contrastive training objective influenced later models such as ALIGN and SigLIP. Foundation Models for vision-language tasks frequently use CLIP or a derivative as a backbone component.
CLIP appears in image-search systems, Multimodal LLM pipelines, text-to-image generation stacks, and content moderation tools that need to match visual content against textual policy descriptions.