Not All Attention Heads Are What You Need: Refining CLIP's Image Representation with Attention Ablation
Feng Lin, Marco Chen, Haokui Zhang, Xiaotian Yu, Guangming Lu, Rong Xiao
TL;DR
Attention Ablation Technique (AAT) reveals that CLIP's image encoder contains detrimental attention heads whose ablation can refine representations without retraining. AAT provides two inference-friendly strategies, GA and BP, to automatically identify and suppress these heads by adjusting attention weights, achieving notable improvements in cross-modal retrieval and zero-shot tasks with minimal overhead. Across MS COCO, Flickr30k, ReCoS, COCO-CN, Flickr30k-CNA, ImageNet-1k, and Cola, AAT delivers consistent gains and demonstrates strong parameter efficiency relative to PEFT baselines, while aligning with interpretability findings that some heads carry spurious or domain-biased cues. The method offers practical benefits for deploying large-scale vision-language systems on constrained hardware and data regimes, while also highlighting limitations in domain transfer and compositional reasoning. Overall, AAT advances both the efficiency and interpretability of VLM refinements by directly manipulating attention at the head level rather than updating model weights.
Abstract
This paper investigates the role of attention heads in CLIP's image encoder. Building on interpretability studies, we conduct an exhaustive analysis and find that certain heads, distributed across layers, are detrimental to the resulting representations. To mitigate their impact, we propose a simple yet effective Attention Ablation Technique (AAT) that suppresses selected heads by directly manipulating their attention weights. By incorporating two complementary strategies tailored to different application scenarios, AAT enables the systematic identification and ablation of harmful heads with minimal overhead. Experiments show that AAT consistently improves downstream performance across diverse domains, boosting recall by up to 11.1% on cross-modal retrieval benchmarks. These results highlight that AAT can effectively refine large-scale VLMs with virtually no extra inference cost, while yielding semantically meaningful patterns that align with existing interpretability findings.
