ECoFLaP: Efficient Coarse-to-Fine Layer-Wise Pruning for Vision-Language Models

Yi-Lin Sung, Jaehong Yoon, Mohit Bansal

TL;DR

ECoFLaP introduces a two-stage "coarse-to-fine" pruning strategy that adaptively sets layer-wise sparsity ratios for Large Vision-Language Models (LVLMs). By leveraging a memory-efficient zeroth-order gradient approximation to gain a global perspective, it significantly outperforms existing one-shot pruning methods while reducing GPU memory usage by up to 40% compared to first-order alternatives.

The "Goldilocks" Dilemma in Model Pruning

Large Vision-Language Models (LVLMs) like BLIP-2 are powerful but computationally exorbitant, making them difficult to deploy on edge devices. To shrink them, researchers use pruning—removing less important weights.

However, current pruning methods face a dilemma:

  1. Global Pruning is accurate because it considers the whole model, but it's computationally "too hot" (expensive), requiring the calculation of massive Hessian matrices.
  2. Layer-wise Pruning is "too cold" (suboptimal); it's fast because it prunes each layer in isolation, but it's "blind" to the rest of the model. It typically applies a uniform sparsity ratio (e.g., 50% across all layers), which ignores the fact that some layers are far more critical than others.

This is especially problematic for multimodal models. There is a massive imbalance in weight magnitudes and gradients between the vision and language modules, making a "one-size-fits-all" sparsity ratio highly ineffective.

Imbalance of magnitude and gradient distributions between vision and language modules.

ECoFLaP: Bridging the Gap

The authors propose ECoFLaP (Efficient Coarse-to-Fine Layer-Wise Pruning), which bridges the gap between global and local pruning in two distinct stages:

  1. Coarse Step (Global Strategy): Instead of guessing sparsity ratios, ECoFLaP determines an adaptive ratio for each layer based on its global importance. To keep this efficient, they use a zeroth-order approximation of gradients. Instead of expensive backpropagation, they perturb the weights with Gaussian noise and measure the change in the loss function.
  2. Fine Step (Local Execution): Once the optimal sparsity ratios are set (e.g., Layer A gets 30% sparsity, Layer B gets 70%), the model performs unstructured pruning layer-by-layer using existing efficient techniques like Wanda or SparseGPT.

Key Insights and Results

The researchers validated ECoFLaP across a wide array of benchmarks, including multimodal tasks (VQAv2, OK-VQA, GQA), unimodal vision (ImageNet-1k), and unimodal NLP (MMLU, WikiText) using models like BLIP-2, LLaMA-7B, and EVA-ViT.

  • Global Context is King: The core insight is that even a rough (zeroth-order) estimate of global importance is better than no global information at all. By letting the model "decide" which layers can afford to be sparse, performance stays high even at 60% total sparsity.
  • Modality Sensitivity: The vision encoder in LVLMs is often more sensitive to pruning than the language backbone. ECoFLaP naturally discovers this, allocating lower sparsity to the vision modules to preserve performance.
  • Superior Performance: On BLIP-2 at 50% sparsity, ECoFLaP achieved a macro average score of 58.0, outperforming the popular Wanda method (57.2) and SparseGPT (57.4). The performance gap widens at higher sparsity; at 60% sparsity on VQA tasks, ECoFLaP outperformed Wanda by a relative 9.6%.
  • Memory Savings: Computing gradients via forward passes only is a massive win for memory. It avoids caching intermediate activations, reducing GPU memory usage by 40% compared to first-order gradient estimation methods.

Limitations and Future Work

  • Hyperparameter Tuning: The method introduces a hyperparameter to prevent "layer collapse" (where a layer is pruned so much it breaks the model). While the authors found a stable default, it remains a manual setting.
  • Unstructured Focus: This paper focuses on unstructured pruning (removing individual weights). While great for theoretical compression, it requires specialized hardware/software to see actual wall-clock speedups. Future work could extend this coarse-to-fine logic to structured pruning (removing entire neurons or channels).

Summary updated

BibTeX
@inproceedings{sung2024ecoflap,
  author = {Yi-Lin Sung and Jaehong Yoon and Mohit Bansal},
  title = {{ECoFLaP: Efficient Coarse-to-Fine Layer-Wise Pruning for Vision-Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=iIT02bAKzv},
}
Figure