Research map / Vision-language and multimodal / CLIP and zero-shot
Interpreting CLIP's Image Representation via Text-Based Decomposition
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Decomposes CLIP ViT image representations into per-layer, per-head, and per-patch contributions, uses text to label head output directions (TextSpan), and turns the patch decomposition into a zero-shot segmenter and spurious-cue remover.
Problem
CLIP's image representation is poorly understood: it is unclear what information is encoded and which components (layers, heads, image locations) produce it, limiting interpretability and debugging of spurious correlations.
Approach
Exploit the residual and attention structure of CLIP-ViT to write the image representation as a sum over heads and patch tokens, all living in the joint text-image space; greedily select text descriptions (TextSpan) that span each head's output variance to label head roles, and use per-token contributions as zero-shot segmentation heatmaps.
Key results
- Ablating all but the last 4 attention layers' direct effects keeps ImageNet zero-shot accuracy near base; 60 TextSpan descriptions per head reach 72.77% vs 75.25% base accuracy on ViT-L.
- Removing location/geolocation heads raises Waterbirds worst-group accuracy for ViT-L from 47.7% to 72.9%.
- The patch-level decomposition achieves 75.21 pixel accuracy and 54.50 mIoU on ImageNet-segmentation, beating the best listed explainability baseline (47.47 mIoU).
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use image-token decomposition heatmaps for zero-shot segmentation | CLIP · ImageNet-segmentation | mIoU: 47.47 -> 54.50 | Helped |
| Ablate geolocation and image-location heads (ablation) | CLIP ViT-L-14 · Waterbirds | worst-group accuracy: 47.7 -> 72.9 | Helped |
| Ablate property-specific heads (ablation) | CLIP on Waterbirds · Waterbirds | accuracy: 73.1 -> 84.2 | Helped |
| Project each head output to a subspace spanned by 60 TextSpan descriptions (ablation) | CLIP ViT-L · ImageNet zero-shot classification | accuracy: 75.25% -> 72.77% | Hurt |
| Mean-ablate class-token contribution (ablation) | CLIP ViT-B-16 · ImageNet zero-shot classification | accuracy: 70.22 -> 69.37 | Hurt |
| Mean-ablate class-token contribution and MLPs (ablation) | CLIP ViT-B-16 · ImageNet zero-shot classification | accuracy: 70.22 -> 67.32 | Hurt |
| Mean-ablate class-token contribution (ablation) | CLIP ViT-L-14 · ImageNet zero-shot classification | accuracy: 75.25 -> 74.38 | Hurt |
| Mean-ablate class-token contribution and MLPs (ablation) | CLIP ViT-L-14 · ImageNet zero-shot classification | accuracy: 75.25 -> 73.87 | Hurt |
| Mean-ablate all MLP direct effects (ablation) | CLIP image encoder · ImageNet zero-shot classification | accuracy: 1%-3% | Hurt |
| Mean-ablate early MSA layers, retaining the last 4 (ablation) | CLIP image encoder · ImageNet zero-shot classification | accuracy | No clear effect |
Surprising findings
- Mean-ablating all MLP layers causes only a 1-3% accuracy drop, so the MLPs have a negligible direct effect on the image representation.
- Not all attention heads have clear single-property roles; some heads' top text descriptions are incoherent, possibly due to collaboration between heads or missing descriptions in the pool.
Limitations
- Only direct effects of components are analyzed; indirect effects between layers are ignored.
- Not all attention heads have clear, single-property roles.
- Analysis is limited to CLIP-ViT; other architectures such as ResNet are not studied.
Experimental setup
Datasets: ImageNet validation set LAION-2B Waterbirds ImageNet-segmentation ChatGPT-generated text descriptions (3498 general, 28767 class-specific)
Benchmarks: ImageNet zero-shot classification Waterbirds ImageNet-segmentation
Metrics: top-1 accuracy worst-group accuracy pixel accuracy mIoU mAP
Baselines: LRP partial-LRP rollout raw attention GradCAM Waterbirds random head ablation
Builds on: CLIP ViT mean-ablation transformer residual decomposition
Closest papers by meaning
- Decomposing and Interpreting Image Representations via Text in ViTs Beyond CLIP (NeurIPS 2024 · similarity 0.90)
- Gradient-based Visual Explanation for Transformer-based CLIP (ICML 2024 · similarity 0.87)
- Interpreting and Analysing CLIP's Zero-Shot Image Classification via Mutual Knowledge (NeurIPS 2024 · similarity 0.86)
- Interpreting CLIP with Sparse Linear Concept Embeddings (SpLiCE) (NeurIPS 2024 · similarity 0.86)
- un$^2$CLIP: Improving CLIP's Visual Detail Capturing Ability via Inverting unCLIP (NeurIPS 2025 · similarity 0.86)
- Boosting the visual interpretability of CLIP via adversarial fine-tuning (ICLR 2025 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
