What Does BERT with Vision Look At?

Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, Kai-Wei Chang

Abstract

This paper investigates the internal mechanisms of "visually grounded" language models, specifically VisualBERT. Through attention probing, the authors demonstrate that these models naturally learn to align linguistic concepts with visual regions—a process known as grounding—without explicit supervision. The study reveals emergent entity and syntactic grounding, showing how the model refines its cross-modal understanding across Transformer layers.

Introduction

In recent years, vision-language models like ViLBERT and LXMERT have achieved state-of-the-art performance on tasks requiring simultaneous understanding of text and images. However, these models are often treated as "black boxes." While their effectiveness is clear, the underlying process of how they relate words to pixels remains opaque. This research seeks to determine if these models are merely finding statistical shortcuts or if they are developing a fundamental human-like ability: grounding. Grounding is the capacity to link a linguistic concept (e.g., the word "dog") to a specific visual entity (the pixels representing a dog).

The VisualBERT Architecture

To study this phenomenon, the authors introduced VisualBERT, a streamlined baseline model. Unlike complex architectures that process vision and language in separate streams, VisualBERT utilizes an "early fusion" approach. It feeds both text tokens and image regions—extracted via a Faster R-CNN object detector—into a single Transformer stack. This allows the model to discover alignments between modalities starting from the very first layer.

The VisualBERT architecture facilitates early fusion by processing text tokens and image regions within a single Transformer stack.

Probing Cross-Modal Attention

The core of the analysis involves Attention Probing. The researchers treated each of the model's 144 attention heads (12 layers × 12 heads) as a simple classifier. For a given word, they identified which image region received the highest attention weight. If this region matched the manually annotated "gold standard" bounding box for that word (using the Flickr30K Entities dataset), the head was considered to be successfully performing "grounding."

Key Insights: Emergent Grounding and Refinement

The study yielded several significant findings regarding how VisualBERT processes information:

1. Emergent Entity Grounding

The model learns to link nouns (entities) to objects without any explicit supervision. Some attention heads achieved over 50% accuracy in grounding, significantly outperforming a rule-based baseline of 17.33%.

2. Syntactic Grounding

Perhaps most surprisingly, the authors found that non-entity words, such as verbs and prepositions, also "ground" themselves to relevant image regions. For instance, the word "walking" might attend to the person performing the action. This suggests that the model uses visual context to resolve syntactic dependencies.

3. Layer-wise Refinement

Grounding is a progressive process. As data moves through the Transformer layers, the model refines its understanding. Lower layers often exhibit "messy" or incorrect alignments, whereas higher layers (specifically layers 10 and 11) show highly precise, focused attention on the correct objects.

Attention maps across layers demonstrate how the model refines its grounding of words like 'man' and 'shirt' as information progresses through the network.

4. Grounding as a Byproduct of Reasoning

The authors argue that syntactic grounding is a natural byproduct of cross-modal reasoning. To correctly ground a phrase like "the man in the white shirt," the model must identify the relationships between "man," "wearing," and "shirt" to distinguish the correct individual from others in the scene.

Performance and Results

Despite its architectural simplicity, VisualBERT matched or exceeded the performance of contemporary state-of-the-art models, scoring 70.80 on VQA 2.0 and 52.4 on VCR. The best-performing heads for specific syntactic relations showed remarkable accuracy, such as 67.44% for numbers (num) and 54.01% for determiners (det).

Conclusion and Future Work

While VisualBERT serves as a powerful baseline, the authors note that future research should investigate whether these grounding phenomena persist in "dual-stream" models. Additionally, there is significant room to explore more complex linguistic phenomena, such as cross-modal coreference. The "linguistically-inspired" behavior emerging from these models suggests a rich area for further systematic study into how AI bridges the gap between language and vision.

Summary updated

BibTeX
@inproceedings{li2020what,
  author = {Liunian Harold Li and Mark Yatskar and Da Yin and Cho-Jui Hsieh and Kai-Wei Chang},
  title = {{What Does BERT with Vision Look At?}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.469},
}
Figure