Abstract
Pre-trained vision-language models (VLMs) have achieved impressive results in a range of vision-language tasks. However, popular VLMs usually consist of hundreds of millions of parameters which brings challenges for fine-tuning and deployment in real-world applications due to space, memory, and latency constraints. In this work, we introduce a distilling then pruning framework to compress large vision-language models into smaller, faster, and more accurate ones. We first shrink the size of a pre-trained large VLM and apply knowledge distillation in the vision-language pre-training stage to obtain a task-agnostic compact VLM. Then we propose a modal-adaptive pruning algorithm to automatically infer the importance of vision and language modalities for different downstream tasks and adaptively remove redundant structures and neurons in different encoders with controllable target sparsity. We apply our framework to train EfficientVLM, a fast and accurate vision-language model consisting of 6 vision layers, 3 text layers, and 3 cross-modal fusion layers, accounting for only 93 million parameters in total, which is 44.3% of the teacher model. EfficientVLM retains 98.4% performance of the teacher model and accelerates its inference speed by 2.2x. EfficientVLM achieves a large absolute improvement over previous SoTA efficient VLMs of similar sizes by a large margin on various vision-language tasks, including VQAv2 (+4.9%), NLVR2 (+5.6%), ITR (R@1 on TR +17.2%, on IR + 15.6% ) and COCO caption generation (CIDEr +6.5), demonstrating a large potential on training lightweight VLMs.
Introduction
Large-scale pre-trained vision-language models (VLMs) like CLIP and ALBEF have revolutionized multi-modal understanding. However, their massive parameter counts—often exceeding hundreds of millions—make them difficult to deploy in low-latency environments or on edge devices. Existing compression techniques often overlook the fact that vision and language modalities contribute differently depending on the specific task. EfficientVLM addresses this by introducing a "distilling then pruning" framework that creates compact, high-performance models tailored to task-specific modal importance.
The EfficientVLM Framework
The EfficientVLM framework consists of two primary stages: task-agnostic knowledge distillation during pre-training and modal-adaptive pruning during fine-tuning.
1. Task-agnostic Knowledge Distillation
To build a strong, compact foundation, the authors start with a large teacher model (X-VLM) and initialize a student model by selecting a subset of its layers. During a pre-training phase on 4 million image-text pairs, the student is trained to mimic the teacher's outputs. This includes matching logits, attention distributions, and hidden representations across layers, ensuring the student captures the complex cross-modal interactions of the larger model.
2. Modal-adaptive Pruning
During the fine-tuning stage for specific downstream tasks, the model undergoes modal-adaptive pruning. Using a differentiable approximation of $L_0$ regularization, the algorithm automatically learns which structures (neurons or attention heads) in the vision, text, or cross-modal encoders are redundant for the target task. This allows the architecture to adaptively "slim down" based on whether the task is more vision-heavy (like retrieval) or requires balanced reasoning (like NLVR2).
Experimental Results
EfficientVLM was evaluated against several benchmarks, demonstrating significant improvements in both efficiency and accuracy.
Efficiency and Performance
EfficientVLM contains 93 million parameters, representing only 44.3% of its teacher's size. Despite this reduction, it retains 98.4% of the teacher's performance and achieves a 2.2x inference speedup on CPU. Compared to previous efficient VLMs like MiniVLM, EfficientVLM shows dramatic improvements:
- VQAv2: +4.9% absolute improvement.
- NLVR2: +5.6% absolute improvement.
- Image-Text Retrieval (MSCOCO): +17.2% R@1 on text retrieval and +15.6% on image retrieval.
Modality Sensitivity and Sparsity
Empirical studies within the paper highlight that the vision encoder is generally more sensitive to pruning in retrieval tasks, while reasoning tasks like NLVR2 require both encoders to remain relatively dense. The modal-adaptive approach successfully navigates these requirements, allowing the model to be pruned up to 50% sparsity while maintaining over 95% of the teacher's performance.
Conclusion and Future Work
EfficientVLM proves that a staged approach of distillation followed by task-specific pruning can produce highly efficient VLMs without sacrificing accuracy. While the current work focuses on the X-VLM architecture, the principles of modal-adaptive pruning are likely generalizable to other Transformer-based models. Future research could integrate these methods with quantization or matrix decomposition to further enhance deployment capabilities on edge hardware.
Summary updated