Quantifying Interpretability in CLIP Models with Concept Consistency

Avinash Madasu, Vasudev Lal, Phillip Howard

TL;DR

This paper introduces the Concept Consistency Score (CCS), a novel metric to quantify how well individual attention heads in CLIP models align with specific visual concepts. They demonstrate that heads with high CCS are crucial for maintaining model performance, especially in challenging tasks like out-of-domain detection and video retrieval, making CCS a valuable tool for understanding these powerful vision-language models.

What Problem Does This Paper Address?

Vision-language models like CLIP have become incredibly powerful, enabling a wide range of applications from image generation to video analysis. However, their internal workings remain largely a "black box." Understanding why these models make certain predictions is crucial, especially in high-stakes applications. While previous work has tried to decompose CLIP's representations, a systematic way to identify and quantify the specific concepts learned by individual components (like attention heads) has been missing. This paper aims to fill that gap by providing a metric to measure the conceptual coherence of attention heads.

Methods

The core of this work is the Concept Consistency Score (CCS). The process involves several steps:

  1. Extracting Text Representations (TEXTSPANs): For each attention head in a CLIP model, they use the TEXTSPAN algorithm to generate a set of five descriptive text snippets that best capture the head's behavior.
  2. Assigning Concept Labels: They leverage ChatGPT with in-context learning. By providing a few examples of text spans and their corresponding concept labels, ChatGPT is prompted to assign a dominant concept label to the TEXTSPANs generated for each attention head.
  3. Evaluating Concept Consistency: A state-of-the-art vision-language model (GPT-4o) acts as an "LLM-as-a-judge." For each attention head, GPT-4o evaluates whether its TEXTSPANs align with the assigned concept label. The CCS for a head is the sum of these binary judgments (1 if aligned, 0 if not).
  4. Pruning Experiments: To validate CCS, they perform "soft-pruning" by zeroing out the weights of attention heads. They compare the performance drop when pruning:
  5. Heads with high CCS.
  6. Heads with low CCS.
  7. Randomly selected heads.

Datasets

The paper uses several standard datasets for evaluation:

  • Image Classification: CIFAR-10, CIFAR-100, Food-101, Country-211, Oxford-pets.
  • Out-of-Domain Classification: ImageNet-A, ImageNet-R.
  • Video Retrieval: MSRVTT, MSVD, DiDeMo.

The models evaluated are pre-trained on datasets like OpenAI-400M and LAION2B.

Key Insights and Ideas

  • Attention Heads Encode Specific Concepts: The research strongly suggests that individual attention heads within CLIP models are not just generic feature extractors but often learn to represent specific, coherent visual concepts (e.g., "animals," "locations," "shapes").
  • High CCS Heads are "Critical": Heads with high CCS are demonstrably more important for model performance than low-CCS or random heads. Pruning them leads to significantly larger performance drops.
  • CCS Reflects Model Architecture and Training: The study shows that CCS can reveal differences in how models of varying sizes and trained on different datasets organize conceptual knowledge. Larger models or those trained on more diverse data tend to have higher CCS scores, suggesting better conceptual alignment.
  • LLMs as Scalable Evaluators: The paper validates the use of LLMs (ChatGPT and GPT-4o) for assigning concept labels and evaluating consistency, demonstrating strong agreement with human judgments. This offers a scalable alternative to manual annotation.

Key Results

  • Pruning Impact: Pruning high-CCS heads consistently caused significant drops in zero-shot performance across various classification and retrieval tasks. For example, on Country-211 (location dataset), pruning location heads reduced accuracy from 22.81% to 14.09%.
  • Model Differences: ViT-B-16 models were more sensitive to high-CCS head pruning than larger ViT-L-14 models, indicating that smaller models might rely on a more specialized set of heads.
  • Task Specificity: High-CCS heads are particularly crucial for concept-specific tasks, out-of-domain detection, and video retrieval, highlighting their role in robust and generalized understanding.
  • CCS@K Distribution: Models trained on larger datasets (like OpenCLIP-LAION2B) showed a higher proportion of heads with CCS@5, indicating stronger concept alignment. For instance, ViT-L-14 on LAION2B had the highest CCS@5 score of 0.328.

Limitations and Future Work

  • LLM Reliance: While validated, the reliance on LLMs for labeling and evaluation introduces a dependency on the LLM's capabilities and potential biases.
  • Concept Granularity: The current method assigns a single dominant concept. Future work could explore finer-grained concept decomposition or hierarchical concept structures.
  • Beyond Soft-Pruning: While soft-pruning is effective, exploring other interpretability techniques in conjunction with CCS could provide deeper insights.
  • Broader Model Architectures: Extending CCS to other transformer-based vision-language models beyond CLIP could further establish its general utility.

Summary updated

BibTeX
@inproceedings{madasu2025quantifying,
  author = {Avinash Madasu and Vasudev Lal and Phillip Howard},
  title = {{Quantifying Interpretability in CLIP Models with Concept Consistency}},
  booktitle = {VisCon @ CVPR},
  year = {2025},
  url = {https://openreview.net/forum?id=LYlNzqt4xh},
}
Figure