Shaving Weights with Occam's Razor: Bayesian Sparsification for Neural Networks Using the Marginal Likelihood

Rayen Dhahri, Alexander Immer, Bertrand Charpentier, Stephan Günnemann, Vincent Fortuin
2/3/2026

No official code found. Best implementation: fortuinlab/spam-pruning (0 stars, last commit 2024-10-28).

Abstract

Neural network sparsification is a promising avenue to save computational time and memory costs, especially in an age where many successful AI models are becoming too large to na\"ively deploy on consumer hardware. While much work has focused on different weight pruning criteria, the overall sparsifiability of the network, i.e., its capacity to be pruned without quality loss, has often been overlooked. We present Sparsifiability via the Marginal likelihood (SpaM), a pruning framework that highlights the effectiveness of using the Bayesian marginal likelihood in conjunction with sparsity-inducing priors for making neural networks more sparsifiable. Our approach implements an automatic Occam's razor that selects the most sparsifiable model that still explains the data well, both for structured and unstructured sparsification. In addition, we demonstrate that the pre-computed posterior Hessian approximation used in the Laplace approximation can be re-used to define a cheap pruning criterion, which outperforms many existing (more expensive) approaches. We demonstrate the effectiveness of our framework, especially at high sparsity levels, across a range of different neural network architectures and datasets.

View on arXivView PDF

Code Implementations(1)

Code for the paper "Shaving Weights with Occam's Razor: Bayesian Sparsification for Neural Networks Using the Marginal Likelihood".

02HTML, MakoOct 25, 20241 years ago

Similar Papers

Cite this paper

@article{dhahri2026shaving,
  title  = {Shaving Weights with Occam's Razor: Bayesian Sparsification for Neural Networks Using the Marginal Likelihood},
  author = {Rayen Dhahri and Alexander Immer and Bertrand Charpentier and Stephan Günnemann and Vincent Fortuin},
  year   = {2026},
  eprint = {2402.15978},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2402.15978},
  url    = {https://arxiv.org/abs/2402.15978},
  journal = {NEURIPS 2024 2024}
}

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/2402.15978.svg)](https://codeofpaper.com/paper/2402.15978)

Discussion