Sparse maximal update parameterization: A holistic approach to sparse training dynamics

Nolan Simran Dey, Shane Bergsma, Joel Hestness

TL;DR

Training sparse neural networks is notoriously difficult due to vanishing activations and gradients, leading to costly hyperparameter tuning. This paper introduces SµPar, a novel parameterization that stabilizes training dynamics across varying sparsity levels and model widths. SµPar significantly reduces tuning costs and improves performance, achieving up to 8.2% better loss on large language models compared to standard methods.

What Problem Does This Paper Address?

Training sparse neural networks, where a significant portion of weights are zeroed out, promises reduced computational costs and potentially better performance. However, several hurdles prevent sparse models from consistently outperforming their dense counterparts. Firstly, sparsity can disrupt the flow of information during training, causing activations and gradients to shrink, a phenomenon known as vanishing. Secondly, finding optimal hyperparameters (like learning rates and weight initialization) for sparse models is a major challenge. The standard practice of reusing hyperparameters tuned for dense models fails because optimal settings often shift with sparsity levels. This necessitates extensive, costly hyperparameter searches for each sparsity configuration, negating the efficiency gains of sparsity itself.

Methods

The authors propose Sparse Maximal Update Parameterization (SµPar), a holistic approach to stabilize sparse training. SµPar aims to ensure that key training dynamics – specifically, the scale of activations, gradients, and weight updates – remain consistent regardless of the model's width or sparsity level.

The core idea is to reparameterize the hyperparameters themselves. SµPar achieves this by controlling the variance of weight initializations and learning rates in a way that decouples them from width and sparsity. This is inspired by prior work on "maximal update parameterization" (µP) which stabilized training with respect to model width. SµPar extends this by also accounting for sparsity.

Specifically, SµPar ensures:

  • Forward Pass: Activations are scaled independently of width and sparsity.
  • Backward Pass: Gradients are scaled independently of width and sparsity.
  • Weight Updates: The effect of weight updates is scaled independently of width and sparsity.

By achieving these "µDesiderata" for both width and sparsity, SµPar enables µTransfer: optimal hyperparameters tuned on small dense models can be directly transferred to large sparse models, drastically reducing tuning costs.

Datasets

The paper uses the SlimPajama dataset [57], which is described as a cleaned and deduplicated version of the RedPajama dataset. This dataset is used for training large language models.

Key Insights and Ideas

  • Sparsity and Dense Models Don't Share Optimal Hyperparameters: A crucial finding is that the optimal learning rates and weight initializations for sparse networks are fundamentally different from those for dense networks. This invalidates the common practice of simply reusing dense model hyperparameters.
  • SµPar Stabilizes Training Dynamics: The proposed SµPar parameterization effectively prevents vanishing activations and gradients that plague standard sparse training methods, even at very high sparsity levels.
  • Hyperparameter Transfer is Key: The ability to tune hyperparameters on small dense models and transfer them to large sparse models (µTransfer) is a major practical benefit, significantly reducing computational burden.
  • Holistic Approach is Necessary: Instead of fixing individual issues (like gradient flow or activation variance), SµPar addresses the problem holistically by controlling the scaling of all key training operations.

Key Results

  • Performance Improvement: SµPar achieves up to 8.2% better loss on large language models compared to the standard parameterization (SP) and 2.1% better loss than the µP approach at 99.2% sparsity.
  • Stable Hyperparameters: SµPar ensures that optimal learning rates and weight initializations remain consistent across a wide range of sparsity levels and model widths, unlike SP and µP which show unstable optimal settings.
  • Reduced Tuning Costs: The µTransfer capability of SµPar drastically reduces the need for extensive hyperparameter searches, making sparse model training more accessible.
  • Compute Efficiency: The performance gains translate to significant compute efficiency improvements, with losses corresponding to 4.1x and 1.5x compute efficiency gains along the Chinchilla scaling law.

Limitations and Future Work

  • Dynamic Sparsity: The current work focuses on static sparsity. Extending SµPar to handle dynamic sparsity (where the sparsity mask evolves during training) is a direction for future research.
  • Pruning and Fine-tuning: SµPar is designed for training sparse models from scratch. Adapting it for scenarios where models are pruned from a pre-trained dense state and then fine-tuned requires further extension.
  • Hardware Acceleration: The authors highlight the ongoing limitation of hardware acceleration for unstructured sparsity. They suggest that SµPar's ability to reduce tuning costs could help in planning and designing future hardware for sparsity.
  • Small Weight Per Neuron (WPN): The derivation relies on the Law of Large Numbers, which assumes a large number of non-zero weights per neuron. In sparse settings, WPN can be small, potentially affecting training dynamics. This is identified as an area for future work.
  • Other Layers: SµPar currently focuses on linear projection layers. While it aligns with µP for other layers (like embeddings, biases, etc.), their specific impact on training dynamics might need further review depending on the sparsification technique.

Summary updated

BibTeX
@inproceedings{dey2024sparse,
  author = {Nolan Simran Dey and Shane Bergsma and Joel Hestness},
  title = {{Sparse maximal update parameterization: A holistic approach to sparse training dynamics}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=wQZthAVTdm},
}
Figure