Sparse Attention for Dense Open-Vocabulary Prediction in CLIP

· Source: Takara TLDR - Daily AI Papers · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Computer Vision · Depth: Expert, medium

Summary

A new approach enhances Contrastive Language-Image Pre-training (CLIP) for dense, open-vocabulary prediction by addressing its softmax-based self-attention. CLIP's standard attention spreads probability mass across all token pairs, including semantically irrelevant ones, generating noise that obscures fine-grained, spatially localized cues. Researchers propose an inference-time substitution of the row-wise softmax in the final visual self-attention layers with the α-entmax transform. This transform applies a data-dependent threshold, mapping low scores to zero, thereby implicitly denoising by eliminating contextually irrelevant dependencies and reallocating mass to the most relevant tokens. Evaluations on open-vocabulary tasks, including dense semantic segmentation (Pascal VOC, Pascal Context, ADE20K) and fine-grained retrieval (FG-OVD), demonstrate that the performance gain from attention sparsification directly correlates with how much the baseline attention initially spreads beyond the target class.

Key takeaway

For Machine Learning Engineers optimizing CLIP for dense open-vocabulary prediction, consider replacing the final visual self-attention's softmax with α-entmax during inference. This substitution implicitly denoises attention by zeroing irrelevant token dependencies, enhancing performance on tasks like semantic segmentation and fine-grained retrieval. You should evaluate this approach, particularly if your current CLIP models exhibit broad attention spread, as gains are proportional to the initial off-target attention.

Key insights

Sparsifying CLIP's dense attention with α-entmax at inference improves fine-grained open-vocabulary prediction by denoising irrelevant token dependencies.

Principles

Method

Substitute row-wise softmax in final visual self-attention layers with α-entmax during inference, applying it across query-key and self-correlation variants.

In practice

Topics

Code references

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, Computer Vision Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Takara TLDR - Daily AI Papers.