TRIPS: Efficient Vision-and-Language Pre-training with Text-Relevant Image Patch Selection

Chaoya Jiang, Haiyang Xu, Chenliang Li, Ming Yan, Wei Ye, Shikun Zhang, Bin Bi, Songfang Huang

Introduction

Vision Transformers (ViTs) have revolutionized multi-modal tasks, yet they impose a significant computational burden. The self-attention mechanism in ViTs possesses quadratic complexity relative to sequence length, making the processing of high-resolution images computationally expensive. While previous attempts to accelerate ViTs focused on visual saliency—pruning patches based on purely visual importance—these methods often fail in Vision-Language (VL) contexts where "importance" is defined by the accompanying text.

TRIPS (Text-Relevant Image Patch Selection) addresses this gap by introducing a text-aware pruning mechanism. By intelligently selecting and fusing image patches mid-way through the visual backbone based on linguistic context, TRIPS achieves a 40.98% speedup over existing benchmarks like ALBEF without sacrificing accuracy.

The TRIPS Architecture

The core innovation of the model is the Text-Relevant Patch Selection layer, integrated directly into the visual backbone (ViT-TRIPS). Unlike standard ViTs that process all patches through every layer, TRIPS reduces the sequence length at specific intervals.

Text-aware Dynamic Attention (TD-ATT)

To determine which patches are relevant, the model employs the TD-ATT module. It uses the [CLS] token from the text encoder as a "query" to calculate attention scores for all image patches. This ensures that the model retains visual information specifically required to satisfy the linguistic input, such as answering a specific question or verifying a statement.

Visualization of the patch selection mechanism, demonstrating the reduction of the image sequence length.

Inattentive Token Fusion (ITF)

Rather than simply discarding "unimportant" patches, TRIPS utilizes Inattentive Token Fusion. The patches not selected for the top-$k$ set are weighted and fused into a single "fused token." This preserves a summarized global context, acting as a safety net to prevent the total loss of background information that might be secondary but still useful for the final multi-modal fusion.

Experimental Results

TRIPS was pre-trained on a standard 4M image-text pair dataset (including MSCOCO, Visual Genome, and Conceptual Captions) and evaluated across several downstream tasks, including VQA v2.0, NLVR2, and Image-Text Retrieval.

Performance and Efficiency

The model demonstrated remarkable efficiency gains. It reduced FLOPs from 36.63G to 20.89G while actually improving performance on key metrics. For instance, on the VQA test-dev set, TRIPS achieved a score of 76.23, outperforming heavier models like VinVL (75.95) and the baseline ALBEF (74.54).

Text-aware patch selection in a VQA context, where the model prunes irrelevant background to focus on task-specific entities.

Latency and Resolution

Inference latency was reduced to just 11ms, a significant drop from the 21ms required by the baseline. Furthermore, the efficiency of TRIPS allows for "resolution reinvestment": the model can process higher-resolution images (456x456) at the same computational cost as a standard model at 384x384, leading to superior feature extraction and reasoning capabilities.

Conclusion

TRIPS proves that visual redundancy in multi-modal tasks is context-dependent. By using text as a filter, the model can discard 30-50% of image patches without losing critical information. This approach not only accelerates training and inference but also enables the use of higher-resolution inputs within the same computational budget. Future work may explore dynamic keep rates to further optimize pruning based on image complexity.

Summary updated

BibTeX
@inproceedings{jiang2022trips,
  author = {Chaoya Jiang and Haiyang Xu and Chenliang Li and Ming Yan and Wei Ye and Shikun Zhang and Bin Bi and Songfang Huang},
  title = {{TRIPS: Efficient Vision-and-Language Pre-training with Text-Relevant Image Patch Selection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.273},
}
Figure