No Token Left Behind: Explainability-Aided Image Classification and Generation

Roni Paiss, Hila Chefer, Lior Wolf · DOI

Abstract

Vision-language models like CLIP have revolutionized zero-shot classification and text-to-image generation. However, these models often suffer from "selective similarity," where they achieve high similarity scores by focusing on a subset of tokens while ignoring others. This paper introduces a novel approach that utilizes explainability maps as a supervision signal during optimization. By enforcing a "No Token Left Behind" policy through a specialized explainability loss, the authors demonstrate significant improvements in one-shot classification, text-guided image editing, and spatial control in image generation.

Introduction

OpenAI’s CLIP (Contrastive Language-Image Pre-training) has become a foundational component in modern AI, serving as the bridge between visual and textual representations. Despite its versatility, CLIP exhibits a tendency toward "laziness." When processing a complex prompt such as "a person with purple hair," the model may yield a high similarity score by focusing exclusively on the token "purple" while neglecting the semantic importance of "hair."

This phenomenon, termed selective similarity, leads to instabilities in downstream tasks. In prompt engineering, it can result in overfitting to non-semantic image features. In generative tasks, it often leads to local minima where the model fails to reflect the full intent of the user's prompt. To address this, researchers from Tel Aviv University propose a method to leverage explainability maps to ensure the model attends to every relevant semantic component of a prompt.

Methodology: Explainability as Supervision

The core innovation of this work is the integration of explainability maps—specifically those generated via the method by Chefer et al.—into the optimization loop. Rather than using explainability solely as a post-hoc diagnostic tool, the authors use it as an active steering mechanism.

The Explainability Loss ($\mathcal{L}_{expl}$)

The authors introduce an additional loss term, $\mathcal{L}_{expl}$, designed to penalize the model if any semantic tokens (primarily nouns and adjectives) receive low relevance scores. By maximizing the minimum relevance across all tokens, the model is forced to ensure that "no token is left behind." This ensures that the similarity score is a holistic reflection of the entire prompt rather than a result of sparse feature matching.

Applications in Classification and Generation

  1. One-Shot Classification: The loss is integrated into prompt tuning (e.g., CoOp). This forces the learned prompt vectors to focus on the actual class name (e.g., "necklace") rather than background noise or unrelated artifacts.
  2. Spatial Conditioning: By analyzing the image-side explainability maps, the model can identify where it perceives specific objects. By applying a Dice Loss to these heatmaps, the authors can constrain the model to generate or identify objects within user-defined bounding boxes.
  3. Text-Guided Editing: In frameworks like StyleCLIP, the explainability loss prevents the model from ignoring parts of the edit prompt, leading to more faithful image manipulations.

Key Insights

  • Semantic Hierarchy: A Part-of-Speech (POS) analysis revealed that CLIP naturally prioritizes nouns but frequently ignores prepositions and spatial descriptors. The proposed method compensates for this bias.
  • Compound Noun Resolution: Standard CLIP-guided models often struggle with compound nouns (e.g., "strawberry muffin"), sometimes focusing only on the modifier. The explainability loss equalizes the contribution of both tokens, resulting in more accurate visual representations.

Experimental Results

The researchers evaluated their approach across several benchmarks, demonstrating consistent improvements over state-of-the-art baselines:

  • Classification Accuracy: On the ImageNet-R (Rendition) dataset using a ResNet-50 backbone, the method improved 1-shot accuracy from 50.38% to 57.73% compared to the standard CoOp method.
  • Spatial Precision: In VQGAN+CLIP generation tasks, the method achieved 71.7% precision in object placement, a significant leap from the 46.4% achieved by the leading baseline. This effectively prevents objects from "bleeding" outside their designated spatial constraints.
  • Human Evaluation: A user study involving 46 participants confirmed that the proposed method produced images that were more faithful to complex prompts and exhibited higher qualitative alignment in editing tasks (e.g., successfully adding a beard to a portrait where the baseline failed).

Conclusion and Future Work

By transforming explainability from a passive observation tool into an active supervision signal, the "No Token Left Behind" framework significantly enhances the robustness of CLIP-based systems. While the current optimization-based approach can be computationally intensive, it paves the way for future "CLIP 2.0" models that could be trained with these constraints inherently. This work moves the field closer to vision-language models that truly understand the full semantic breadth of human language.

Summary updated

BibTeX
@inproceedings{paiss2022no,
  author = {Roni Paiss and Hila Chefer and Lior Wolf},
  title = {{No Token Left Behind: Explainability-Aided Image Classification and Generation}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19775-8\_20},
}
Figure