Task Bias in Vision-Language Models

Sachit Menon, Ishaan Preetam Chandratreya, Carl VondrickarXiv 2022 · DOI

Introduction

Vision-Language Models (VLMs) like CLIP have revolutionized zero-shot image classification. However, these models often exhibit an unpredictable "task bias." When an image contains multiple valid interpretations—such as an object, an action, and text—the model's visual encoder may prioritize one feature over others in a way that is inconsistent across different inputs. This paper explores how to correct this bias using visual prompting, a technique that steers the model's attention without modifying its underlying weights.

The Challenge of Task Bias

Standard zero-shot classification assumes the model is a neutral observer. Yet, a single image often contains information relevant to multiple tasks. For instance, an image of a person standing next to a building with a sign could be interpreted through the lens of object recognition (the building), action recognition (standing), or scene text recognition (the sign).

CLIP scores for an image with multiple valid labels (Building, Stand, Note) demonstrate inherent task bias.

The authors identify that CLIP is often strongly predisposed to one of these tasks. Crucially, this bias exists within the visual representation itself. Because the visual encoder processes the image before the text query, engineering better text prompts (e.g., "a photo of the text...") often fails if the encoder has already filtered out the relevant information. This poses risks for downstream applications, such as robotic systems focusing on the wrong environmental cues or image generators inheriting these biases.

Steering Models via Visual Prompting

To address this, the researchers propose "steering" the model using Visual Prompting. Instead of fine-tuning the entire model, they learn a small set of input-level parameters that guide the visual encoder toward the desired task.

Comparison between standard CLIP and the proposed visual prompting method, which uses task-specific prompts to steer image embeddings.

Two primary methods are introduced:

  1. Pixel-Space Prompting (VP): A small, learned border is added around the original image to guide the encoder.
  2. Token-Space Prompting (ViTP): For Vision Transformer (ViT) architectures, a learned "visual token" is prepended to the sequence of image patches, similar to prefix tuning in NLP.

The training objective involves freezing the CLIP model and optimizing only the prompt parameters. The goal is to maximize the similarity between the prompted image embedding and the text embedding of the intended task, while minimizing similarity to competing tasks.

Experimental Findings

The authors evaluated their approach on a multi-task dataset derived from OpenImages-V6, featuring nearly 90,000 images with valid labels for multiple categories (e.g., Objects vs. Scene Text, People vs. Actions).

Key results include:

  • Disambiguation Success: While baseline CLIP was essentially a coin-flip (~50% accuracy) when choosing between two valid tasks, the ViTP (Token) method achieved nearly 100% accuracy in steering the model.
  • Improved Downstream Accuracy: Applying a visual prompt improved CLIP's zero-shot accuracy on standard object recognition from 20.5% to 37.3%.
  • Typographic Attack Mitigation: The method effectively counters "typographic attacks" (e.g., an apple labeled with text). By using an object-focused prompt, the model ignores the misleading text and correctly identifies the object.

Discussion and Future Work

The study highlights that task bias is an architectural issue where the visual encoder selectively encodes information. Visual prompts do not just apply a static filter; they dynamically interact with image content, shifting the model's internal attention mechanism toward relevant features (e.g., physical items vs. signs).

While effective, the method currently requires a small amount of labeled data to train task-specific prompts. Future work may explore making these prompts "universal" across diverse datasets or generating them on-the-fly from natural language descriptions.

Summary updated

BibTeX
@misc{menon2022task,
  author = {Sachit Menon and Ishaan Preetam Chandratreya and Carl Vondrick},
  title = {{Task Bias in Vision-Language Models}},
  year = {2022},
  eprint = {2212.04412},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.04412},
}
Figure