Abstract
Second-order optimization methods theoretically offer superior convergence rates compared to first-order methods but face significant practical hurdles in deep learning, including computational complexity and numerical instability. This paper introduces a robust second-order training framework utilizing Complex-step Directional Derivatives (CSDD) to compute Hessian-vector products with analytic-level precision. By integrating CSDD into a stochastic Newton-Krylov solver with adaptive step-sizing and early termination, the proposed method achieves convergence speeds up to an order of magnitude faster than standard optimizers like Adam across various benchmarks.
Introduction
Modern deep learning relies heavily on first-order optimization methods such as Stochastic Gradient Descent (SGD) and Adam. While these methods are computationally efficient per iteration, they often require extensive hyperparameter tuning and can struggle with ill-conditioned loss landscapes. Second-order methods, like Newton’s method, utilize curvature information to navigate these landscapes more effectively but are rarely used due to several challenges:
- Computational Overhead: Storing and inverting the Hessian matrix is infeasible for large-scale models.
- Implementation Complexity: Manually deriving second-order derivatives is error-prone and tedious.
- Numerical Instability: Traditional finite difference methods for approximating Hessian-vector products suffer from subtractive cancellation, leading to significant precision loss.
- Stochastic Noise: Curvature estimates from mini-batches can be highly noisy, potentially destabilizing the optimization process.
This research addresses these issues by leveraging the Complex-step Directional Derivative (CSDD) for stable curvature estimation and a specialized Newton-Krylov procedure tailored for stochastic environments.
Methodology
Complex-step Directional Derivative (CSDD)
The core innovation lies in the use of Complex-step Finite Difference (CSFD) instead of real-valued finite differences. By introducing a tiny imaginary perturbation ($hi$) to the input, the derivative can be extracted from the imaginary component of the output: $$f'(x) \approx \frac{\text{Im}(f(x + hi))}{h}$$ Unlike standard finite differences, this approach avoids the subtraction of nearly identical values in the numerator, making it immune to subtractive cancellation. This allows for extremely small step sizes $h$, reaching machine epsilon precision comparable to analytic derivatives.
The authors extend this to directional derivatives (CSDD), enabling the efficient computation of Hessian-vector products ($Hp$) and Hessian-inner products ($p^T Hp$) through a single complex-enabled forward and backward pass.
Stochastic Newton-Krylov Optimization
To handle the "wild" loss landscapes of neural networks, the CSDD is integrated into a modified Newton-Krylov solver featuring:
- Batch Screening: Minibatches are skipped if their local gradient significantly contradicts the global gradient, mitigating the impact of noisy updates.
- Early Termination: The Conjugate Gradient (CG) loop terminates immediately upon detecting negative curvature, preventing the optimizer from following unstable directions.
- Taylor Ratio Step-Sizing: Instead of fixed learning rates, the method monitors the "Taylor ratio"—the ratio of actual loss reduction to predicted reduction—to dynamically adjust step sizes, ensuring the second-order approximation remains valid.
Experimental Evaluation
The method was evaluated on diverse benchmarks, including regression, SVMs, and deep architectures like LeNet-5 and VGG-11, using datasets such as MNIST, CIFAR-10, and SVHN.
Performance and Efficiency
Across all tasks, the proposed method demonstrated significantly faster convergence than popular first-order (Adam, AdaGrad) and second-order (Shampoo, L-BFGS) optimizers. In many instances, it reached target loss values in one-tenth the iterations required by Adam.
Furthermore, CSDD proved computationally efficient, outperforming native auto-differentiation tools in TensorFlow and PyTorch for Hessian-vector product calculations on CPU benchmarks.
Conclusion and Future Work
The use of Complex-step Directional Derivatives provides a numerically stable and implementation-friendly path toward leveraging second-order information in deep learning. By combining this with a robust stochastic solver, the authors demonstrate that second-order methods can be both stable and significantly faster than current industry standards.
Future work includes optimizing the global gradient calculation, which currently accounts for a large portion of the computational overhead, and improving framework support for complex-valued operations to further scale the method to massive foundation models.
Summary updated