The Role of Regularization in Shaping Weight and Node Pruning Dependency and Dynamics

Yael Ben-Guigui, Jacob Goldberger, Tammy Riklin-RavivarXiv 2020 · OpenReview

TL;DR

This paper introduces a novel framework called Weight to Node Pruning (WtoNP) that leverages $L_1$ and $L_2$ regularization to simultaneously prune both weights and nodes in deep neural networks. By showing that regularization can actively encourage node pruning alongside weight pruning, they offer a more efficient path to model compression with competitive accuracy.

What Problem Does This Paper Address?

Deep neural networks have become incredibly powerful but also notoriously large and computationally expensive. This makes them challenging to deploy on resource-constrained devices like mobile phones or in real-time applications. Network pruning, a technique to reduce model size by removing redundant parameters, is a key solution. While weight pruning (removing individual connections) is common, node pruning (removing entire neurons and their connections) offers greater efficiency and computational savings. However, existing methods often struggle to effectively prune nodes, especially when focusing primarily on weight pruning. This paper addresses the gap of effectively and simultaneously pruning both weights and nodes, and specifically investigates the under-explored role of $L_2$ regularization in this process.

Methods

The core of the proposed method, WtoNP, is a stochastic framework for weight pruning. It samples weights for pruning based on a probability function that favors smaller weights. The novelty lies in how regularization terms ($L_1$ and $L_2$) are integrated into the training process. Instead of just encouraging sparsity, the authors demonstrate that these regularizers, particularly $L_2$ (weight decay), actively influence the dynamics of pruning, leading to significant node pruning as a byproduct of optimizing for weight pruning.

The WtoNP algorithm works by:

  1. Stochastic Weight Pruning: Weights are zeroed stochastically, with a higher probability for weights with smaller magnitudes.
  2. Regularization Integration: $L_1$ or $L_2$ regularization is added to the loss function. This regularization term plays a "triple role": reducing overfitting, decreasing weight magnitudes (thus increasing pruning probability), and crucially, promoting node pruning.
  3. Node Pruning Dynamics: The paper hypothesizes and demonstrates that regularization suppresses the tendency of neighboring weights to compensate for pruned edges. This leads to entire nodes becoming less informative and eventually being pruned.

Datasets

The paper evaluates WtoNP on several standard datasets and tasks:

  • MNIST: For MLP-300-100 classification.
  • CIFAR-10: For VGG-like classification.
  • Medical Image Segmentation: Using a U-Net on the ISBI 2012 segmentation challenge dataset (Drosophila first instar larva ventral nerve cord).
  • COVID-19 Detection: Using the DarkCovidNet model on chest X-ray images.

Key Insights and Ideas

  • Regularization as a Node Pruning Driver: The most significant insight is that standard regularization techniques ($L_1$ and $L_2$) can be actively leveraged to drive node pruning, not just sparsity. This moves beyond simply applying regularization for its inherent benefits to using it as a mechanism for structural pruning.
  • $L_2$ Regularization's Role in Node Pruning: While $L_1$ is often discussed for sparsity, the paper highlights the effectiveness of $L_2$ (weight decay) in facilitating node pruning by suppressing weight compensation mechanisms.
  • Suppression of Weight Compensation: Regularization prevents remaining weights from "compensating" for pruned edges connected to the same node. This forces nodes to become less informative, leading to their eventual pruning.
  • Unified Pruning Framework: WtoNP offers a single framework that can effectively prune both weights and nodes simultaneously, simplifying the model compression pipeline.

Key Results

  • Competitive Performance: WtoNP achieved competitive weight pruning results, often with only a slight drop in accuracy compared to dense networks, while pruning a significant percentage of weights (e.g., >98% for MLP-300-100).
  • Significant Node Pruning: The method demonstrated substantial node pruning across various architectures:
  • MLP for MNIST: 50% of nodes pruned.
  • VGG-16 for CIFAR-10: 60% of filters pruned.
  • U-Net for medical imaging: 60% of channels pruned.
  • CNN for COVID-19 detection: 50% of channels pruned.
  • Regularization Impact: Experiments showed that $L_1$ and $L_2$ regularization led to significantly higher node pruning percentages compared to no regularization, especially in deeper layers. For instance, with no regularization, node pruning was often negligible.
  • Architecture-Specific Regularization Preferences: While $L_2$ was generally effective, the paper noted that $L_1$ was sometimes preferable for VGG node pruning, and $L_2$ for U-Net performance.

Limitations and Future Work

  • Hyperparameter Tuning: The paper mentions that the effectiveness of the pruning depends on tuning hyperparameters like $\lambda$ (regularization strength) and $\alpha$ (for the sigmoid function). While the method is presented as general, finding optimal values might still require experimentation.
  • "Pruning from Scratch" vs. "Post-Training Pruning": The paper focuses on pruning during training. While they argue this is superior to post-training pruning, the exact trade-offs and scenarios where one might be preferred are not deeply explored.
  • Future Work: The authors suggest that their framework can be adapted to various architectures and tasks, implying potential for further exploration in more complex models and diverse applications. The code for the proposed method is intended to be made available, facilitating future research.

Summary updated

Abstract

The pressing need to reduce the capacity of deep neural networks has stimulated the development of network dilution methods and their analysis. While the ability of $L_1$ and $L_0$ regularization to encourage sparsity is often mentioned, $L_2$ regularization is seldom discussed in this context. We present a novel framework for weight pruning by sampling from a probability function that favors the zeroing of smaller weights. In addition, we examine the contribution of $L_1$ and $L_2$ regularization to the dynamics of node pruning while optimizing for weight pruning. We then demonstrate the effectiveness of the proposed stochastic framework when used together with a weight decay regularizer on popular classification models in removing 50% of the nodes in an MLP for MNIST classification, 60% of the filters in VGG-16 for CIFAR10 classification, and on medical image models in removing 60% of the channels in a U-Net for instance segmentation and 50% of the channels in CNN model for COVID-19 detection. For these node-pruned networks, we also present competitive weight pruning results that are only slightly less accurate than the original, dense networks.
BibTeX
@misc{benguigui2020role,
  author = {Yael Ben-Guigui and Jacob Goldberger and Tammy Riklin-Raviv},
  title = {{The Role of Regularization in Shaping Weight and Node Pruning Dependency and Dynamics}},
  year = {2020},
  eprint = {2012.03827},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.03827},
}
Figure