Practical Gauss-Newton Optimisation for Deep Learning

Aleksandar Botev, Hippolyt Ritter, David BarberICML 2017

TL;DR

This paper introduces an efficient approach to second-order optimization for deep learning by utilizing a recursive, block-diagonal approximation of the Gauss-Newton matrix. The resulting algorithms, KFRA and KFLR, perform competitively with state-of-the-art first-order methods like Adam, but with the distinct advantage of requiring significantly less hyperparameter tuning to achieve optimal results.

The Challenge of Curvature in Deep Learning

Training deep neural networks is currently dominated by first-order methods such as Stochastic Gradient Descent (SGD) and Adam. While generally effective, these methods are "blind" to the curvature of the error surface. Consequently, they often get stuck in "valleys" or require researchers to spend days meticulously tuning learning rates and decay schedules.

Second-order methods, like Newton's method, leverage the Hessian matrix to understand this curvature, allowing for much larger, more intelligent optimization steps. However, for a modern network with millions of parameters, the Hessian matrix contains trillions of entries. This makes it impossible to store, let alone invert. The core challenge addressed by this paper is finding a way to capture this vital curvature information without incurring massive computational overhead.

Proposed Methods

The authors propose a recursive approach to approximate the Gauss-Newton (GN) matrix, a positive semi-definite alternative to the Hessian. Their key innovations include:

  • Block-Diagonal Approximation: Instead of computing the full matrix, the method focuses on blocks corresponding to each layer, operating under the assumption that the relationship between weights in different layers is negligible.
  • Kronecker Factoring: These large layer-blocks are broken down into the product of two much smaller matrices (Kronecker factors). This transforms an otherwise impossible matrix inversion problem into a trivial one.
  • Two New Algorithms:
    1. KFLR (Kronecker Factored Low Rank): An exact calculation designed for networks with a small number of outputs, such as in classification tasks.
  • KFRA (Kronecker Factored Recursive Approximation): A recursive approximation tailored for high-dimensional outputs, such as those found in autoencoders.
  • Recursive Backpass: The authors derive a method to compute these factors during a single backward pass through the network, keeping the "per-step" computational cost manageable.

Evaluated Datasets

The proposed methods were evaluated on standard deep learning benchmarks for both autoencoding and classification:

  • MNIST: The classic dataset of 60,000 handwritten digits.
  • CURVES: A dataset comprising 20,000 simulated hand-drawn curves.
  • FACES: An augmented version of the Olivetti faces dataset containing 103,500 images, known for presenting a more difficult optimization task.

Key Insights

  • The "No Local Maxima" Surprise: A fascinating side result of their mathematical derivation is that for networks using piecewise linear activations (like ReLU), the error surface has no differentiable strict local maxima. Any maxima must occur at the "sharp," non-differentiable points of the ReLU function. This theoretical insight helps explain why ReLUs are significantly easier to optimize than older sigmoid-style activation functions.
  • Hyperparameter Robustness: Unlike Adam, which often requires an extensive grid search over numerous combinations of learning rates and decay schedules to find the "best" configuration, the proposed Gauss-Newton methods worked excellently using their default settings.
  • Beyond Probabilistic Models: Unlike the popular KFAC (Kronecker-factored Approximate Curvature) method, which requires the network to be interpreted as a probabilistic model (using Fisher information), the Gauss-Newton approach is more general and can be applied to any loss function.

Key Results

Training performance comparison across datasets
  • Out-of-the-box Performance: On the challenging FACES dataset, the proposed second-order methods were not only faster but significantly more stable than Adam. While Adam proved highly sensitive to the learning rate and sometimes diverged, KFRA converged reliably.
  • Convergence Speed: When measured by the number of iterations, the second-order methods reached low error levels much faster than their first-order counterparts.
  • Wall-clock Time: On a CPU, the second-order methods outperformed Adam in total training time. On a GPU, Adam's per-iteration speed remains very high, making the total time comparison more marginal; however, the second-order methods still performed competitively without the extensive need for hyperparameter tuning.

Limitations and Future Work

  • GPU Optimization: While the underlying math is efficient, standard deep learning libraries are heavily optimized for the simple gradients used in SGD and Adam. The authors note that further software engineering is needed to make these second-order updates as fast as possible on parallel hardware.
  • Rank Deficiency: The Gauss-Newton matrix is often "under-determined" (rank-deficient) because the number of parameters vastly exceeds the batch size. While damping techniques help, exploring how to better handle these "zero-curvature" directions remains a path for future research.
  • Scaling to CNNs: This paper primarily focuses on feedforward (fully connected) networks. Extending the recursive Kronecker factorization to convolutional layers is a logical and necessary next step for broader applicability.

Summary updated

BibTeX
@inproceedings{botev2017practical,
  author = {Aleksandar Botev and Hippolyt Ritter and David Barber},
  title = {{Practical Gauss-Newton Optimisation for Deep Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2017},
}
Figure