Maxwell's Demon at Work: Efficient Pruning by Leveraging Saturation of Neurons

Simon Dufort-Labbé, Pierluca D'Oro, Evgenii Nikishin, Irina Rish, Pierre-Luc Bacon, Razvan Pascanu, Aristide Baratin

Abstract

"Dying neurons"—units that become permanently inactive during training—are traditionally viewed as a nuisance that degrades neural network performance. This paper flips the script, introducing Demon Pruning (DemP), a method that actively encourages neurons to die using targeted regularization and asymmetric noise so they can be dynamically pruned on the fly. The result is a highly sparse, computationally efficient model that trains up to 3.5x faster while outperforming existing structured pruning baselines.

Introduction: The Problem of Dead Weight

In deep learning, particularly with ReLU activation functions, neurons can "die." If a neuron's weights update in such a way that it only outputs negative values, the ReLU function flattens its output (and its gradient) to zero. Without gradients, the neuron cannot update its weights to recover, effectively becoming dead weight. Historically, researchers have tried to prevent this using alternative activations (like Leaky ReLU) or weight-resetting schemes.

At the same time, the field of network pruning actively seeks to remove redundant neurons to create smaller, faster models. Structured pruning (removing entire channels or neurons, rather than individual weights) is especially desirable because it translates directly to hardware acceleration on GPUs. However, most structured pruning methods require complex heuristics, gradient-flow calculations, or expensive post-training fine-tuning.

The authors ask a clever question: instead of fighting neuron death or using complex math to decide what to prune, why not harness the natural phenomenon of dying neurons to dynamically prune the network during training?

Methodology: Demon Pruning (DemP)

The authors introduce Demon Pruning (DemP), an end-to-end, dense-to-sparse training method. It relies on three core mechanics:

  1. Asymmetric Noise Injection (The "Maxwell's Demon"): Inspired by the physics thought experiment, DemP injects a tiny amount of Gaussian noise only into the weights of active (live) neurons. Because dead neurons have zero gradient, they don't get updated. This creates a one-way trap: noise jostles active neurons around until they accidentally cross the boundary into the "dead zone," where they are immediately frozen.
  2. Targeted Regularization: To push neurons toward that dead zone, DemP applies L1 (Lasso) regularization specifically to the scale parameters ($\gamma$) of the network's normalization layers (like Batch Norm). They use a "one-cycle" schedule (warmup followed by decay) to balance sparsity and accuracy.
  3. Dynamic Pruning: Every few thousand steps, the algorithm checks a small minibatch of data. If a neuron outputs zero across the batch, it is officially declared dead and physically removed from the computation graph, instantly speeding up the rest of the training process.

Analysis: The Mechanics of Neuron Death

A key insight of the paper is the "Asymmetry of Death." Neuron death is fundamentally an asymmetric stochastic process. Because gradient noise only affects active neurons, the "inactive region" acts as an attractor. Once a neuron falls in, it lacks the noisy gradients needed to bounce back out.

Furthermore, the authors found that the choice of optimizer significantly impacts neuron death. Adam kills vastly more neurons than Stochastic Gradient Descent with Momentum (SGDM). This is attributed to Adam's $\epsilon$ parameter (used for numerical stability). When a neuron's gradients get very small, $\epsilon$ dominates the denominator of the update step, effectively causing massive, random parameter jumps that frequently land the neuron in the dead zone.

Figure 2: Dead neuron ratios across different optimizers and regularizers. Lasso regularization combined with AdamW significantly increases the ratio of dead neurons compared to SGDM.

Empirical evidence also showed that neurons that die during training almost never revive. Even if they do, dynamically snipping them out early has zero negative impact on the final model's accuracy. Interestingly, even in standard dense training of a Vision Transformer (ViT-B/16), 90% of the neurons in the MLP layers naturally die.

Key Results

DemP demonstrates a superior accuracy-sparsity tradeoff. On ImageNet with a ResNet-50, DemP achieved a 2.85% higher test accuracy at ~80% weight sparsity compared to strong structured pruning baselines like SNAP and EarlyCrop.

Figure 5: Test accuracy vs. sparsity for DemP compared to other pruning methods. DemP-Lasso (cyan) consistently maintains higher accuracy at high sparsity levels across both Adam and SGDM optimizers.

Beyond accuracy, the dynamic nature of DemP leads to massive training speedups. By removing neurons during the training run, it drastically reduces training FLOPs, achieving up to 2.45x faster training on ResNet-18 and 3.56x faster training on VGG-16. The method also proved effective for Transformers, pruning 90% of ViT-B/16 MLP neurons with only a moderate accuracy drop.

Discussion and Future Work

While effective, DemP has some limitations. Unlike methods with a fixed target sparsity, DemP's final sparsity is an emergent property requiring hyperparameter tuning of the regularization strength ($\lambda$). Additionally, it performs coarse-grained (structured) pruning; combining it with fine-grained weight pruning could yield even more competitive hybrid models. Finally, because it relies on activation saturation (like ReLU or GELU), it cannot currently prune layers lacking these regions, such as attention matrices in Transformers. Adapting DemP for full Transformer pruning remains a promising future direction.

Summary updated

BibTeX
@article{dufortlabbe2025maxwell,
  author = {Simon Dufort-Labbé and Pierluca D'Oro and Evgenii Nikishin and Irina Rish and Pierre-Luc Bacon and Razvan Pascanu and Aristide Baratin},
  title = {{Maxwell's Demon at Work: Efficient Pruning by Leveraging Saturation of Neurons}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
}
Figure