Cross-Modal Retrieval Augmentation for Multi-Modal Classification

Shir Gur, Natalia Neverova, Christopher Stauffer, Ser-Nam Lim, Douwe Kiela, Austin Reiter

Introduction

Traditional vision-and-language models operate as "parametric-only" systems, encoding vast amounts of knowledge directly into their neural weights during pre-training. While effective, this "closed-book" approach suffers from significant drawbacks: high computational costs for updating knowledge, a lack of interpretability regarding model decisions, and inherent scaling limits as global information expands.

To address these challenges, we present XTRA (X-modal Transformer Retrieval Augmentation), a framework that introduces an "open-book" philosophy to multi-modal classification. By retrieving relevant external text descriptions to augment visual inputs, XTRA enables models to leverage dynamic knowledge sources without the need for exhaustive re-training.

The XTRA Framework

The XTRA architecture consists of two primary components: a dense cross-modal retriever and a retrieval-augmented reader.

Dense X-modal Retriever (DXR)

The retrieval process begins with DXR, designed to align images and text within a shared embedding space. DXR utilizes a ResNet-152 backbone for visual features and a BERT model for textual features. Unlike standard dual-encoder architectures, DXR incorporates a shared Transformer layer with attention pooling to refine cross-modal alignment. The model is trained using a contrastive loss function enhanced by hard negative mining, ensuring it can distinguish between subtly different image-caption pairs.

Retrieval-Augmented Reader

Once trained, DXR serves as a search engine. For a given input (e.g., a VQA image), DXR generates an embedding used to perform a $k$-Nearest Neighbor search via the FAISS library against an external index of millions of image-caption pairs. The top $k$ retrieved captions are then concatenated with the original query and fed into a multi-modal transformer—such as VisualBERT or ViLBERT—to generate the final prediction.

The XTRA framework overview: from image/text query through the FAISS indexer to final multi-modal prediction.

Experimental Evaluation

The framework was evaluated across several benchmarks, including COCO (120k images), Flickr30k, and the large-scale Conceptual Captions (CC) dataset containing 3 million pairs.

Retrieval and Classification Performance

DXR demonstrated superior retrieval capabilities, achieving a Recall@1 of 44.9 on the COCO 5K test set, surpassing the VSE++ baseline. When integrated into classification pipelines, XTRA provided substantial gains. For instance, adding XTRA to VisualBERT increased its VQA score on the COCO validation set from 63.54 to 68.98. The state-of-the-art configuration (MoVie+MCAN + XTRA) reached a score of 73.12 on the VQA 2.0 test-std benchmark.

Accuracy vs. Number of Retrieved Captions: Performance trends for in-domain and out-of-domain retrieval.

Key Insights

  • Retrieval vs. Pre-training: Explicitly providing relevant examples at inference time often proves more effective than relying on knowledge stored in weights during pre-training.
  • Knowledge Hot-Swapping: The external index can be updated or swapped at test time. A model trained on one dataset can immediately leverage information from another (e.g., Conceptual Captions) to handle novel concepts.
  • The "Unplugged" Penalty: Removing the retrieval component at test time leads to a significant drop in performance, indicating that the reader model actively learns to utilize the augmented text.

Conclusion and Future Work

XTRA demonstrates that retrieval augmentation is a powerful and flexible alternative to purely parametric multi-modal models. While scaling to massive, noisy indices like Conceptual Captions presents challenges, the ability to audit and update a model's knowledge source offers a path toward more interpretable and adaptable AI. Future research will focus on verification processes to ensure the factual accuracy of retrieved data and exploring retrieval for specialized domains.

Summary updated

BibTeX
@inproceedings{gur2021cross,
  author = {Shir Gur and Natalia Neverova and Christopher Stauffer and Ser-Nam Lim and Douwe Kiela and Austin Reiter},
  title = {{Cross-Modal Retrieval Augmentation for Multi-Modal Classification}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.11},
}
Figure