NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

BERT Can See Out of the Box: On the Cross-modal Transferability of Text Representations

Thomas Scialom, Patrick Bordes, Paul-Alexis Dray, Jacopo Staiano, patrick gallinariarXiv 2020

Abstract

Pre-trained language models like BERT have revolutionized NLP, but their multi-modal variants typically require extensive pre-training on massive aligned image-text datasets. This paper evaluates the visual capabilities of BERT "out-of-the-box," avoiding expensive multi-modal pre-training. We introduce BERT-gen, a BERT-based architecture for Visual Question Generation (VQG). Our results demonstrate an innate capacity for BERT-gen to adapt to multi-modal data and text generation, achieving state-of-the-art performance on established benchmarks by leveraging the semantic abstractions already present in textual representations.

Introduction

Recent advances in "Vision-and-Language" tasks have been dominated by models like ViLBERT or VisualBERT, which bridge modalities through computationally intensive pre-training. We ask a fundamental question: Does BERT already "know" enough about the world from text alone to understand images? We explore this through Visual Question Generation (VQG), a task that requires generating natural language questions based on visual input. This is a rigorous test for BERT, as it was natively designed as an encoder and has never seen visual data during its initial training.

Methodology: The BERT-gen Architecture

BERT-gen adapts the standard BERT-base model for multi-modal text generation using a simple yet effective framework.

Visual Representation and the Linear Bridge

To feed images into BERT, we treat them as sequences of "visual words." Using a pre-trained Faster R-CNN, we extract the 36 most salient regions from an image. Each region is represented by a 2048-dimensional feature vector and 4-dimensional spatial coordinates. These vectors are mapped into BERT’s 768-dimensional embedding space via a single linear projection layer ($W$). This simple bridge is the only structural addition to the model.

Figure 1: The BERT-gen architecture. Visual tokens (image regions) and textual tokens are embedded into a shared space and processed by BERT's encoder layers.

From Encoder to Generator

To enable text generation, we employ two primary modifications:

  1. The [MASK] Trick: During inference, we append a [MASK] token to the input. BERT predicts the word for that mask, which is then appended to the sequence to predict the next word iteratively.
  2. Causal Attention Masking: We implement a "left-to-right" attention mask for the generated portion of the sequence, preventing the model from attending to future tokens during training.

Training Strategy

We utilize a three-step curriculum to align the modalities:

  • Step 1 (Caption only): Train the model to generate questions from text captions.
  • Step 2 (Image only): Freeze BERT’s weights and train only the linear projection layer to map images into the established "caption space."
  • Step 3 (Image + Caption): Fine-tune the entire multi-modal system.

Experimental Results

BERT-gen was evaluated on the VQA 1.0 and VQG-COCO datasets, achieving significant gains over previous state-of-the-art (SOTA) models like MDN-Joint.

Table 1: Performance of BERT-gen on the VQA 1.0 dataset. The curriculum training (Step 3) achieves a CIDEr score of 44.99, significantly outperforming previous SOTA models.

As shown in Table 1, the full multi-modal fine-tuning (Step 3) reached a CIDEr score of 44.99 on VQA 1.0, compared to the previous SOTA of 33.1. On the VQG-COCO dataset, the model achieved a CIDEr of 77.70. Human evaluations further confirmed the model's efficacy, with readability scores (4.89/5) nearly indistinguishable from human-written questions.

Discussion: Semantic Universality

The most striking finding is the semantic universality of BERT’s representations. The semantic space BERT constructed for language is structurally similar enough to visual features that a simple linear mapping can align them. Furthermore, BERT’s attention mechanisms, trained only on text, naturally transfer to images, allowing the model to attend to relevant visual regions as if they were words in a sentence.

Conclusion

BERT-gen demonstrates that the "heavy lifting" of understanding world semantics is largely accomplished during language-only pre-training. By leveraging this innate capacity, we can achieve state-of-the-art multi-modal performance without the need for expensive, large-scale aligned pre-training. Future work will investigate whether this transferability extends to other transformer architectures and more complex reasoning tasks.

Summary updated

BibTeX
@misc{scialom2020bert,
  author = {Thomas Scialom and Patrick Bordes and Paul-Alexis Dray and Jacopo Staiano and patrick gallinari},
  title = {{BERT Can See Out of the Box: On the Cross-modal Transferability of Text Representations}},
  year = {2020},
  eprint = {2002.10832},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.10832},
}
Figure