A Gradient Flow Framework For Analyzing Network Pruning

Ekdeep Singh Lubana, Robert P. Dick

TL;DR

This paper introduces a theoretical framework based on gradient flow to explain why pruning neural networks early in training actually works. By unifying magnitude, loss-preservation, and gradient-norm measures, the authors demonstrate that magnitude-based pruning accelerates convergence, while naive gradient-norm pruning can accidentally damage a model's learning capacity.

The Challenge of Early Pruning

Deep Neural Networks (DNNs) are notoriously resource-heavy. "Pruning"—removing unimportant parameters—is a standard way to compress them. Traditionally, pruning was done on fully trained models to reduce inference costs. However, recent trends focus on pruning at initialization or early in training to save on both training and inference costs.

The problem? The "importance measures" used to decide which filters to cut (like parameter magnitude or impact on loss) were originally designed for mature, trained models. Researchers have questioned whether these measures are theoretically justified for "young" models that haven't learned much yet. This paper seeks to provide that missing theoretical foundation.

A Gradient Flow Perspective

The authors employ Gradient Flow—a continuous-time version of gradient descent with an infinitesimal learning rate—to analyze how model parameters evolve.

By looking at the derivatives of parameter norms over time, they unify three major classes of pruning:

  1. Magnitude-based: Removing weights with small absolute values ($L_1$ or $L_2$ norms).
  2. Loss-preservation: Removing weights that have the least impact on the current loss (often using Taylor expansions).
  3. Gradient-norm based: Removing weights to increase or preserve the "gradient norm" (the "acceleration" of learning).

Building on this framework, the authors propose two refined measures:

  • A Hybrid Measure: Combines magnitude and loss-preservation to remove small-magnitude parameters that also don't contribute to training progress.
  • Gradient-norm Preservation ($|GraSP|$): Instead of trying to increase the gradient norm (which can be unstable), they propose preserving it to maintain the model's second-order evolution dynamics.

Key Insights and Ideas

  • Magnitude Pruning = Speed: The authors prove that parameters with larger magnitudes are responsible for the fastest reduction in loss. Therefore, keeping large weights and pruning small ones directly enables faster convergence.
  • The "Lazy" Parameter Rule: Loss-preservation pruning essentially identifies and removes "lazy" parameters—those that have the least tendency to change. This justifies its use early in training because it preserves the model's first-order "evolutionary" trajectory.
  • The Danger of "Acceleration": Methods like GraSP aim to increase the gradient norm (acceleration) to speed up learning. However, the authors show that for even slightly trained models, this is "antithetical" to preserving loss. Aggressively increasing the gradient norm often involves removing filters that were actually helping reduce loss, permanently damaging early layers.
  • Heuristic Unification: They show that common heuristics, like "train until the pruning mask stops changing," mathematically transform simple magnitude pruning into a more sophisticated loss-preservation strategy.
Correlation and Mask Distance over training epochs.

Key Results

The framework was validated using standard image classification benchmarks (CIFAR-10, CIFAR-100, and Tiny-ImageNet) across architectures like VGG-13, MobileNet-V1, and ResNet-56.

  • Superiority of Magnitude: In early-training scenarios, magnitude-based pruning consistently outperformed loss-preservation methods in both final accuracy and convergence speed.
  • Hybrid Success: The authors' proposed hybrid measure (combining magnitude and loss-gradient info) consistently yielded the best or second-best results across almost all tested architectures and datasets.
Accuracy vs. Epoch for different pruning methods.
  • Stability of Preservation: The proposed Gradient-norm Preservation ($|GraSP|$) was significantly more robust than the original GraSP. For example, on ResNet-56 (CIFAR-100), the original GraSP collapsed to 1% accuracy when pruning over 25 rounds, while the preservation variant maintained ~68% accuracy.

Limitations and Future Work

  • First-Order Approximation: While the authors show their gradient flow analysis holds for Stochastic Gradient Descent (SGD) up to a first-order approximation, higher-order interactions in complex loss landscapes might not be fully captured.
  • Structured vs. Unstructured: The main text focuses on structured pruning (removing entire filters), which is more practical for hardware but mathematically different from unstructured pruning (removing individual weights). While the authors suggest the results generalize, the dynamics of sparse training remain complex.
  • Future Direction: The authors suggest that instead of adapting old "trained-model" measures, the community should develop new pruning criteria explicitly derived from the differential equations of model evolution.

Summary updated

BibTeX
@inproceedings{lubana2021gradient,
  author = {Ekdeep Singh Lubana and Robert P. Dick},
  title = {{A Gradient Flow Framework For Analyzing Network Pruning}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=rumv7QmLUue},
}
Figure