Probing Contextualized Sentence Representations with Visual Awareness

Zhuosheng Zhang, Rui Wang, Kehai Chen, Masao Utiyama, Eiichiro Sumita, Hai ZhaoarXiv 2019

Introduction

Modern Natural Language Processing (NLP) models, such as BERT and standard Transformers, primarily learn representations from massive text corpora. While effective, these models lack the rich, real-world grounding that humans derive from visual perception. Existing visual-linguistic (VL) models attempt to bridge this gap but are often limited by their reliance on manually annotated text-image pairs, which are scarce for most standard NLP tasks.

This paper introduces a universal framework to inject "visual awareness" into text-only models without requiring task-specific multimodal datasets. By leveraging a pre-trained cross-modal retriever, the model fetches relevant visual context for any given sentence, enhancing performance across tasks like machine translation, natural language inference, and sequence labeling.

Methodology

The proposed framework consists of three primary stages: cross-modal retrieval pre-training, image fetching, and multi-modal integration.

Cross-Modal Retrieval Pre-training

To bridge the gap between text and vision, the authors first train a retrieval model on a large-scale text-image dataset. This model maps sentences and images into a shared embedding space.

Cross-modal retrieval pre-training using triplet loss.

The training utilizes a triplet loss function, ensuring that a sentence and its corresponding image are closer in the embedding space than unrelated pairs. This creates a "visual knowledge base" that can be queried during downstream tasks.

Image Fetching and Integration

For any input sentence in a text-only task, the model queries the shared embedding space to retrieve the top 8 most relevant images. These images provide topical hints and visual context, even if they do not perfectly match the sentence's exact semantic content.

The proposed visual-aware framework for text-only NLP tasks.

The retrieved images are processed by a pre-trained ResNet, and a one-layer multi-head attention mechanism fuses these visual representations into the text representations generated by a standard Transformer encoder. The resulting visually-aware hidden states are then passed to task-specific layers.

Experimental Evaluation

The framework was evaluated on several benchmark datasets, including MS-COCO for pre-training, WMT benchmarks for translation, SNLI for inference, and CoNLL-2003 for sequence labeling.

Key Results

The addition of visual awareness (+VA) consistently outperformed baseline models:

  • Machine Translation: BLEU scores improved from 32.66 to 34.63 (+1.97) on EN-RO and from 27.31 to 27.83 (+0.52) on EN-DE.
  • Natural Language Inference: BERT (Base) accuracy on SNLI increased from 90.7% to 91.2%.
  • Sequence Labeling: BERT (Base) F1 score on CoNLL-2003 rose from 91.21% to 91.46%.

Discussion and Insights

A key finding is that visual grounding can be achieved in a "zero-shot" manner for downstream tasks. The model does not require task-specific images; instead, it uses the generalized cross-modal space to find relevant visual cues. Furthermore, the model demonstrates "concept localization," successfully linking specific linguistic concepts to corresponding regions in the retrieved images.

While the retrieval step introduces some computational overhead and occasionally fetches loosely related images, the consistent performance gains suggest that visual context acts as a powerful regularizer for sentence modeling.

Conclusion

This work demonstrates that visual awareness can significantly enhance text-only NLP models. By decoupling visual grounding from the need for parallel multimodal corpora, the authors provide a scalable and universal framework for building more robust, visually-grounded language representations.

Summary updated

BibTeX
@misc{zhang2019probing,
  author = {Zhuosheng Zhang and Rui Wang and Kehai Chen and Masao Utiyama and Eiichiro Sumita and Hai Zhao},
  title = {{Probing Contextualized Sentence Representations with Visual Awareness}},
  year = {2019},
  eprint = {1911.02971},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.02971},
}
Figure