Krylov Subspace Descent for Deep Learning

Oriol Vinyals, Daniel PoveyAISTATS 2012

Introduction

Training deep neural networks is notoriously difficult due to high-dimensional parameter spaces and non-convex loss surfaces. While Stochastic Gradient Descent (SGD) remains the industry standard, its reliance on first-order gradient information often leads to slow convergence in the "narrow valleys" of the loss landscape. Second-order methods, such as Newton’s method, utilize the Hessian matrix to navigate these surfaces more effectively. However, for models with millions of parameters, the Hessian is too large to store or invert directly.

"Hessian-Free" (HF) optimization attempts to solve this by using the Conjugate Gradient (CG) algorithm to find an approximate update direction without explicitly forming the Hessian. Despite its advantages, HF is notoriously sensitive, requiring positive semi-definite approximations and complex damping heuristics (Levenberg-Marquardt parameters) to maintain stability. Krylov Subspace Descent (KSD) is proposed as a simpler, faster, and more robust second-order alternative.

Methodology

The core innovation of KSD is the definition of a low-dimensional "search space"—a Krylov subspace—within which the best possible parameter update is found directly.

Subspace Construction and Optimization

On each iteration, KSD builds a basis for a subspace of dimension $K$ (typically $K=20$). This basis includes the current gradient, the previous search direction (incorporating momentum), and vectors generated by repeatedly multiplying the gradient by an approximation of the Hessian (the Gauss-Newton matrix). To maintain efficiency, KSD employs the "Pearlmutter trick," allowing for Hessian-vector products to be computed in two passes, similar to standard backpropagation, without ever constructing the full matrix.

Unlike HF, which uses CG to find a single linear update direction, KSD uses the BFGS algorithm to optimize the original non-linear objective function directly within this $K$-dimensional subspace. This approach eliminates the need for the complex damping parameters required by HF to compensate for poor quadratic approximations.

Data Efficiency

To maintain computational speed, KSD utilizes different subsets of the training data for distinct phases of the algorithm: one subset for gradient calculation, another for Hessian-vector products, and a third for the BFGS-based subspace optimization.

Experimental Evaluation

The authors evaluated KSD across a diverse range of tasks, including artificial autoencoder training (CURVES), digit recognition (MNIST), large-scale speech recognition (Aurora with 1.2M samples), and strategy prediction (Starcraft).

Key Results and Insights

KSD consistently outperformed both L-BFGS and HF in terms of convergence speed and final accuracy. A primary insight is that while HF treats optimization as solving a linear system, KSD recognizes that the vectors explored during that process define a powerful subspace. By simply searching for the best point within that subspace, KSD achieves superior results with less tuning.

Figure 2: Convergence of L2 Train Error on the Aurora dataset. KSD (blue) shows a significantly steeper drop in error per unit of time compared to HF (green) and LBFGS (red).

As shown in the Aurora dataset results, KSD reaches target error levels in approximately 30% of the time required by HF. Furthermore, KSD demonstrates superior generalization capabilities. In almost every test case, KSD achieved lower cross-validation (CV) error than HF.

Figure 5: Performance comparison between HF and KSD across various datasets. KSD consistently achieves lower or equal CV error in significantly less time (normalized to HF=1).

Conclusion and Future Work

KSD provides a robust second-order optimization framework that is less sensitive to non-convexity than HF. By optimizing directly in the Krylov subspace, it bypasses the need for damping heuristics and can even utilize the actual Hessian when it is not positive definite. While the method requires additional memory to store the subspace basis, its performance gains make it a compelling choice for deep learning tasks. Future research may extend KSD to Recurrent Neural Networks (RNNs), where capturing long-term dependencies through second-order information is particularly critical.

Summary updated

BibTeX
@article{vinyals2012krylov,
  author = {Oriol Vinyals and Daniel Povey},
  title = {{Krylov Subspace Descent for Deep Learning}},
  journal = {AISTATS},
  year = {2012},
}
Figure