Sub topic 15
Limitations, Biases, and Failure Modes of CLIP
Assume you know embeddings, cosine similarity, softmax, and the difference between zero-shot classification and a trained classifier. This chapter focuses on when CLIP’s shared image-text space gives misleading results and how to test those failures.
Web-scale data creates inherited bias
CLIP learns from image-text pairs collected from the web. These pairs are broad and cheap to collect, but their captions are noisy, incomplete, and shaped by human behavior. They also reflect unequal representation of languages, cultures, occupations, genders, and locations.
A prompt can therefore activate a social association present in the training data rather than a property visible in the image. For example, a classification prompt about an occupation may produce different results across demographic groups even when the relevant visual evidence is similar. CLIP does not understand fairness automatically because its objective rewards matching common image-text relationships.
These problems are difficult to fix by changing only the final prompt. The association may be encoded throughout the model.
Visual and language reasoning limits
CLIP is strong at broad semantic matching, but similarity is not the same as complete visual understanding.
Common failure cases include:
- Counting several objects correctly.
- Reading small or distorted text.
- Recognizing fine-grained differences between similar species, products, or machine parts.
- Understanding spatial relations such as “the cup is left of the plate.”
- Distinguishing negation, such as “a dog without a leash.”
- Handling unusual viewpoints, image corruption, or rare concepts.
- Separating a pictured object from a nearby caption, logo, or watermark.
A high similarity score means that the image and text are compatible in the learned space. It does not prove that every detail in the text is true.
Prompt sensitivity and calibration
Zero-shot classification depends on text prompts. “A photo of a dog” and “This is a dog” can produce different scores because the text encoder represents the complete prompt, not just the class name.
The scores are also relative to the candidate labels. Adding or removing a class can change the softmax probabilities. A probability of 0.9 does not necessarily mean 90 percent correctness, especially when the image comes from a different distribution than the training data.
| Problem | Why it happens | Useful check |
|---|---|---|
| Prompt changes the prediction | Text templates create different embeddings | Compare several templates |
| Overconfident wrong result | Softmax ranks candidates but is not automatically calibrated | Measure accuracy and calibration on held-out data |
| Poor rare-class results | The concept may be underrepresented in training data | Test per-class performance and sample counts |
| Shortcut prediction | Background or style correlates with the label | Use counterfactual crops or changed backgrounds |
Distribution shift and evaluation
Performance can fall when deployment images differ from web images. Examples include infrared cameras, factory sensors, local medical images, low-light video, or specialized technical diagrams. Test data should resemble the intended deployment data.
Use more than one evaluation protocol:
- Zero-shot accuracy tests the original prompt-based behavior.
- A linear probe freezes the CLIP embedding and trains a small classifier on labeled examples. It measures whether the representation contains useful task information.
- Per-group and per-condition metrics reveal uneven performance hidden by one overall score.
- Prompt ensembles can reduce sensitivity to one wording, but they do not remove dataset bias.
Successors do not remove the basic risks
OpenCLIP expands training data and model choices. ALIGN uses large-scale noisy image-text data with a related dual-encoder idea. SigLIP changes the contrastive objective by using a pairwise sigmoid loss rather than the same softmax normalization. These changes can improve accuracy or scaling, but they still depend on data quality, evaluation design, and deployment conditions.
Exercise
Why can a CLIP prediction change when an unrelated candidate label is added to the label list?
Show answer
Classification compares all candidate text embeddings together. Adding a label changes the competition and the softmax normalization, even if the image has not changed.