Introduction
In modern machine learning, optimization problems often involve minimizing a loss function averaged over massive datasets. While first-order methods like Stochastic Gradient Descent (SGD) and ADAM are industry standards due to their simplicity, they frequently suffer from slow convergence on complex loss surfaces. Second-order methods, such as Limited-memory BFGS (L-BFGS), theoretically offer faster convergence by utilizing curvature information. However, L-BFGS is notoriously unstable when applied to stochastic mini-batch optimization. This paper introduces a stabilized framework that leverages second-order information to make L-BFGS robust and efficient for large-scale stochastic training.
The Challenge: Stochastic Instability in L-BFGS
The core of the L-BFGS algorithm relies on the "secant equation," which uses the difference between two consecutive gradients: $y_k = \nabla F(w_{k+1}) - \nabla F(w_k)$. In a stochastic setting, if these gradients are computed on different random mini-batches, the resulting noise in $y_k$ can be extreme. This noise often leads to poor Hessian approximations, causing the algorithm to diverge or fail.
Proposed Methodology: Curvature-Based Smoothing
The authors propose a novel framework to stabilize the $y_k$ term by using approximate second-order information. Instead of direct subtraction of noisy gradients, they utilize the relationship $y_k \approx B_k s_k$, where $B_k$ is a Hessian approximation and $s_k$ is the change in weights. This approach effectively "smooths" the estimate of the gradient difference.
Two primary variants are introduced:
- LBFGS-H: Directly utilizes the stochastic Hessian matrix to calculate $y_k$.
- LBFGS-F: Employs the Fisher Information Matrix (FIM). This variant is particularly advantageous for distributed systems; for common loss functions like cross-entropy, FIM-vector products can be computed locally on worker nodes and aggregated with minimal communication overhead.
Key Innovations for Scalability
Beyond the core stabilization, the paper introduces several architectural improvements:
- Vector-free Two-loop Recursion: A modified L-BFGS update optimized for MapReduce environments, reducing communication overhead to $O(m^2)$ (where $m$ is memory size).
- ADAM Initialization: The L-BFGS Hessian ($H_k^0$) is initialized using ADAM-style preconditioning, combining ADAM's stable scaling with L-BFGS's curvature-capturing capabilities.
- Cautious Updates: To maintain stability in non-convex landscapes (e.g., neural networks), updates are skipped if specific curvature conditions are not met, ensuring the Hessian approximation remains positive definite.
Experimental Results
The algorithms were evaluated on the ijcnn1 dataset (logistic regression) and MNIST (LeNet-5 convolutional neural network).
Stability and Convergence
As shown in the experimental results, standard stochastic L-BFGS (LBFGS-S) is highly unstable. In contrast, LBFGS-H and LBFGS-F demonstrate consistent stability across all tests. On the ijcnn1 dataset, LBFGS-H consistently outperformed ADAM, SGD, and ADAGRAD in terms of sub-optimality.
Performance with Large Batch Sizes
A significant advantage of this second-order approach is its performance as batch sizes increase. While first-order methods often see diminishing returns or slowed convergence with larger batches, LBFGS-H and LBFGS-F maintain high efficiency.
Conclusion and Limitations
By replacing noisy stochastic gradient differences with curvature-based estimates, the authors have successfully stabilized L-BFGS for stochastic optimization. The resulting methods, LBFGS-H and LBFGS-F, offer superior convergence and better scalability for large-batch distributed training compared to standard first-order optimizers.
However, some limitations remain. Like most stochastic methods with a fixed learning rate, the algorithm converges to a neighborhood of the optimal solution rather than an exact point. Additionally, the LBFGS-F variant relies on the assumption that the Hessian of the loss function is diagonal, which holds for common losses but might not apply to more exotic functions. Despite these constraints, the significant reduction in total epochs required makes this a compelling choice for large-scale machine learning tasks.
Summary updated