CAP: Correlation-Aware Pruning for Highly-Accurate Sparse Vision Models

Denis Kuznedelev, Eldar Kurtic, Elias Frantar, Dan Alistarh

TL;DR

The Correlation-Aware Pruner (CAP) is a new framework that finally breaks the "compressibility barrier" for modern vision models like Vision Transformers (ViTs) and ConvNext. By accounting for complex weight correlations during the pruning process and using a specialized cyclic fine-tuning schedule, CAP can prune these models to 75-80% sparsity with less than a 1% drop in accuracy, enabling practical speedups of up to 2.4x.

What Problem Does This Paper Address?

In the world of computer vision, we’ve moved past the era of simple convolutional neural networks (CNNs) like ResNet50. Modern architectures—Vision Transformers (ViTs), ConvNext, and hybrids—achieve incredible accuracy but are massive and computationally expensive to deploy.

The "standard" way to fix this is pruning: removing redundant weights to make the model smaller and faster. However, researchers have found that these "next-generation" models are notoriously difficult to prune. While you can easily strip 80% of a ResNet50 without losing much accuracy, doing the same to a ViT usually results in a massive performance crash.

The authors identify two main culprits:

  1. Weight Correlations: Existing pruners treat weights as independent. In Transformers, weights are highly correlated; removing two "individually unimportant" weights might actually destroy a critical feature if they were mutually redundant.
  2. Expensive Recovery: These models are hard to train from scratch, and they are even harder to "heal" (fine-tune) after the trauma of pruning.

Methods

The authors introduce two primary "ingredients" to solve these issues:

1. The CAP Pruner (Correlation-Aware Pruning)

CAP is a second-order pruning method based on the Optimal Brain Surgeon (OBS) framework. OBS uses the Hessian (a matrix of second-order derivatives) to determine which weights to remove and how to adjust the remaining weights to compensate for the loss.

The "secret sauce" of CAP is how it handles the Empirical Fisher matrix (a proxy for the Hessian). Unlike previous methods that assume the matrix is diagonal (ignoring correlations) or process weights in a way that loses information, CAP reformulates the problem into a sparse regression task. It updates weights during the selection process, ensuring that the correlations between weights are preserved. For massive models (>1B parameters), they introduce FastCAP, which uses block-averaging to keep memory costs manageable.

2. Cyclic Fine-tuning

Pruning is usually done gradually. The authors found that the standard "cosine" learning rate schedule used in training doesn't work well for recovery. Instead, they propose a cyclic linear learning rate schedule. Every time the model is pruned further, the learning rate "jumps" back up, giving the model a high-energy boost to escape the sub-optimal state caused by the pruning, before cooling down to stabilize.

Cyclic learning rate schedule

Datasets

The primary benchmark used is ImageNet-1K, the gold standard for image classification. They also test the method on a variety of architectures, including:

  • ViT variants: DeiT (Tiny, Small, Base).
  • Modern CNNs: ConvNext, ResNet50-D, EfficientNetV2.
  • Hybrids: EfficientFormer, XCiT.
  • Large-scale models: The 1-billion parameter EVA ViT-G (pretrained via CLIP).

Key Insights and Ideas

  • Correlations are the Key: The authors visualize the Fisher matrix and show it has a "pronounced non-diagonal structure." This proves that weights in modern models are deeply interdependent. Ignoring these links is why previous pruners failed.
  • One-Shot vs. Gradual: CAP is so precise that even "one-shot" pruning (pruning a pre-trained model once without immediate fine-tuning) performs significantly better than other SOTA methods.
  • Orthogonality: CAP is "orthogonal" to other compression tricks. You can combine it with quantization (reducing bit-precision) or token pruning (removing redundant image patches) to get even smaller models without them interfering with each other.
  • The "Healing" Jump: The cyclic learning rate isn't just a heuristic; it’s theoretically justified. It ensures the model is well-optimized (small gradients) before the next pruning step, which is a core assumption of the OBS framework.

Key Results

  • High Sparsity, Low Loss: For DeiT-Small, CAP achieves 80% sparsity with only a 0.8% relative accuracy drop. Previous best-known results for similar models struggled to pass 50% sparsity.
  • Real-World Speedups: When run on a sparsity-aware CPU engine (DeepSparse), a 75%-sparse DeiT-Tiny model achieved a 2.4x speedup over the dense version with zero accuracy loss.
  • Scaling to Giants: They successfully pruned the 1-billion parameter EVA ViT-G to 70% sparsity in just 400 seconds on a single A100 GPU, maintaining a respectable 76.1% accuracy (compared to 88.7% dense).
  • Beating the Competition: CAP consistently outperformed other second-order methods like WoodFisher and M-FAC, especially at high sparsity levels (90%+).
CAP outperforms other methods on DeiT-Tiny

Limitations and Future Work

  • Compute Requirements: While "FastCAP" is efficient, estimating the Empirical Fisher for massive models still requires high-end hardware (2-4 A100 GPUs with 80GB VRAM).
  • Fine-tuning Time: To reach extreme sparsities (90%+), the model still requires a significant amount of fine-tuning (up to 300 epochs), which can be time-consuming.
  • Beyond Classification: While the paper briefly mentions object detection (DeTR), the bulk of the work is on classification. Future research could explore how correlation-aware pruning affects more complex tasks like generative AI or video understanding.

Summary updated

BibTeX
@inproceedings{kuznedelev2023cap,
  author = {Denis Kuznedelev and Eldar Kurtic and Elias Frantar and Dan Alistarh},
  title = {{CAP: Correlation-Aware Pruning for Highly-Accurate Sparse Vision Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=Xy7DoWSNZX},
}
Figure