XDBERT: Distilling Visual Information to BERT from Cross-Modal Systems to Improve Language Understanding

Chan-Jan Hsu, Hung-yi Lee, Yu Tsao

Introduction

Standard language models like BERT, RoBERTa, and ELECTRA are essentially "blind." They are trained exclusively on massive text corpora, missing the multimodal nature of human language acquisition. Humans learn what a "ball" is by seeing one while hearing the word. XDBERT addresses this gap by distilling visual knowledge from pretrained multimodal systems like CLIP into text-only encoders. This "visual grounding" helps models understand language better, even on purely textual benchmarks like GLUE.

Conceptual overview of visual grounding where text and images converge to define a concept like "Bird".

The XDBERT Framework

The core challenge is efficiently transferring visual grounding captured by large-scale multimodal models (like CLIP) into standard text-only encoders without the computational burden of full multimodal pretraining.

The "Visual Proxy" Insight

CLIP's text encoder (CLIP-T) is trained using a contrastive loss to match images with text descriptions. Consequently, CLIP-T produces embeddings that are mathematically similar to the embeddings of corresponding images. XDBERT leverages CLIP-T as a "visual proxy," allowing the model to distill visual features without ever processing raw images during the adaptation phase.

The Adaptation Phase

The researchers introduce a brief "adaptation" phase (typically 1 epoch on Wiki103) that bridges a standard language model with the visually-grounded CLIP-T using a cross-modal encoder.

The XDBERT pipeline: Pretraining of individual models, the Adaptation phase using a cross-modal encoder, and final Finetuning on downstream tasks.

The adaptation involves three key tasks:

  1. Joint Masked Language Modeling (MLM): The model predicts missing words using both its own context and the "visual" context from CLIP-T.
  2. Same Sentence Prediction (MATCH): A binary classification task to determine if the BERT and CLIP-T input streams represent the same sentence.
  3. CLIP Token Classification (CLIPTC): The model predicts original tokens from the CLIP-T side, ensuring the cross-modal encoder doesn't ignore visual nuances.

After adaptation, the CLIP-T and cross-modal components are discarded. The resulting XDBERT model maintains the original BERT parameter count, serving as a "drop-in" replacement with no additional inference cost.

Evaluation and Results

XDBERT was evaluated on standard NLU benchmarks including GLUE, SWAG (common-sense reasoning), and READ (linguistic complexity).

  • Performance Gains: XDBERT-base consistently outperformed BERT-base, notably achieving a +2.88 point improvement on the Recognizing Textual Entailment (RTE) task. The method also successfully improved modern ELECTRA models.
  • Inductive Bias: Improvements were most pronounced on smaller datasets (e.g., RTE, MRPC), suggesting that visual information provides a helpful inductive bias when text data is scarce.
  • Visual Verification: Analysis using MSCOCO showed that sentences where XDBERT outperformed BERT contained a higher proportion of "visually grounded" words (colors, shapes, objects), confirming the model utilizes its distilled visual knowledge.

Insights and Future Work

A critical finding was the necessity of the CLIPTC task; without it, the model tends to find textual shortcuts rather than learning diverse visual representations. While CLIP-T is a powerful visual proxy, it is a relatively weak linguist compared to BERT. Future research could explore more linguistically capable multimodal teachers or scaling this distillation process to massive decoder-only Large Language Models (LLMs).

Summary updated

BibTeX
@inproceedings{hsu2022xdbert,
  author = {Chan-Jan Hsu and Hung-yi Lee and Yu Tsao},
  title = {{XDBERT: Distilling Visual Information to BERT from Cross-Modal Systems to Improve Language Understanding}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-short.52},
}
Figure