Skip to main content
QUICK REVIEW

[Paper Review] LoopITR: Combining Dual and Cross Encoder Architectures for Image-Text Retrieval

Jie Lei, Xinlei Chen|arXiv (Cornell University)|Mar 10, 2022
Image Retrieval and Classification TechniquesComputer Science6 citations
TL;DR

LoopITR proposes a unified architecture that jointly trains dual and cross encoders for image-text retrieval via a looped distillation mechanism: the dual encoder provides hard negatives to the cross encoder, while the cross encoder's refined predictions distill back to improve the dual encoder. This joint training achieves state-of-the-art dual encoder performance on Flickr30K and COCO with minimal additional cost.

ABSTRACT

Dual encoders and cross encoders have been widely used for image-text retrieval. Between the two, the dual encoder encodes the image and text independently followed by a dot product, while the cross encoder jointly feeds image and text as the input and performs dense multi-modal fusion. These two architectures are typically modeled separately without interaction. In this work, we propose LoopITR, which combines them in the same network for joint learning. Specifically, we let the dual encoder provide hard negatives to the cross encoder, and use the more discriminative cross encoder to distill its predictions back to the dual encoder. Both steps are efficiently performed together in the same model. Our work centers on empirical analyses of this combined architecture, putting the main focus on the design of the distillation objective. Our experimental results highlight the benefits of training the two encoders in the same network, and demonstrate that distillation can be quite effective with just a few hard negative examples. Experiments on two standard datasets (Flickr30K and COCO) show our approach achieves state-of-the-art dual encoder performance when compared with approaches using a similar amount of data.

Motivation & Objective

  • To address the limitation of training dual and cross encoders separately, which hinders mutual performance gains.
  • To design an effective distillation objective that transfers knowledge from the more expressive cross encoder to the efficient dual encoder.
  • To investigate whether distillation with only a few hard negatives can significantly improve dual encoder performance.
  • To evaluate the impact of distillation timing—pre-training vs. fine-tuning—on retrieval performance.
  • To compare different teacher models (online, offline, momentum) for distillation in the context of image-text retrieval.

Proposed method

  • The model integrates a dual encoder and a cross encoder in a single network, with shared image and text encoders for efficiency.
  • Hard negatives are mined in-batch from the dual encoder’s contrastive scores and used to train the cross encoder.
  • Knowledge distillation is applied from the cross encoder’s matching scores to the dual encoder’s logits using a temperature-scaled soft label loss.
  • The distillation objective uses both image and text negatives to construct more informative teacher distributions, improving generalization.
  • An online teacher is used, eliminating the need for separate pre-training or model storage, reducing memory and computation costs.
  • Distillation is applied during both pre-training and fine-tuning stages to maximize performance gains.

Experimental results

Research questions

  • RQ1Can joint training of dual and cross encoders via a looped architecture improve retrieval performance compared to isolated training?
  • RQ2How effective is knowledge distillation from a cross encoder to a dual encoder when using only a few hard negatives?
  • RQ3Does the choice of teacher model (online, offline, momentum) significantly affect distillation performance in image-text retrieval?
  • RQ4Is distillation more effective when applied during pre-training, fine-tuning, or both stages?
  • RQ5Can a single, unified model with online distillation outperform existing state-of-the-art dual encoders with similar data and compute budgets?

Key findings

  • LoopITR achieves state-of-the-art dual encoder performance on Flickr30K and COCO, with R@1 of 89.6 and 94.5 respectively when using cross-encoder reranking.
  • Distillation with only four hard negatives (two image and two text) is sufficient to significantly improve dual encoder performance.
  • The online teacher performs best and eliminates the need for extra model storage or training, reducing both memory and computational cost.
  • Applying distillation in both pre-training and fine-tuning stages yields the highest performance gain, outperforming single-stage distillation.
  • The use of both image and text negatives in the distillation objective leads to more robust and informative soft labels than using only one modality.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.