TL;DR
While modern vision-language models (VLMs) claim to understand the composition of scenes, a closer look reveals they suffer from severe element-specific biases—often improving object recognition at the expense of understanding relations and attributes. To fix this, CS-CLIP uses scene graphs, masked language models, and natural language inference to generate balanced, highly targeted "hard negative" captions. This approach achieves state-of-the-art compositional reasoning with uniform accuracy across all element types while using a fraction of the training data required by prior methods.
What Problem Does This Paper Address?
Contrastive vision-language models like CLIP are notoriously prone to "bag-of-words" behavior: they excel at spotting individual objects in an image but frequently scramble the relationships, attributes, or ordering of those objects (e.g., confusing "man riding a horse" with "horse riding a man").
To combat this, recent "compositionality-aware" VLMs train on fine-grained "hard negatives"—distractor captions where words are swapped or altered. However, the authors of this paper discover a hidden flaw in these models: element-specific bias. Through rigorous controlled testing, they show that existing models provide uneven supervision. A model might get better at distinguishing objects but actually underperform vanilla CLIP when evaluating attributes or relations.
Methods
The authors introduce CS-CLIP (Compositional Scene Graph-guided CLIP), a framework that automates the generation of precise, balanced hard negatives using a three-step pipeline:
- Scene Graph Parsing: An off-the-shelf parser converts a caption into a structured scene graph, mapping out exactly which words represent objects, attributes, or relations. This allows the system to target specific text spans with surgical precision.
- Candidate Generation via Masked Language Modeling (MLM): To avoid ungrammatical sentences that a model could easily dismiss, CS-CLIP masks a targeted span and uses BERT to generate fluent alternative words belonging to the same grammatical category.
- Semantic Ranking via Natural Language Inference (NLI): Synonyms generated by the MLM are weeded out using a pre-trained NLI model. The system calculates a "contradiction score" to ensure the new caption strictly contradicts the original image description rather than just paraphrasing it.
During training, these hard negatives are fed into a combined objective function consisting of the standard InfoNCE loss (for global image-text alignment) and a Hinge loss (which explicitly forces the model to score the true caption higher than the generated hard negative by a set margin).
Datasets
- Training: Hard negatives were generated entirely from the MSCOCO training set, yielding roughly 2 million training instances.
- Compositional Evaluation: Evaluated on SugarCrepe (7 reasoning subtypes), VG-Relation, and VG-Attribute (subsets of the Attribution-Relation-Order benchmark).
- Generalization Evaluation: Standard image-text retrieval was tested on the COCO 5K split, and downstream visual reasoning was evaluated via a zero-shot retrieval task constructed from the GQA validation split.
Key Insights and Ideas
- Uneven Supervision Hurts Robustness: Previous methods generated hard negatives indiscriminately. If a model sees 90% object-altered negatives and only 10% relation-altered negatives during training, it develops a blind spot for relations.
- Placement Over Vocabulary: Through ablation studies, the authors found that where you place a text perturbation matters more than what word you use. Randomly swapping words introduces linguistic artifacts, whereas scene-graph-guided placement forces the model to learn genuine visual grounding.
- Synonyms are Landmines: Without the NLI filtering step, hard negative generation pipelines frequently create valid alternative descriptions (e.g., replacing "tiny" with "small"). Training a model to reject these valid descriptions degrades its performance.
Key Results
CS-CLIP achieves a new state-of-the-art on the SugarCrepe benchmark with an average accuracy of 88.6%. Crucially, it achieves the lowest type-wise standard deviation (5.6), proving that its reasoning capabilities are uniform across objects, attributes, and relations rather than skewed.
Furthermore, CS-CLIP demonstrates incredible sample efficiency. As shown in the scaling analysis, it matches or outperforms competing models while utilizing up to 100x fewer hard negative training samples, proving that data quality and targeted structure trump sheer data volume.
Limitations and Future Work
The primary limitation of CS-CLIP is its reliance on a cascade of frozen, off-the-shelf NLP models (Scene Graph Parsers, MLMs, and NLI models). Any systematic linguistic biases or errors present in those upstream models will inevitably propagate into the generated training data.
Additionally, the hard negative generation pipeline relies entirely on text processing without looking at the corresponding image features. The authors note that incorporating visual features directly into the negative mining process could further refine and improve candidate generation in future iterations.
Summary updated