Interpreting CLIP with Sparse Linear Concept Embeddings (SpLiCE)

Usha Bhalla, Alex Oesterling, Suraj Srinivas, Flavio Calmon, Himabindu Lakkaraju

Introduction

Contrastive Language-Image Pre-training (CLIP) has revolutionized multimodal AI by creating a shared latent space for images and text. However, these representations are high-dimensional dense vectors—essentially "black-box" lists of numbers. This lack of transparency makes it difficult to audit model behavior or identify when a model relies on spurious correlations, such as identifying a "cow" primarily due to the presence of "grass."

To address this, researchers developed SpLiCE (Sparse Linear Concept Embeddings), a training-free, task-agnostic method that decomposes dense CLIP embeddings into sparse, human-interpretable linear combinations of text concepts. By representing an image as a handful of weighted words (e.g., "zebra: 0.09, africa: 0.05"), SpLiCE provides a window into the model's internal logic.

The SpLiCE Framework

SpLiCE treats the interpretation of a CLIP embedding as a sparse recovery problem. The process involves four key steps:

  1. Concept Vocabulary: A dictionary of approximately 15,000 common one- and two-word concepts (e.g., "coffee," "birthday party") is derived from the LAION dataset.
  2. Modality Alignment: To account for the "modality gap" between image and text embeddings in CLIP, the authors apply mean-centering and re-normalization to align the two data distributions.
  3. Sparse Non-negative Decomposition: For a given image embedding ($z$), SpLiCE solves an optimization problem (using LASSO or ADMM) to find a sparse weight vector ($w$). Crucially, these weights are constrained to be non-negative, ensuring that the resulting "bag-of-words" is intuitive for humans.
  4. Reconstruction: The sparse vector $w$ can reconstruct a "semantic-only" version of the original embedding for downstream tasks like zero-shot classification.

Key Insights: The Linear Representation Hypothesis

A central finding of the research is the Linear Representation Hypothesis: CLIP appears to encode concepts additively. This suggests that the latent space behaves like a semantic "bag-of-words," where adding the vector for "red" to "apple" results in a vector close to "red apple."

Furthermore, the authors discovered that CLIP embeddings contain significant "non-semantic noise." SpLiCE reconstructions, despite having lower cosine similarity to the original vectors, often match or exceed the performance of the original dense embeddings on semantic tasks. This indicates that only a small fraction of the dense vector (10–30 active concepts out of 15,000) is necessary to maintain high zero-shot accuracy.

Results and Applications

SpLiCE was evaluated across diverse benchmarks, including ImageNet, CIFAR100, and CelebA. Key results include:

  • Performance Parity: On CIFAR100, SpLiCE achieved a zero-shot accuracy of 0.768, slightly outperforming the baseline CLIP's 0.750 despite the massive reduction in data dimensionality.
  • Bias Discovery: SpLiCE revealed hidden biases in datasets. For instance, in CIFAR100, the "woman" concept was found to be highly correlated with "swimwear" and "bra," reflecting biases in the underlying training data.
  • Model Editing: The method allows for "surgical interventions." By zeroing out specific concepts (like "glasses") in the SpLiCE embedding, researchers can prevent a model from using specific features without retraining the entire system.
Example of a sparse decomposition for an image of a cat in a bathroom, showing relevant concepts like 'cat', 'shower', and 'sink'.

Conclusion

SpLiCE offers a powerful, training-free mechanism for interpreting multimodal models. By converting dense vectors into sparse, weighted concepts, it enables researchers to audit biases and edit model behavior while maintaining competitive performance. Future work may expand the concept dictionary to include more complex relational tokens and long-form descriptions.

Summary updated

BibTeX
@inproceedings{bhalla2024interpreting,
  author = {Usha Bhalla and Alex Oesterling and Suraj Srinivas and Flavio Calmon and Himabindu Lakkaraju},
  title = {{Interpreting CLIP with Sparse Linear Concept Embeddings (SpLiCE)}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=7UyBKTFrtd},
}
Figure