Rethinking Pruning for Vision-Language Models: Strategies for Effective Sparsity and Performance Restoration
Shwai He1,, Ang Li2,, Tianlong Chen2
1 University of Maryland, College Park (CASE Lab) Β Β |Β Β 2 University of North Carolina at Chapel Hill
* Equal Contribution
π Paper (arXiv) | π Project Page | π» Code & Checkpoints
- β¨ Key Contributions
- π Core Insights & Findings
- π οΈ Methodology: RESSA & SparseLoRA
- π Benchmark Results
- βοΈ Installation & Environment Setup
- π Dataset Preparation
- π Quickstart & Usage
- π Citation
- π Acknowledgments
- First Systematic Study on Cross-Modality Sparsity Allocation: We explore how to balance sparsity ratios across visual encoders (e.g., EVA-CLIP ViT) and large language models (e.g., Flan-T5, Vicuna) in Vision-Language Models (VLMs).
- Empirical Sparsity Laws:
- Under an equal sum of sparsity ratios, pruning vision and language models with identical sparsity ratios yields near-optimal multimodal performance.
- When pruning a target fraction of total model parameters, focusing sparsity primarily on the language component (which accounts for ~80%+ of parameters) significantly outperforms aggressive vision pruning.
- RESSA (Repair Sparse Vision-Language Models): A post-pruning cross-modality recovery framework that aligns visual and linguistic representations via lightweight cross-attention distillation and multi-task tuning.
- SparseLoRA: A zero-latency fine-tuning technique that applies structured binary masks to Low-Rank Adaptation (LoRA) weight updates, enabling direct weight merging into sparse base models without incurring dense latency overhead during inference.
When maintaining a constant sum of sparsity ratios between the Vision model (
Figure 1: Performance comparison across different combinations of vision and language sparsity ratios under a fixed total sparsity budget.
Because language decoders comprise the vast majority of parameters in modern VLMs (e.g., 3B+ in Flan-T5-XL vs. 1B in EVA-CLIP ViT), pruning the language backbone preserves critical visual-perceptual representations while drastically cutting model size and compute.
Figure 2: Performance breakdown when pruning vision-only, language-only, or both modalities across varying sparsity ratios.
Post-pruning damage in VLMs primarily stems from cross-modal misalignment. RESSA (REpair Sparse Vision-Language Models via Cross-Modality Adaptation) restores representation alignment by optimizing multi-task knowledge distillation and cross-attention adaptation.
Figure 3: Overview of the RESSA post-pruning adaptation framework.
Standard LoRA updates
This guarantees zero additional runtime serving latency and preserves structural hardware acceleration.
Figure 4: SparseLoRA applies binary structural masks to LoRA updates, enabling seamless merging into sparse base weights.
The "Prune and then RESSA" paradigm delivers consistent, substantial gains across multimodal architectures (InstructBLIP, LLaVA) and benchmarks (VQAv2, OK-VQA, GQA, TextVQA, NoCaps, POPE).
Figure 5: Performance restoration of RESSA across multiple pruning algorithms and downstream VLM benchmarks.
| Method | Sparsity ( |
VQAv2 (Acc β) | OK-VQA (Acc β) | GQA (Acc β) | TextVQA (Acc β) | NoCaps (CIDEr β) |
|---|---|---|---|---|---|---|
| Dense Baseline | 0% / 0% | 65.20 | 45.60 | 49.50 | 42.30 | 118.2 |
| Magnitude | 50% / 50% | 48.10 | 32.40 | 36.80 | 28.50 | 78.4 |
| Wanda | 50% / 50% | 57.30 | 39.10 | 43.20 | 35.80 | 98.6 |
| SparseGPT | 50% / 50% | 58.40 | 40.20 | 44.10 | 36.50 | 101.3 |
| DSnoT | 50% / 50% | 59.10 | 40.90 | 44.80 | 37.10 | 103.5 |
| RESSA + SparseLoRA (Ours) | 50% / 50% | 63.80 | 44.20 | 48.10 | 40.90 | 114.7 |
git clone https://github.com/shwai-he/VLM-Compression.git
cd VLM-Compressionconda create -n vlm_comp python=3.9 -y
conda activate vlm_comp# Install PyTorch with CUDA 11.8 / 12.1 support
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
# Install repository requirements
pip install -r requirements.txt
# Install LAVIS in editable mode
pip install -e .Download the evaluation and pretraining datasets following the LAVIS setup guidelines:
# Navigate to LAVIS download directory
cd lavis/datasets/download_scripts
# Download VQAv2, OK-VQA, GQA, TextVQA, NoCaps, and Flickr30k
python download_vqa.py
python download_gqa.py
python download_coco.py
python download_flickr30k.py
cd ../../..# 50% Wanda Pruning across Vision & Language
sh scripts/T5/wanda.sh
# SparseGPT Pruning
sh scripts/T5/sparsegpt.sh
# DSnoT Pruning
sh scripts/T5/dsnot.sh# 50% Wanda Pruning on Vicuna-7B
sh scripts/Vicuna/wanda.sh
# DSnoT Pruning on Vicuna-7B
sh scripts/Vicuna/dsnot.shTrain with cross-modality adaptation and SparseLoRA:
# Run RESSA adaptation on InstructBLIP-FlanT5-XL
sh scripts/T5/train.sh
# Run RESSA adaptation on InstructBLIP-Vicuna-7B
sh scripts/Vicuna/train.shEvaluate pruned and restored checkpoints across benchmark tasks:
# Evaluate Flan-T5 model on OKVQA, GQA, NoCaps, VQAv2, and Flickr30k
sh scripts/T5/evaluate.sh
# Evaluate Vicuna model
sh scripts/Vicuna/evaluate.shIf you find our work, codebase, or findings helpful in your research, please consider citing:
@inproceedings{he2024rethinking,
title={Rethinking Pruning for Vision-Language Models: Strategies for Effective Sparsity and Performance Restoration},
author={He, Shwai and Li, Ang and Chen, Tianlong},
booktitle={arXiv preprint arXiv:2404.02424},
year={2024}
}
@misc{he2024ressa,
title={RESSA: Repair Sparse Vision-Language Models via Sparse Cross-Modality Adaptation},
author={Shwai He and Ang Li and Tianlong Chen},
year={2024},
eprint={2404.02424},
archivePrefix={arXiv},
primaryClass={cs.CV}
}This repository is built on top of Salesforce LAVIS, Wanda, and SparseGPT. We thank the authors for their open-source contributions.