DSD: Regularizing Deep Neural Networks with Dense-Sparse-Dense Training Flow

Song Han, Jeff Pool, Sharan Narang, Huizi Mao, Shijian Tang, Erich Elsen, Bryan Catanzaro, John Tran, William J. DallyarXiv 2016

Abstract

Modern deep neural networks have a large number of parameters, making them very hard to train. We propose DSD, a dense-sparse-dense training flow, for regularizing deep neural networks and achieving better optimization performance. In the first D (Dense) step, we train a dense network to learn connection weights and importance. In the S (Sparse) step, we regularize the network by pruning the unimportant connections with small weights and retraining the network given the sparsity constraint. In the final D (re-Dense) step, we increase the model capacity by removing the sparsity constraint, re-initialize the pruned parameters from zero and retrain the whole dense network. Experiments show that DSD training can improve the performance for a wide range of CNNs, RNNs and LSTMs on the tasks of image classification, caption generation and speech recognition. On ImageNet, DSD improved the Top1 accuracy of GoogLeNet by 1.1%, VGG-16 by 4.3%, ResNet-18 by 1.2% and ResNet-50 by 1.1%, respectively. On the WSJ'93 dataset, DSD improved DeepSpeech and DeepSpeech2 WER by 2.0% and 1.1%. On the Flickr-8K dataset, DSD improved the NeuralTalk BLEU score by over 1.7. DSD is easy to use in practice: at training time, DSD incurs only one extra hyper-parameter: the sparsity ratio in the S step. At testing time, DSD doesn't change the network architecture or incur any inference overhead. DSD models are available to download at https://songhan.github.io/DSD.

Introduction

Modern deep neural networks (DNNs) are highly expressive due to their large parameter counts, allowing them to capture complex non-linear relationships. However, this massive capacity is a double-edged sword: it makes networks prone to overfitting—capturing noise instead of generalizable patterns—and creates complex loss landscapes riddled with saddle points and sub-optimal local minima.

Simply reducing the size of the model to prevent overfitting often leads to underfitting. Existing regularization methods like Dropout or DropConnect apply random perturbations. This paper introduces Dense-Sparse-Dense (DSD), a novel training flow that regularizes models by deterministically identifying and leveraging the most important connections. DSD aims to find a better local optimum without changing the final model's architecture or adding any inference overhead.

The DSD Training Methodology

The DSD training flow is a three-step optimization process designed to improve the generalization of deep models:

  1. Initial Dense Training: The network is trained conventionally to convergence. This phase establishes baseline weights and identifies the relative importance of connections based on their absolute weight values.
  2. Sparse Training: The network is regularized by pruning the least important connections. A binary mask is applied to zero out the bottom $X\%$ of weights (typically 25% to 50%) in each layer. The network is then retrained under this strict sparsity constraint, forcing the optimization into a lower-dimensional, smoother space.
  3. Final Dense Training (Re-Dense): The sparsity constraint is removed. Previously pruned connections are restored and initialized to zero, while surviving weights retain their values. The entire dense network is then retrained at a lower learning rate.
The DSD training flow: Initial Dense training, Sparse pruning/retraining, and final Re-Dense training.

Unlike model compression techniques that stop at the sparse phase to save memory, DSD uses sparsity purely as a training-time regularization tool. The final output is a standard dense network.

Regularization Mechanisms

DSD's effectiveness stems from several key optimization insights:

  • Escaping Saddle Points: Pruning a converged model acts as a deterministic perturbation. It forces the network out of its current sub-optimal local minimum, allowing it to converge to a superior solution when capacity is restored.
  • Robust Re-initialization: Deep learning is highly sensitive to weight initialization. DSD provides a "second chance" at initialization, starting the final dense phase from a highly robust, regularized sparse state.
  • Symmetry Breaking: Hidden units often suffer from permutation symmetry, leading to co-adaptation. Pruning breaks this symmetry, forcing the network to learn more independent, asymmetrical feature representations.
Evolution of weight distributions throughout the DSD phases: (a) initial dense, (b) pruning, (c) sparse training, (d) recovery, and (e) final dense training.

Experimental Results

DSD training yielded consistent, significant improvements across all tested architectures compared to baseline models trained for the same total number of epochs:

  • Vision (ImageNet): Top-1 accuracy improved by 1.1% for GoogLeNet, a massive 4.3% for VGG-16, 1.2% for ResNet-18, and 1.1% for ResNet-50.
  • Speech (WSJ): Word Error Rate (WER) dropped by 2.0% (absolute) for DeepSpeech 1 and 1.1% for the larger DeepSpeech 2 model.
  • Captioning (Flickr-8K): The BLEU score for NeuralTalk improved by 1.7 (a 10.1% relative improvement).
  • Iterative Gains: DSD can be applied iteratively (e.g., Dense-Sparse-Dense-Sparse-Dense). A second iteration on DeepSpeech 1 further improved the WER, though with diminishing returns.

Conclusion

DSD provides a simple, architecture-agnostic technique to improve the performance of deep neural networks. By navigating through a sparse intermediate state, models can escape sub-optimal minima and achieve better generalization. While DSD increases training time and introduces a sparsity ratio hyperparameter, it offers a "free lunch" at inference time, providing accuracy gains with zero additional computational cost during deployment.

Summary updated

BibTeX
@misc{han2016dsd,
  author = {Song Han and Jeff Pool and Sharan Narang and Huizi Mao and Shijian Tang and Erich Elsen and Bryan Catanzaro and John Tran and William J. Dally},
  title = {{DSD: Regularizing Deep Neural Networks with Dense-Sparse-Dense Training Flow}},
  year = {2016},
  eprint = {1607.04381},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1607.04381},
}
Figure