NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Pruning By Explaining Revisited: Optimizing Attribution Methods to Prune CNNs and Transformers

Sayed Mohammad Vakilzadeh Hatefi, Maximilian Dreyer, Reduan Achtibat, Thomas Wiegand, Wojciech Samek, Sebastian Lapuschkin · DOI

Abstract

This research breathes new life into "pruning by explaining" by showing that eXplainable AI (XAI) attribution methods can be explicitly optimized to identify and remove redundant neural network components. By fine-tuning the hyperparameters of Layer-wise Relevance Propagation (LRP), the authors achieve record-breaking compression rates for both CNNs and Vision Transformers (ViTs) without the need for expensive retraining.

Introduction: The Pruning Challenge

Modern Deep Neural Networks (DNNs) are notoriously over-parameterized, leading to massive computational and memory costs. Pruning—the process of removing unnecessary weights or structures—is a standard solution, but identifying which parts to cut remains a challenge. Earlier works suggested using XAI attribution methods to identify internal component importance. However, these methods often rely on heuristics designed for human-interpretable heatmaps rather than structural pruning. This research addresses this gap by treating the attribution method as a tunable system optimized specifically for maintaining model accuracy during compression.

The performance-efficiency tradeoff and the workflow from naive to optimized attribution-based pruning.

Methodology: Optimizing Attribution Flow

The authors focus on Layer-wise Relevance Propagation (LRP), a technique that redistributes a model's output back through its layers to assign relevance scores to neurons, filters, or attention heads. Instead of using a single LRP rule for the whole network, they split models into functional sections (Low-level, Mid-level, High-level, and Fully-Connected layers) and use Bayesian optimization to find the best LRP rule for each.

Detailed visualization of attribution flow in the original network versus the resulting optimal sub-network after removing irrelevant components.

Key innovations include:

  • The APR Metric: Optimizing for the Area under the Pruning-Rate curve (APR) to reward methods that maintain high accuracy at high pruning levels.
  • Transformer Extension: Utilizing specialized LRP variants (like AttnLRP) to handle the unique non-linearities of the attention mechanism in ViTs.
  • Magnitude-based Pruning: Discovering that removing components with the lowest absolute relevance (closest to zero) is more effective than pruning based on sign.

Key Insights and Results

A major finding is that "faithful" explanations for humans are not necessarily optimal for pruning. Pruning requires identifying latent structural importance rather than just input-feature importance. Furthermore, Vision Transformers (ViTs) were found to be significantly more over-parameterized than CNNs, often losing up to 20% of components without any accuracy drop on ImageNet.

The optimized LRP approach (LRP-opt) consistently outperformed random and standard gradient-based methods:

  • CNNs (VGG & ResNet): Achieved pruning rates of 26% to 45% while maintaining 95% of original accuracy.
  • Vision Transformers (ViT-B-16): Achieved dramatic pruning rates of 57% for linear layers and 66% for attention heads within the same accuracy threshold.

Conclusion

This study highlights the potential of "post-hoc" pruning without expensive retraining. While finding the perfect LRP composite requires an initial computational investment, the resulting leaner models are highly efficient. Future work could combine this optimized XAI pruning with fine-tuning to push compression rates even further.

Summary updated

BibTeX
@inproceedings{hatefi2024pruning,
  author = {Sayed Mohammad Vakilzadeh Hatefi and Maximilian Dreyer and Reduan Achtibat and Thomas Wiegand and Wojciech Samek and Sebastian Lapuschkin},
  title = {{Pruning By Explaining Revisited: Optimizing Attribution Methods to Prune CNNs and Transformers}},
  booktitle = {Workshops @ ECCV},
  year = {2024},
  doi = {10.1007/978-3-031-92648-8\_10},
}
Figure