Table of Contents
Fetching ...

Debiasing CLIP: Interpreting and Correcting Bias in Attention Heads

Wei Jie Yeo, Rui Mao, Moloud Abdar, Erik Cambria, Ranjan Satapathy

TL;DR

This work tackles spurious bias in CLIP by introducing Locate-Then-Correct (LTC), a diagnose-then-correct framework that operates at the level of individual Vision Transformer attention heads. By leveraging a linear decomposition of ViT representations, LTC localizes spurious and target states via logit-lens projections and a contrastive mechanism, then mitigates bias through mean ablation of spurious states and knowledge injection using discriminative text-derived vectors. Empirically, LTC yields substantive improvements in worst-group accuracy on background- and gender-bias benchmarks (often exceeding 50% gains) while preserving or enhancing overall performance, and it provides interpretable head-level insights through SHAP and visualization analyses. The approach emphasizes training-free or lightweight interventions with strong interpretability, offering a practical and scalable path to debiasing large multimodal models with minimal parameter updates. Overall, LTC demonstrates that targeted, interpretable head-level corrections can robustly reduce spurious correlations in CLIP and similar models, with potential for extension to other architectures and modalities.

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. 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.

Debiasing CLIP: Interpreting and Correcting Bias in Attention Heads

TL;DR

This work tackles spurious bias in CLIP by introducing Locate-Then-Correct (LTC), a diagnose-then-correct framework that operates at the level of individual Vision Transformer attention heads. By leveraging a linear decomposition of ViT representations, LTC localizes spurious and target states via logit-lens projections and a contrastive mechanism, then mitigates bias through mean ablation of spurious states and knowledge injection using discriminative text-derived vectors. Empirically, LTC yields substantive improvements in worst-group accuracy on background- and gender-bias benchmarks (often exceeding 50% gains) while preserving or enhancing overall performance, and it provides interpretable head-level insights through SHAP and visualization analyses. The approach emphasizes training-free or lightweight interventions with strong interpretability, offering a practical and scalable path to debiasing large multimodal models with minimal parameter updates. Overall, LTC demonstrates that targeted, interpretable head-level corrections can robustly reduce spurious correlations in CLIP and similar models, with potential for extension to other architectures and modalities.

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. 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 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.

Paper Structure

This paper contains 60 sections, 10 equations, 29 figures, 20 tables, 1 algorithm.

Figures (29)

  • Figure 1: Left: Linear decomposition of image representations into individual attention head activations elhage2021mathematical. Spurious states (background: land) activate more strongly on images with opposing attributes, whereas target states (class: waterbird) activate on images with matching attributes. Right: LTC identifies and corrects these states: mean-ablation mitigates spurious states, while knowledge injection enhances target states.
  • Figure 2: Image visualization: Localized representations of $Z_{SY}, Z_Y, Z_S$, and overall image.
  • Figure 3: Normalized SHAP values for $Y$ and $S$.
  • Figure 4: Z_S: Ablating states encoding $S$, Z_SY: Association between $S$ and $Y$. TS: TextSpan [Left]: Predicting $S$ as the target class. [Right]: Predicting both $S$ and $Y$. Dataset: Waterbirds
  • Figure 5: Prediction margins in Waterbirds. Model: ViT-B/16
  • ...and 24 more figures

Theorems & Definitions (1)

  • Definition 4.1