Parallel training of DNNs with Natural Gradient and Parameter Averaging

Daniel Povey, Xiaohui Zhang, Sanjeev Khudanpur

TL;DR

This paper introduces a framework for training Deep Neural Networks (DNNs) across multiple machines by periodically averaging their parameters. The key innovation is the use of an efficient, approximate Natural Gradient Stochastic Gradient Descent (NG-SGD), which stabilizes the averaging process and enables near-linear speedups for up to 8 GPUs without the heavy network traffic required by traditional parallel methods.

What Problem Does This Paper Address?

Training DNNs on massive datasets—like the 1600-hour Fisher English speech corpus—is computationally grueling. Standard "data parallelism" typically requires machines to communicate model updates after every single minibatch. This creates a massive network bottleneck, especially on hardware that lacks specialized, high-speed interconnections.

A simpler alternative is parameter averaging: let multiple machines train independently on different data and average their weights every few minutes. While attractive because it minimizes communication, this method usually fails for DNNs. Because neural network loss surfaces are non-convex, independent models tend to diverge into different "valleys," making their average a poor model. The authors sought a way to make this hardware-friendly averaging approach actually work.

Methods

The authors propose a two-pronged strategy implemented in the Kaldi speech recognition toolkit:

  1. Periodic Parameter Averaging: $N$ machines run SGD independently on randomized subsets of data. Every minute or two (after processing roughly 400,000 samples), the parameters are averaged across all jobs and redistributed. To maintain stability, they define an "effective learning rate" ($\eta / N$), meaning as you add more machines, you must increase the individual learning rates to keep the total progress per sample constant.
  2. Natural Gradient SGD (NG-SGD): This is the "secret sauce" that makes averaging stable. Standard SGD uses a scalar learning rate, treating all directions in parameter space equally. Natural Gradient scales the gradient by the inverse of the Fisher Information Matrix, which accounts for the curvature of the space.
  3. The Approximation: Since inverting a full Fisher matrix for millions of parameters is impossible ($O(n^3)$), the authors factor it into a Kronecker product of two much smaller matrices ($A \otimes B$) for each weight matrix.
  4. Online Estimation: They provide an "online" version that maintains a running estimate of these factors using a forgetting factor, making it computationally efficient enough for GPUs.
  5. Stability Heuristics: They implement a "maximum parameter change" per minibatch to prevent the model from exploding early in training and use identity matrix smoothing to ensure the Fisher matrix remains invertible.

Datasets

The primary evaluation is conducted on the Fisher English corpus:

  • Scale: 1,600 hours of transcribed conversational telephone speech.
  • Task: Classifying acoustic vectors into ~5,000 clustered HMM states.
  • Evaluation: A held-out 3.3-hour subset.

Key Insights and Ideas

  • NG-SGD as a Stabilizer: The authors hypothesize that NG-SGD works well with averaging because it prevents the model from taking massive, unstable steps in directions of high curvature. This keeps parallel models closer together in parameter space, making their average more meaningful.
  • Linear Speedup Limits: The method achieves near-linear speedup (doubling GPUs halves training time) but only up to about 4 or 8 GPUs. Beyond that, the "dilution" of updates during averaging becomes too great, and the model requires more epochs to reach the same accuracy.
  • Effective Learning Rate: A crucial insight for practitioners is that when parallelizing via averaging, the individual machine's learning rate must be scaled up by the number of machines ($N$) to keep the global progress consistent.
  • Factorization Efficiency: By treating the Fisher matrix as a Kronecker product, the authors turned a theoretically ideal but practically impossible optimization method into something that adds only a small overhead (about 5-10% on GPUs) compared to plain SGD.

Key Results

The authors demonstrate that NG-SGD significantly outperforms plain SGD in terms of both convergence speed and final accuracy.

Table 1: Word Error Rates (Fisher dev set)

As shown in Table 1, the DNN models (trained with NG-SGD and averaging) achieve a Word Error Rate (WER) of approximately 23.7%, a massive improvement over the baseline GMM system's 31.07%.

Qualitatively, the convergence plots in the paper show that the NG-SGD curves for 1, 2, and 4 jobs are almost identical when plotted against the amount of data processed, confirming the linear speedup. However, the 8- and 16-job runs show slightly slower convergence, indicating the limits of the averaging frequency.

Limitations and Future Work

  • Scaling Ceiling: The most obvious limitation is the sub-linear speedup beyond 8 GPUs. The authors suggest that more frequent averaging might help, but this would increase network overhead.
  • Theoretical Gaps: The paper is primarily empirical. The authors admit they lack a formal proof for why parameter averaging works so much better with Natural Gradient than with plain SGD, or how their specific rescaling approximations affect convergence proofs.
  • Hyperparameter Sensitivity: While $\alpha=4$ and $S=2000$ worked well for them, these parameters might require tuning for different architectures (like CNNs or LSTMs), which were not the focus of this study.

Summary updated

Abstract

We describe the neural-network training framework used in the Kaldi speech recognition toolkit, which is geared towards training DNNs with large amounts of training data using multiple GPU-equipped or multi-core machines. In order to be as hardware-agnostic as possible, we needed a way to use multiple machines without generating excessive network traffic. Our method is to average the neural network parameters periodically (typically every minute or two), and redistribute the averaged parameters to the machines for further training. Each machine sees different data. By itself, this method does not work very well. However, we have another method, an approximate and efficient implementation of Natural Gradient for Stochastic Gradient Descent (NG-SGD), which seems to allow our periodic-averaging method to work well, as well as substantially improving the convergence of SGD on a single machine.
BibTeX
@inproceedings{povey2015parallel,
  author = {Daniel Povey and Xiaohui Zhang and Sanjeev Khudanpur},
  title = {{Parallel training of DNNs with Natural Gradient and Parameter Averaging}},
  booktitle = {International Conference on Learning Representations},
  year = {2015},
  url = {http://arxiv.org/abs/1410.7455},
}
Figure