VL-InterpreT: An Interactive Visualization Tool for Interpreting Vision-Language Transformers

Estelle Aflalo, Meng Du, Shao-Yen Tseng, Yongfei Liu, Chenfei Wu, Nan Duan, Vasudev Lal · DOI

Abstract

Vision-Language (VL) Transformers have achieved state-of-the-art performance across various multimodal tasks, yet their internal mechanisms remain largely opaque. We present VL-InterpreT, an interactive visualization tool designed to demystify these "black box" models. By decomposing complex attention mechanisms and tracking hidden state representations across layers, VL-InterpreT allows researchers to observe how models align textual concepts with specific image regions, facilitating better model diagnostics and understanding.

Introduction

While Transformer architectures have revolutionized both Natural Language Processing and Computer Vision, their internal decision-making processes—especially in multimodal settings—remain difficult to interpret. In a standard Vision-Language model, information does not merely flow within a single modality; it crosses over, creating a complex web of dependencies. Existing interpretability tools are often optimized for unimodal models (like BERT). Multimodal models introduce a "four-way" attention problem: how text attends to text, how images attend to images, and the two cross-modal directions (text-to-image and image-to-text). Without specialized tools, it is challenging to diagnose why a model might fail a visual reasoning task or to verify if it is truly "understanding" a concept rather than exploiting statistical biases.

Methods and System Design

The VL-InterpreT system follows a two-stage workflow: first, extracting attention weights and hidden states from a pre-trained model (such as KD-VLP); second, loading these components into an interactive web-based interface.

Schematic of the multimodal attention decomposition and hidden representation flow within the VL-InterpreT framework.

The tool incorporates several key technical features:

  • Attention Decomposition: The system splits the massive attention matrix into four distinct components: Language-to-Language (L2L), Vision-to-Vision (V2V), Language-to-Vision (L2V), and Vision-to-Language (V2L). This allows for granular analysis of how information is shared between modalities.
  • Interactive Heatmaps: Users can interactively select specific words to visualize heatmaps of image patches the model is focusing on, or select image regions to see corresponding text tokens.
  • Hidden State Probing: VL-InterpreT utilizes t-distributed Stochastic Neighbor Embedding (t-SNE) to project high-dimensional token representations (e.g., 768D) into a 2D space. To maintain visualization clarity, the tool filters out "noise" such as stop words and background image patches.
  • Custom Interpretability Metrics: The tool supports custom metrics, such as the Spearman correlation between a model's attention heatmap and ground-truth panoptic segmentation masks, providing a quantitative measure of semantic alignment.

Experimental Evaluation

The tool was evaluated using the KD-VLP model, an end-to-end pre-trained VL transformer, across two major benchmarks:

  1. VCR (Visual Commonsense Reasoning): A dataset of 290k QA pairs derived from movie scenes requiring high-level social and physical commonsense.
  2. WebQA: A multi-hop, multimodal benchmark for open-domain question answering where answers may be found in either text or images.

Key Insights

The VL-InterpreT dashboard interface, displaying the Attention Head Summary, t-SNE embeddings, and cross-modal attention heatmaps for a specific example. Source, p. 4

The VL-InterpreT dashboard interface, displaying the Attention Head Summary, t-SNE embeddings, and cross-modal attention heatmaps for a specific example.

Analysis using VL-InterpreT revealed several critical insights into transformer behavior:

  • Emergent Segmentation: Researchers discovered that certain attention heads in the middle and late layers naturally specialize in tasks similar to panoptic segmentation. For example, Layer 8, Head 9 showed a high correlation with human-annotated "person" masks, despite no explicit segmentation training.
  • Cross-Modal Concept Alignment: By tracking hidden states through successive layers, the tool demonstrates "concept-level alignment." For instance, the representation for the word "plants" and the representation for image patches containing plants move closer together in the embedding space as they pass through deeper layers.
  • Error Forensics: The tool is highly effective for debugging failure modes. In one WebQA example where the model incorrectly identified a color, VL-InterpreT revealed that the model was attending to white feathers in the background rather than the specific clothing item mentioned in the prompt.

Results and Discussion

Quantitative analysis through the tool showed that attention patterns evolve significantly across the model's depth. Early layers typically show low correlation with semantic objects (average < 0.1), while middle and later layers demonstrate much higher correlation (average > 0.5), indicating that the model builds semantic understanding progressively. Furthermore, the tool's interactive discovery feature allows users to select a text token and automatically find its "nearest neighbor" in the image modality across a dataset, confirming the model's ability to ground language in vision.

Conclusion and Future Work

VL-InterpreT provides a powerful lens into the inner workings of Vision-Language Transformers. While the current workflow requires pre-saving data for fixed examples, future work aims to scale this to massive datasets and incorporate "live" modes for real-time manipulation. Additionally, expanding the tool to support video or audio modalities would further enhance its utility for the next generation of multimodal models.

Summary updated

BibTeX
@inproceedings{aflalo2022vl,
  author = {Estelle Aflalo and Meng Du and Shao-Yen Tseng and Yongfei Liu and Chenfei Wu and Nan Duan and Vasudev Lal},
  title = {{VL-InterpreT: An Interactive Visualization Tool for Interpreting Vision-Language Transformers}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.02072},
}
Figure