Debiasing CLIP: Interpreting and Correcting Bias in Attention Heads

Wei Jie Yeo, Rui Mao, Moloud Abdar, Erik Cambria, Ranjan Satapathy
5/23/2025
5 citations
cs.CVcs.CL
transformer-attention

Official code: wj210/CLIP_LTC (5 stars, Python, MIT, last commit 2026-05-16).

Abstract

Multimodal models like CLIP have gained significant attention due to their remarkable zero-shot performance across various tasks. However, studies have revealed that CLIP can inadvertently learn spurious associations between target variables and confounding factors.

Show full abstract

To address this, we introduce \textsc{Locate-Then-Correct} (LTC), a contrastive framework that identifies spurious attention heads in Vision Transformers via mechanistic insights and mitigates them through targeted ablation. Furthermore, LTC identifies salient, task-relevant attention heads, enabling the integration of discriminative features through orthogonal projection to improve classification performance. We evaluate LTC on benchmarks with inherent background and gender biases, achieving over a $>50\%$ gain in worst-group accuracy compared to non-training post-hoc baselines. Additionally, we visualize the representation of selected heads and find that the presented interpretation corroborates our contrastive mechanism for identifying both spurious and salient attention heads. Code available at https://github.com/wj210/CLIP_LTC.

View on arXivView PDF

Code Implementations(1)

wj210/CLIP_LTCOfficial100%
MIT
50Python, Jupyter NotebookDec 14, 20246 months agoMIT

Similar Papers

Cite this paper

@article{yeo2025debiasing,
  title  = {Debiasing CLIP: Interpreting and Correcting Bias in Attention Heads},
  author = {Wei Jie Yeo and Rui Mao and Moloud Abdar and Erik Cambria and Ranjan Satapathy},
  year   = {2025},
  eprint = {2505.17425},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.17425v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.17425.svg)](https://codeofpaper.com/paper/2505.17425)

Discussion