CrossGET: Cross-Guided Ensemble of Tokens for Accelerating Vision-Language Transformers

Dachuan Shi, Chaofan Tao, Anyi Rao, Zhendong Yang, Chun Yuan, Jiaqi Wang

TL;DR

CrossGET (Cross-Guided Ensemble of Tokens) is a novel framework that dramatically accelerates Vision-Language Transformers by merging redundant tokens in real-time. By leveraging "cross tokens" as proxies to enable bidirectional guidance between modalities and utilizing a new parallelizable matching algorithm, it achieves up to a 330% throughput improvement with negligible impact on model accuracy.

Overview of the CrossGET framework, its integration into Vision-Language Transformers, and performance examples.

The Challenge: Multimodal Dependency

Vision-Language Transformers (VLTs) like CLIP, BLIP2, and LLaVA have set new benchmarks in AI, but their computational appetite is voracious. The cost of a Transformer scales quadratically with the number of input tokens, making real-time inference expensive and inaccessible for resource-constrained devices.

While "token reduction" (removing or merging less important data points) has worked well for unimodal models (vision-only or text-only), multimodal models present a unique challenge: modality dependency. In many state-of-the-art models, the vision encoder processes the image before the language model sees the text. This creates a "dependency paradox"—how can the model use language information to decide which visual tokens are redundant if the language processing hasn't even started yet?

The CrossGET Solution

To solve the efficiency-performance trade-off, the authors introduce two primary innovations:

Detailed illustration of cross tokens incorporation and the cross-guided matching and ensemble process.

1. Cross-Guided Matching and Ensemble

To break the calculation dependency, CrossGET injects learnable "cross tokens" into both the vision and language branches. These tokens act as proxies; through a specialized loss function (Jensen-Shannon divergence), they learn to represent the "essence" of the other modality.

This allows the vision encoder to "peek ahead" at the language context to decide which parts of an image are most relevant to the text, and vice versa. Unlike simple pruning (which just deletes tokens), CrossGET uses an ensemble approach, combining redundant tokens into a single weighted representation to preserve as much information as possible.

2. Complete-Graph Soft Matching (CGSM)

Previous state-of-the-art methods (like ToMe) used bipartite matching, which splits tokens into two sets and only looks for matches between them. CrossGET proposes a "complete-graph" approach that considers the similarity between all pairs of tokens.

To keep this computationally efficient and parallelizable, they use a clever 5-step algorithm involving a "lower triangle dependency mask." This prevents circular merging and ensures the process can run fast on modern GPUs. Probabilistic analysis shows that this complete-graph matching has a significantly higher expectation of finding the "optimal" token to merge compared to bipartite methods.

Key Results and Performance

The framework was rigorously tested across a wide variety of tasks, including Image-Text Retrieval (Flickr30K), Visual Reasoning (NLVR2), Image Captioning (COCO), VQA, and Multimodal LLM Benchmarks (LLaVA-1.5 suite).

CrossGET demonstrates impressive "Pareto-superior" performance across the board:

  • CLIP (Retrieval): Achieved a 57% throughput increase and 42% GFLOPs reduction with zero loss in Recall@1.
  • BLIP2 (Captioning): For the generation phase, it saved 86% of GFLOPs and improved throughput by 330%.
  • LLaVA-1.5 (Multimodal LLM): Nearly doubled the throughput of the model forward pass while maintaining over 98% of the original model's performance.
  • Versatility: It works effectively on both modality-independent models (where vision and text are processed in parallel) and modality-dependent models (where one follows the other).

Limitations and Future Work

While CrossGET is highly effective, the authors note a few areas for further exploration:

  • Interleaved Sequences: The current framework is optimized for single image-text pairs. Extending this to "interleaved" inputs (multiple images and text snippets in a long conversation, like Flamingo) would require more complex cross-fragment guidance.
  • Training Requirement: While CrossGET can be used "off-the-shelf" without tuning, the best results come from a small amount of fine-tuning to let the cross tokens learn the modality proxies.
  • Fine-Grained Detail: In extremely dense scenes where every token might be unique and essential, any merging strategy will eventually hit a performance ceiling.

The code is open-sourced at: https://github.com/sdc17/CrossGET

Summary updated

BibTeX
@inproceedings{shi2024crossget,
  author = {Dachuan Shi and Chaofan Tao and Anyi Rao and Zhendong Yang and Chun Yuan and Jiaqi Wang},
  title = {{CrossGET: Cross-Guided Ensemble of Tokens for Accelerating Vision-Language Transformers}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=CSIfCpXhCF},
}
Figure