TL;DR
This paper introduces "p-norm Weight Decay" (pWD), a novel method to generalize standard L2 weight decay to any p-norm. This allows for more flexible control over network sparsity during training, leading to significantly smaller models without sacrificing accuracy, and crucially, avoids numerical instabilities common with other sparsity-inducing methods.
What Problem Does This Paper Address?
The ever-increasing size of deep neural networks (NNs) presents a major challenge for training and deployment due to their substantial computational and storage requirements. Sparsification, the process of reducing the number of non-zero parameters, is a key strategy to combat this. While L2 regularization is standard for improving generalization, it doesn't inherently lead to sparse networks. L1 regularization (Lasso) promotes sparsity but can suffer from numerical issues. Existing methods for inducing sparsity often involve complex post-training pruning or specialized regularization techniques that can be difficult to integrate with modern optimizers. This paper aims to bridge this gap by providing a unified, stable, and easily integrable method for inducing sparsity through weight decay across a spectrum of p-norms.
Methods
The core contribution is the p-norm Weight Decay (pWD). This method is derived from an equivalent formulation of Lp-regularized optimization problems, which can be expressed as a biconvex problem. By leveraging an Alternate Convex Search (ACS) approach, the authors develop a weight decay update rule that generalizes the standard L2 weight decay.
Key aspects of the method include:
- Generalization of L2 Weight Decay: Instead of a fixed L2 penalty, pWD applies a penalty based on the p-norm of the weights, allowing for tunable sparsity.
- Stability for 0 < p < 1: A significant challenge with p-norms where $p < 1$ is the potential for gradient divergence, especially near zero. pWD is designed to avoid this, ensuring stable training dynamics.
- Compatibility with Adaptive Optimizers: The pWD step is presented as a decoupled mechanism that can be easily integrated with existing optimizers like Adam, as demonstrated by their "pAdam" implementation.
- Proximal Operator Formulation: The derivation relies on the concept of proximal operators, which are standard tools for handling non-smooth regularization terms in optimization.
Datasets
The authors evaluated their method on two standard datasets:
- CIFAR-10: A widely used dataset for image classification.
- Tiny Shakespeare: A character-level dataset for language modeling.
Key Insights and Ideas
- Tunable Sparsity: The ability to choose any p-norm provides a continuous spectrum for controlling the trade-off between sparsity and accuracy, offering more fine-grained control than binary choices like L1 vs. L2.
- Stability is Key: The most critical insight is the development of a weight decay mechanism that avoids the gradient explosion issues typically encountered when using p-norms with $p < 1$. This makes sparse training practical and robust.
- Bridging Sparsity and Generalization: The paper suggests that $1 < p < 2$ might offer a sweet spot, balancing the sparsity-inducing properties of $p < 1$ with the generalization benefits of $p > 1$ (like L2).
- Simplicity of Integration: The pWD step is designed to be a drop-in replacement for standard weight decay, making it accessible to practitioners without requiring significant changes to existing training pipelines.
Key Results
- High Sparsity Achieved: The pWD method successfully produced highly sparse networks. For ResNet18 on CIFAR-10, they achieved sparsity levels up to 99.5% with accuracy still significantly above random guessing.
- Competitive Accuracy: Even at high sparsity levels, pWD maintained generalization performance comparable to standard L2 regularization (AdamW). For instance, they found sparsity levels of 94.4% for ResNet18 and 89.9% for nanoGPT with less than a 2% accuracy drop compared to the best AdamW performance.
- Outperforming Other Methods: In some scenarios, pWD outperformed other sparsification techniques like Only Train Once (OTO), and at very high sparsity levels, it matched or surpassed iterative magnitude pruning (MP).
- Numerical Stability Demonstrated: A toy example clearly illustrated how standard gradient descent with $p < 1$ norms leads to oscillatory behavior around zero, while pWD achieves smooth convergence to zero.
Limitations and Future Work
- Hyperparameter Tuning: While pWD offers flexibility, it introduces new hyperparameters (p and $\lambda_p$) that require tuning, although the authors provide guidance on their interplay.
- Fixed Point at Zero: For $p < 2$, the $w_i = 0$ fixed point can cause parameters initialized to zero to remain frozen. The authors suggest strategies like "s dynamics" (making the auxiliary parameter 's' learnable) or "p scheduling" (gradually decreasing p) to mitigate this.
- Elastic Weight Decay Extensions: The paper hints at extending pWD to combine multiple p-norms (e.g., L1 and L2, similar to Elastic Net) to further balance sparsity and generalization. This was tested on nanoGPT with $p=0.8$ and L2 decay, showing improved results.
- Broader Applications: The authors believe pWD's core idea of a gradient-based approximated optimization approach for p-norms could be applied beyond NNs, for example, in Variational Quantum Circuits.
The authors express a goal to integrate pWD into popular deep learning frameworks to make sparse training more accessible.
Summary updated