Sparse Model Soups: A Recipe for Improved Pruning via Model Averaging

Max Zimmer, Christoph Spiegel, Sebastian Pokutta
6/29/2023
cs.LGcs.AI

Official code: ZIB-IOL/SMS (12 stars, PyTorch, last commit 2025-10-14).

Abstract

Neural networks can be significantly compressed by pruning, yielding sparse models with reduced storage and computational demands while preserving predictive performance. Model soups (Wortsman et al., 2022) enhance generalization and out-of-distribution (OOD) performance by averaging the parameters of multiple models into a single one, without increasing inference time. However, achieving both sparsity and parameter averaging is challenging as averaging arbitrary sparse models reduces the overall sparsity due to differing sparse connectivities. This work addresses these challenges by demonstrating that exploring a single retraining phase of Iterative Magnitude Pruning (IMP) with varied hyperparameter configurations such as batch ordering or weight decay yields models suitable for averaging, sharing identical sparse connectivity by design. Averaging these models significantly enhances generalization and OOD performance over their individual counterparts. Building on this, we introduce Sparse Model Soups (SMS), a novel method for merging sparse models by initiating each prune-retrain cycle with the averaged model from the previous phase. SMS preserves sparsity, exploits sparse network benefits, is modular and fully parallelizable, and substantially improves IMP's performance. We further demonstrate that SMS can be adapted to enhance state-of-the-art pruning-during-training approaches.

View on arXivView PDF

Code Implementations(1)

ZIB-IOL/SMSOfficial69%
PyTorch

Code to reproduce the experiments of the ICLR24-paper: "Sparse Model Soups: A Recipe for Improved Pruning via Model Averaging"

121TeX, PythonJun 24, 20231 years ago
averagingdeep-learningneural-networkoptimizationpruning+2 more

Similar Papers

Cite this paper

@article{zimmer2023sparse,
  title  = {Sparse Model Soups: A Recipe for Improved Pruning via Model Averaging},
  author = {Max Zimmer and Christoph Spiegel and Sebastian Pokutta},
  year   = {2023},
  eprint = {2306.16788},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.16788v3},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.16788.svg)](https://codeofpaper.com/paper/2306.16788)

Discussion