From Behavioral Performance to Internal Competence: Interpreting Vision-Language Models with VLM-Lens

Hala Sheta, Eric Huang, Shuyu Wu, Ilia Alenabi, Jiajun Hong, Ryker Lin, Ruoxi Ning, Daniel Wei, Jialin Yang, Jiawei Zhou, Ziqiao Ma, Freda Shi

TL;DR

VLM-LENS is an open-source, YAML-configurable toolkit designed to extract intermediate representations from any layer of a Vision-Language Model (VLM) during a forward pass. By supporting 16 base models (and over 30 variants) through a unified interface, it allows researchers to move beyond surface-level "exact-match" accuracy metrics and directly analyze a model's internal competence and hidden states.

What Problem Does This Paper Address?

While Vision-Language Models (VLMs) excel at multimodal tasks, our methods for evaluating them are remarkably shallow. Most benchmarks rely on behavioral evaluation—checking if the model's final text output exactly matches a ground-truth answer. This approach creates a massive blind spot: it fails to capture the rich information embedded within hidden layers and can easily be fooled by models exploiting superficial dataset shortcuts.

Furthermore, the mechanistic interpretability tools that help us peer inside text-only models (like TransformerLens) haven't successfully crossed over to the multimodal world. Adapting these tools to VLMs typically requires immense engineering effort due to "dependency hell" (conflicting libraries between different models), custom architectures, and poorly documented codebase implementations.

Methods

The authors introduce VLM-LENS, a framework that standardizes the extraction of internal VLM states using PyTorch's forward hook mechanism.

Figure 1: An example use case of VLM-LENS, where intermediate output from Qwen2-VL (Wang et al., 2024a) is extracted for probing.

Its design centers on three core pillars:

  1. Unified Interface: Users define model configurations, input paths, and target layers inside a simple YAML file. VLM-LENS handles the boilerplate code for model loading, preprocessing, and inference automatically.
  2. Isolated Environments: To fix conflicting library requirements, the toolkit provides model-specific environment setups installable via single-line commands.
  3. Structured Storage: Extracted tensors are saved into a standardized SQLite3 database alongside crucial metadata (e.g., model architecture, layer name, prompt, and token dimensions) for easy downstream analysis.

To prove the toolkit's utility, the authors conduct two types of analysis: Probing (training a small secondary network to see if specific concepts are present in the hidden states) and Concept Similarity (using Principal Component Analysis and cosine similarity to map out how abstract concepts are structured).

Datasets

The toolkit was evaluated using several distinct datasets:

  • CLEVR: A synthetic diagnostic dataset used to generate questions around five primitive object attributes (color, material, number, shape, size) plus binary boolean questions for the probing experiments.
  • Stroop Dataset: A custom-built dataset inspired by the classic psychological Stroop Effect, featuring images with conflicting color cues (e.g., the word "white" printed in yellow font on a blue canvas).
  • MSCOCO (Validation Subset): 2,690 image-text pairs used to benchmark the system's inference speed and memory consumption across different hardware configurations.

Key Insights and Ideas

  • Color is Highly Salient: Across every single VLM tested, color information is deeply and reliably encoded within the hidden states, consistently yielding the highest probing accuracies.
  • Advanced Models Retain Complex Concepts: State-of-the-art models with strong instruction-following capabilities (like Qwen2-VL and MiniCPM-o) maintain abstract concepts like material, number, and shape cleanly into their final layers. Older or less capable models (like LLaVA-1.5-7B) show a noticeable drop-off in internal representation quality for these harder categories.
  • The VLM "Stroop Effect": When forced to process conflicting visual/textual color cues, VLMs reliably encode all three features (the text itself, the font color, and the background color). Surprisingly, the background color creates the strongest internal contrast, followed by the lexical text content, while the foreground font color is the weakest.
  • Non-Linear Representations: Abstract concepts like color are not captured in a single linear direction within the VLM's representation space; they require multiple PCA components to be cleanly separated.

Key Results

  • Probing Performance: Probes trained on the hidden states of Qwen2-VL-7B and MiniCPM-o achieved near-perfect accuracy across multiple CLEVR splits, proving that task-relevant information is explicitly structured within their embeddings.
  • Inference Efficiency: System benchmarks reveal massive performance disparities despite similar parameter counts. For 7B/8B models, MiniCPM-o proved highly optimized, clocking an inference time of 0.125 seconds per instance. In contrast, InternVL and Molmo were significantly slower, taking 0.623 seconds and 0.529 seconds per instance, respectively.
  • Memory Footprint: Memory usage varies wildly by architecture. Even when running at lower precisions (float16/bfloat16), Qwen2-VL-7B and LLaVA-1.5-7B demanded the highest peak GPU memory, consuming 33.8 GB and 29.0 GB, respectively.

Limitations and Future Work

While VLM-LENS successfully unifies representation extraction, it currently has a few limitations:

  • Downstream Task Support: It does not yet natively support advanced mechanistic interpretability techniques like direct attention map visualization or automated neural circuit discovery.
  • No Gradient-Based Saliency: The current database-saving approach prevents users from running gradient-based pixel attribution methods like Grad-CAM out of the box.

The authors plan to rely on open-source community contributions to expand the repository's features, aiming to turn VLM-LENS into a comprehensive suite for multimodal mechanistic interpretability.

Summary updated

BibTeX
@inproceedings{sheta2025from,
  author = {Hala Sheta and Eric Huang and Shuyu Wu and Ilia Alenabi and Jiajun Hong and Ryker Lin and Ruoxi Ning and Daniel Wei and Jialin Yang and Jiawei Zhou and Ziqiao Ma and Freda Shi},
  title = {{From Behavioral Performance to Internal Competence: Interpreting Vision-Language Models with VLM-Lens}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=r3s6U0MvXx},
}
Figure