Sparse Weight Averaging with Multiple Particles for Iterative Magnitude Pruning

Moonseok Choi, Hyungi Lee, Giung Nam, Juho Lee

TL;DR

SWAMP (Sparse Weight Averaging with Multiple Particles) is a novel pruning algorithm that improves upon Iterative Magnitude Pruning (IMP) by averaging multiple models trained from the same "matching ticket." By navigating the loss landscape to find flatter minima, SWAMP achieves the performance of a model ensemble while maintaining the inference efficiency of a single sparse network.

What Problem Does This Paper Address?

Modern neural networks are notoriously over-parameterized. Pruning—removing unnecessary weights—is essential for deploying these models on edge devices with limited memory and power. The gold standard for finding high-performing sparse subnetworks is Iterative Magnitude Pruning (IMP), which relies on the "Lottery Ticket Hypothesis": the idea that a dense network contains a subnetwork that, when trained in isolation from its original initialization, can match the performance of the full model.

However, IMP is computationally expensive and can be sensitive to the "noise" of stochastic gradient descent (SGD). Recent research into Linear Mode Connectivity (LMC) has shown that different IMP solutions often reside in the same low-loss "basin" of the loss landscape. The authors of this paper ask: If these solutions are all in the same neighborhood, can we average them to find a more robust, better-generalizing central point?

Methods

The authors propose SWAMP, a straightforward but powerful modification to the standard IMP pipeline.

  1. The Matching Ticket: Like standard IMP, they start by training a dense model for a few iterations to find a stable starting point, known as the "matching ticket."
  2. Multiple Particles: Instead of training just one sparse model, SWAMP concurrently trains $N$ copies of the model (called "particles"). Each particle starts from the same matching ticket but uses a different random seed for data shuffling (SGD noise).
  3. Trajectory Averaging (SWA): During training, each individual particle uses Stochastic Weight Averaging (SWA), which keeps a running average of its own weights over time to find a flatter local region.
  4. Particle Averaging: At the end of a pruning cycle, the weights of all $N$ particles are averaged together.
  5. Pruning: The final mask is created by pruning the smallest weights of this averaged model.
  6. Iterate: The process repeats, rewinding the weights back to the matching ticket but keeping the new, more refined mask.

The key innovation is the combination of within-trajectory averaging (SWA) and across-particle averaging, which pushes the subnetwork toward the center of a wide, flat basin in the loss landscape.

Datasets

The researchers evaluated SWAMP across a wide range of benchmarks:

  • Computer Vision: CIFAR-10, CIFAR-100, Tiny-ImageNet, and the large-scale ImageNet-1K.
  • Architectures: They tested various "workhorse" models, including WideResNet (WRN-28-2, WRN-32-4), VGG (13, 16), and ResNet (18, 50).
  • Natural Language Processing (NLP): Fine-tuning RoBERTa-Base on the MRPC and RTE datasets from the GLUE benchmark.

Key Insights and Ideas

  • Flatter Minima Generalize Better: By calculating the Hessian trace (a measure of loss surface curvature), the authors proved that SWAMP finds significantly flatter minima than standard IMP. In deep learning, "flat" regions are generally associated with better generalization on unseen data.
Loss landscape contours showing multiple particles and the SWAMP averaged center at various sparsity levels.
  • The "Ensemble" Effect: SWAMP effectively captures the benefits of an ensemble of models during the training/mask-finding phase. However, because the particles are averaged into a single set of weights, the final product is a single sparse model with no extra inference cost.
  • Stability at Extreme Sparsity: One of the most striking findings is that as models become sparser (e.g., 95% or 98% pruned), the loss basin becomes more well-defined. This makes weight averaging even more effective at high sparsity levels where standard IMP often begins to fail.
  • Linear Connectivity Holds: The paper confirms that SWAMP preserves the linear connectivity between successive pruning rounds, ensuring that the "matching" property of the lottery ticket is maintained throughout the process.

Key Results

SWAMP consistently outperformed a battery of baselines, including standard IMP, SNIP, GraSP, and RigL.

Classification error of SWAMP compared to IMP baselines across different sparsity levels.
  • Accuracy Gains: On CIFAR-10 with a WRN-28-2 at 95% sparsity, SWAMP achieved 94.23% accuracy, compared to 93.58% for standard IMP.
  • ImageNet Success: On the challenging ImageNet dataset with a ResNet-50, SWAMP outperformed IMP across all sparsity levels, maintaining higher accuracy even when nearly 90% of weights were removed.
  • NLP Robustness: The gains were even more pronounced in NLP tasks. On the RTE dataset, SWAMP improved performance by over 5 percentage points at high sparsity levels compared to the IMP baseline.
  • Efficiency: While training multiple particles sounds expensive, the authors showed that a "cost-efficient" version (SWAMP+), which only uses multiple particles in the later, sparser stages of training, still beats standard IMP while significantly reducing FLOPs.

Limitations and Future Work

  • Training Overhead: The primary drawback is the increased training cost. Training $N$ particles requires $N$ times the computation. While this is easily parallelizable across multiple GPUs, it increases the total energy and hardware requirements for the training phase.
  • Memory Requirements: Storing and averaging multiple sets of high-dimensional weights requires more system memory during the training process.
  • Theoretical Depth: While the empirical results are strong, the authors note that a deeper theoretical analysis of the "convex hull" formed by these particles in weight space could yield even more insights into why this averaging works so effectively for sparse masks.

In conclusion, SWAMP demonstrates that we don't just need one lottery ticket; by looking at a "committee" of tickets, we can find a subnetwork that is far more robust and capable than any single one could be.

Summary updated

BibTeX
@inproceedings{choi2024sparse,
  author = {Moonseok Choi and Hyungi Lee and Giung Nam and Juho Lee},
  title = {{Sparse Weight Averaging with Multiple Particles for Iterative Magnitude Pruning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=Y9t7MqZtCR},
}
Figure