Understanding Visual Concepts Across Models

Brandon Trabucco, Max Gurinas, Kyle Doherty, Ruslan Salakhutdinov

TL;DR

Researchers have discovered that the "soft prompts" used to teach multimodal models new visual concepts are model-specific "hacks" rather than universal semantic representations. Even if two models (like a generator and a detector) understand the same concept, the specific word embeddings they use to represent it are non-transferable and behave more like adversarial perturbations than meaningful language.

What Problem Does This Paper Address?

In the world of multimodal AI, we often use "soft prompt-tuning" (like Textual Inversion) to teach models new things—say, a specific breed of dog or a unique toy—using just a single word embedding. There is a growing hypothesis that different models might be converging on a shared "Platonic" representation of visual information.

If this were true, a word embedding trained to generate a specific cat in Stable Diffusion should theoretically work to detect that same cat in a model like OWL-v2. This paper investigates whether these learned visual concepts are interoperable across different architectures and tasks (generation, detection, and classification).

Methods

The authors conducted a massive study involving 4,800 new embeddings for 40 diverse visual concepts. They tested three state-of-the-art models:

  • Stable Diffusion 2.1 (Generation)
  • OWL-v2 (Open-set Object Detection)
  • CLIP / Data Filtering Networks (Zero-shot Classification)

To test transferability, they developed a Linear Transfer Function $T(v)$ to map word embeddings from one model's vector space to another. They also explored the geometry of the embedding space by constraining the optimization to a small $\epsilon$-ball around unrelated "anchor" words to see if a concept could be "found" anywhere in the space.

Figure 1: Large multimodal models can learn new words that represent specific concepts, like <black-dog> for the black Labrador retriever on the left in the figure. Do models learn similar words for the same concept? We study the interoperability of new word embeddings that encode visual concepts across three models and tasks, and show that popular soft prompt-tuning approaches find model-specific and non-transferable solutions.

Datasets

The study utilized four standard computer vision benchmarks to ensure a wide variety of concepts:

  1. ImageNet: Used for detection and classification.
  2. DreamBooth: Focused on fine-grained, subject-driven generation.
  3. COCO: Common objects in context.
  4. PASCAL VOC: A classic object detection and classification dataset.

Key Insights and Ideas

  • The "Fracturing" of Embedding Space: The most striking finding is that performant solutions for any visual concept are located everywhere. You can find a perturbation near the word "strawberry" that makes a model generate a "sombrero." The authors call this "fracturing"—the set of embeddings that represent a concept is disconnected and scattered throughout the space.
  • Soft Prompts are Adversarial, Not Semantic: These learned embeddings don't behave like real words. Instead, they act like adversarial perturbations that "hijack" the model's internal activations.
  • Targeting the Final Layers: Analysis of the text encoders showed that these custom embeddings only start looking like the target concept in the very final layers of the model. In the early layers, the model still thinks the word is the original "anchor" word (e.g., it still sees "strawberry" even if it eventually generates a "sombrero").
  • Asymmetric Transfer: Transfer isn't equally bad in all directions. Classification-trained prompts transfer to generation better than detection-trained prompts do, likely because classification focuses on general features while detection prompts are noisier and more specific to the detector's architecture.
Figure 5: Examples of "fracturing," where the same concept (rows) is generated or detected using perturbations near totally unrelated anchor words (columns).

Key Results

  • Non-Transferability: When embeddings optimized for one model are moved to another via a linear map, the performance collapses. The new model essentially ignores the fine-tuning and "snaps" back to the nearest known word in its original vocabulary.
  • Performance Saturation: In-domain performance (using the prompt on the model it was trained for) saturates extremely quickly. As shown in Figure 6, you only need to move a tiny distance ($\delta = 0.5$) from a random word to find a perfect representation of a complex visual concept.
  • Quantitative Drop: While a prompt might achieve ~100% accuracy on its training task, transferring it to a different task often results in a performance drop of 70% or more, as seen in the cross-domain gaps in Figure 3.
Figure 3: Visual word embeddings trained for one task (i.e. generation) perform well on that task, but may not perform well when transferred to another task (i.e. generation →detection). In certain directions, such as classification →generation, transfer works better than others. To understand when transfer fails, we perform extensive ablations across four standard datasets, and three models in generation, detection, and classification.

Limitations and Future Work

The authors acknowledge that their study is a diagnostic one; they do not propose a new, better way to transfer prompts. Instead, they highlight the fundamental difficulty of the task.

Future Directions: * Semantic Regularization: Can we force soft prompts to be more "word-like" during training to improve transfer? * Privacy Concerns: The authors warn that if transfer were to become easy, it could allow malicious actors to create detectors for specific individuals using only a few public photos, posing a significant privacy risk. * Interpretable Prompts: Moving away from "fractured" solutions toward prompts that early layers of a text encoder can actually understand.

Summary updated

BibTeX
@misc{trabucco2024understanding,
  author = {Brandon Trabucco and Max Gurinas and Kyle Doherty and Ruslan Salakhutdinov},
  title = {{Understanding Visual Concepts Across Models}},
  year = {2024},
  eprint = {2406.07506},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.07506},
}
Figure