Probing Contextual Language Models for Common Ground with Visual Representations

Gabriel Ilharco, Rowan Zellers, Ali Farhadi, Hannaneh Hajishirzi

Introduction

Can a model that has only ever "read" text understand what a "flying bat" looks like compared to a "baseball bat"? This research investigates the "symbol grounding problem"—whether a system can truly understand language if its symbols (words) aren't linked to the physical world. While large-scale language models (LMs) like BERT and RoBERTa achieve state-of-the-art results on text tasks, they are trained purely on strings of characters. This paper introduces a probing mechanism to show that contextual language models actually encode significant visual information, allowing them to retrieve specific image patches with surprising accuracy, provided they have enough textual context.

Probing for Visual Common Ground

The researchers developed a probing mechanism to measure the "common ground" between text and vision. The core idea is to see if a representation of a noun from a frozen BERT model can be mapped to a specific image of that object.

Overview of the probing mechanism: a textual representation is mapped to a visual space to retrieve the correct image instance.

The probe uses a lightweight model—a single-layer LSTM followed by a linear projection—to map textual representations into a visual feature space. Crucially, the underlying language and vision models remain frozen; the probe only learns the mapping. Visual features are extracted using a Faster R-CNN trained on Visual Genome, covering 1,600 object categories. The probe is trained using InfoNCE loss, encouraging high similarity scores for matching text-image pairs while distinguishing them from "distractor" images in the same batch.

Key Insights: The Power of Context

The most significant finding is that context is what allows LMs to "see." When surrounding words in a sentence are masked, BERT's ability to retrieve specific images drops to the level of non-contextual models like GloVe. Adjectives such as "black" or "tabby" provide the crucial information that aligns a word with its visual reality.

Retrieval examples demonstrating how the model distinguishes between specific instances, such as black cats versus tabby cats, based on textual context.

Furthermore, the probe demonstrated zero-shot alignment, retrieving images for object categories it had never seen during training. This suggests that the internal latent space of language models is naturally structured in a way that mirrors the visual world. Interestingly, models explicitly trained on both images and text (like LXMERT or ViLBERT) only slightly outperformed text-only models, suggesting that a vast amount of "visual" knowledge is already baked into the statistics of pure text.

Experimental Results

The study utilized MS-COCO and Flickr30k datasets for evaluation. Key performance metrics include:

  • Category Accuracy: All examined LMs (BERT, RoBERTa, T5, ALBERT) were excellent at identifying the correct object category, achieving 84-90% Category Recall.
  • Instance Accuracy: BERT-base achieved an Instance Recall (IR@1) of 12.0% and a top-5 recall of 36.0%. While lower than human performance, this is more than double the performance of non-contextual GloVe (5.1% IR@1).
  • The Human Gap: Despite impressive performance, models still lag behind humans, who achieved 76% accuracy in instance retrieval compared to the best model's 53%.

Conclusion and Future Work

While LMs encode visual signals, they are far from "understanding" the world in a human sense. The mapping is a probe—it shows the information exists within the model, but not necessarily that the LM uses it for downstream reasoning. Future work could explore injecting this visual "common ground" into LMs during pre-training or using these insights to build multimodal systems that understand the contextual nuances of the real world.

Summary updated

BibTeX
@inproceedings{ilharco2021probing,
  author = {Gabriel Ilharco and Rowan Zellers and Ali Farhadi and Hannaneh Hajishirzi},
  title = {{Probing Contextual Language Models for Common Ground with Visual Representations}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.422},
}
Figure