CLIP Under the Microscope: A Fine-Grained Analysis of Multi-Object Representation
Abstract
Contrastive Language-Image Pre-training (CLIP) has become a cornerstone of modern vision-language models. However, its ability to represent complex scenes with multiple objects remains poorly understood. This paper investigates structural biases in CLIP, revealing that the image encoder disproportionately favors larger objects while the text encoder prioritizes the first object mentioned in a caption. By introducing the ComCO dataset and analyzing the LAION-5B training data, we demonstrate that these biases are learned from human-generated captions where prominent objects are typically mentioned first. Our findings highlight a significant gap in CLIP's compositional understanding and suggest a need for more balanced training strategies.
Introduction
CLIP is widely used as a foundational model for various downstream tasks, from zero-shot classification to guiding generative models like Stable Diffusion. Despite its success, it often exhibits "bag-of-words" behavior, failing to capture the nuances of multi-object scenes. This research moves beyond conceptual misunderstandings (e.g., attribute binding) to examine how CLIP handles semantically equivalent but structurally different inputs, such as reordered object lists or varied object sizes.
Methodology
The study employs a dual retrieval framework to isolate and quantify the behavior of CLIP’s encoders:
- Text-Based Object Retrieval (TOR): Measures the cosine similarity between a multi-object caption embedding and individual object name embeddings to determine which part of the sentence the text encoder prioritizes.
- Image-Based Object Retrieval (IOR): Compares a multi-object image embedding to single-object image embeddings to identify which visual elements dominate the model's representation.
To facilitate controlled experiments, the authors introduced ComCO (Complex COCO Objects), a synthetic dataset created in Blender. ComCO allows for "surgical" control over object size, position, and quantity, providing a more rigorous benchmark than standard datasets like COCO for studying compositional biases.
Analysis of Structural Biases
The investigation revealed two primary, interconnected biases:
- First-Mention Dominance: In the text encoder, the first object mentioned exerts a massive influence on the final embedding. Retrieval accuracy for the first object is consistently high, while it plummets for objects mentioned later in the sequence.
- Size Bias: In the Vision Transformer (ViT) image encoder, larger objects occupy more patches. Since the final representation (the CLS token) aggregates information from all patches, larger objects naturally "drown out" smaller ones.
Crucially, these biases are linked through cross-modal contamination. Because CLIP aligns text and images via contrastive learning, the image encoder's size bias "leaks" into the text encoder. This is reinforced by training data like LAION-5B, where humans naturally list the most visually prominent (usually the largest) objects first. CLIP learns this correlation, internalizing the heuristic that "First in Text = Biggest in Image."
Key Results
Experimental results on the ComCO benchmark quantify these effects:
- Retrieval Disparity: In TOR tasks, retrieval accuracy for the first object reached 71.13% (for CLIP Datacomp), while accuracy for the fourth object dropped to 3.87%. In IOR, large objects achieved an average retrieval accuracy of ~85%, compared to only ~2-6% for small objects in the same scene.
- Performance Sensitivity: Reordering a caption so the largest object is mentioned last instead of first can cause a performance drop of up to 47% in image-text matching tasks.
- Generative Consequences: These biases extend to generative models; the order of objects in a prompt directly affects which object appears more prominently or with more detail in the generated output.
Conclusion
This work identifies fundamental structural biases in CLIP that hinder its ability to represent complex, multi-object scenes accurately. The learned association between mention order and object size creates a bottleneck for fine-grained understanding. Future research should focus on balanced training strategies—such as caption reordering augmentations—and architectural improvements to ensure equitable representation of all objects in a scene, regardless of their physical size or linguistic position.
Summary updated