TaCA: Upgrading Your Visual Foundation Model with Task-agnostic Compatible Adapter

Binjie Zhang, Yixiao Ge, Xuyuan Xu, Ying Shan, Mike Zheng ShouarXiv 2023 · DOI

Abstract

Visual foundation models (VFMs) like CLIP have become the backbone of modern AI systems, serving as frozen feature extractors for a multitude of downstream tasks. However, upgrading to a more powerful VFM typically necessitates a "cold-plugging" process, where every downstream module must be retrained from scratch to accommodate the new model's unique latent space. We introduce TaCA (Task-agnostic Compatible Adapter), a novel "hot-plugging" paradigm that enables seamless model upgrades. By utilizing a parameter-efficient, task-agnostic adapter, TaCA aligns a new model's features with the existing system's latent space. This approach delivers immediate performance gains across diverse applications—including video retrieval, classification, and multimodal LLMs—with zero downstream retraining.

The Challenge of Model Evolution

In the current modular AI landscape, foundation models are rarely used in isolation. Instead, they act as the "engine" for complex systems, providing features to specialized downstream modules like video decoders or language model connectors.

The 'hot-plugging' paradigm. TaCA allows upgrading the upstream foundation model while keeping downstream modules for video retrieval, classification, and VQA frozen and compatible.

The release of a superior foundation model (e.g., moving from CLIP-ViT-B to ViT-H) presents a significant bottleneck. Because the new model's internal representations differ from the old one, the entire system must undergo a "cold-plugging" upgrade: retraining every downstream head to understand the new feature set. As the variety of downstream tasks grows, this retraining becomes prohibitively expensive. TaCA addresses this by allowing for a "hot-plugging" upgrade, where the foundation model is swapped without rebuilding the rest of the system.

Methodology: The Task-agnostic Compatible Adapter

TaCA achieves compatibility by inserting lightweight, trainable components into a frozen new foundation model. The goal is to make the new model's output "look like" the old model's output while retaining the superior representational power of the larger architecture.

TaCA training framework and architecture. Left: The dual training objectives (distillation and cross-modal contrastive loss) align the new visual encoder with the old model's latent space. Right: The internal structure of the bottleneck adapter and dimension projector.

Key Architectural Components

  • Bottleneck Adapters: These are small modules inserted into each Transformer block of the new model. They consist of a down-sampling layer, a non-linear activation function, and an up-sampling layer. These adapters learn to adjust the new model's internal features to match the expected distribution of the old model.
  • Dimension Projector: A two-layer Multi-Layer Perceptron (MLP) that ensures the output dimensionality of the new model matches that of the old one, allowing for direct replacement in downstream heads.

Dual Training Objectives

To ensure both feature compatibility and semantic integrity, TaCA is trained using two primary losses:

  1. Distillation Loss: This forces the new model's visual features to remain close to the old model's features in the latent space, ensuring the downstream modules can still interpret the data.
  2. Cross-modal Contrastive Loss: This aligns the new visual features with the old model's text features. This is critical for maintaining the zero-shot and cross-modal capabilities inherent in models like CLIP.

Crucially, TaCA is task-agnostic. It is trained once on a general-purpose dataset (LAION-400M) and can then be deployed across any number of downstream tasks without further modification.

Experimental Results

TaCA was evaluated across three major domains, consistently outperforming the original baseline models without any retraining of downstream components:

  • Video-Text Retrieval: Upgrading from a ViT-B/16 to a TaCA-enhanced ViT-H/14 resulted in a +5.1% improvement in R@1 on the MSR-VTT dataset.
  • Video Classification: On the Kinetics-400 benchmark, the same upgrade path yielded a +2.2% increase in top-1 accuracy.
  • Multimodal LLMs: When integrated into the OpenFlamingo framework as a visual tokenizer, TaCA-ViT-H/14 achieved a +0.6% improvement over the standard ViT-L/14 setup on VQAv2.

Beyond performance, TaCA is highly efficient, requiring the training of only approximately 10% of the total parameters of the new foundation model compared to a full fine-tuning approach.

Insights and Future Directions

The authors identified a "Generalization Paradox": training an adapter for a specific task often degrades its performance on others. TaCA avoids this by focusing purely on latent space alignment. While the gains are most significant when upgrading between models with a large capability gap (e.g., Base to Huge), the paradigm proves that compatibility is a vital metric for modular AI evolution.

Future work may explore applying similar "hot-plugging" techniques to text encoders or developing more advanced adapter architectures to further bridge the gap between model generations.

Summary updated

Abstract

Visual foundation models like CLIP excel in learning feature representations from extensive datasets through self-supervised methods, demonstrating remarkable transfer learning and generalization capabilities. A growing number of applications based on visual foundation models are emerging, including innovative solutions such as BLIP-2. These applications employ pre-trained CLIP models as upstream feature extractors and train various downstream modules to accomplish diverse tasks. In situations involving system upgrades that require updating the upstream foundation model, it becomes essential to re-train all downstream modules to adapt to the new foundation model, which is inflexible and inefficient. In this paper, we introduce a parameter-efficient and task-agnostic adapter, dubbed TaCA, that facilitates compatibility across distinct foundation models while ensuring enhanced performance for the new models. TaCA allows downstream applications to seamlessly integrate better-performing foundation models without necessitating retraining. We conduct extensive experimental validation of TaCA using different scales of models with up to one billion parameters on various tasks such as video-text retrieval, video recognition, and visual question answering. The results consistently demonstrate the emergent ability of TaCA on hot-plugging upgrades for visual foundation models. Codes and models will be available at https://github.com/TencentARC/TaCA.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
MSR-VTTViT-B/16 (old)R@1 text-to-video retrieval42.1backbone=ViT-B/16
Source quote
L343: \textcolor{gray}{ViT-B/16 (old)} │ \textcolor{gray}{-} │ \textcolor{gray}{42.1} │ \textcolor{gray}{40.2}
MSR-VTTTaCA-ViT-H/14R@1 text-to-video retrieval47.2params=400M · backbone=ViT-H/14
Source quote
L347: TaCA-ViT-H/14 │ LAION-400M │ {47.2} │ {45.7}
Kinetics-400TaCA-ViT-H/14top-1 video classification accuracy improvement+2.2\%backbone=ViT-B/16
Source quote
L36: For instance, by replacing the original ViT-B/16 with TaCA-ViT-H/14, performance improvements are observed on all ranges of benchmarks, i.e., +5.1% on MSR-VTT~\cite{MSRVTT:xu2016msr} retrieval, +2.2% on Kinetics-400~\cite{kay2017kinetics} classification. Our model (TaCA-ViT-H/14) achieves +0.6% improvement compared with OpenFlamingo benchmark (ViT-L/14) on VQAv2~\cite{VQAv2:goyal2017making}.
VQA v2 · VQAv2TaCA-ViT-H/14accuracy improvement+0.6\%params=2.7B · backbone=ViT-H/14
Source quote
L309: The results, as shown in Table~\ref{tab:exp-vqa}, indicate that the new foundation model equipped with TaCA achieves a +0.6% and +0.4% improvement compared to the original BLIP-2 model and the Flamingo model, respectively.
VQA v2 · VQAv2TaCA-ViT-H/14accuracy improvement+0.4\%params=9B · backbone=ViT-H/14
Source quote
L309: The results, as shown in Table~\ref{tab:exp-vqa}, indicate that the new foundation model equipped with TaCA achieves a +0.6% and +0.4% improvement compared to the original BLIP-2 model and the Flamingo model, respectively.
BibTeX
@misc{zhang2023taca,
  author = {Binjie Zhang and Yixiao Ge and Xuyuan Xu and Ying Shan and Mike Zheng Shou},
  title = {{TaCA: Upgrading Your Visual Foundation Model with Task-agnostic Compatible Adapter}},
  year = {2023},
  eprint = {2306.12642},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.12642},
}
Figure