Reconstructing Deep Neural Networks: Unleashing the Optimization Potential of Natural Gradient Descent

Weihua Liu, Said Boumaraf, Jianwu Li, Chaochao Lin, Xiabi Liu, Lijuan Niu, Naoufel WerghiarXiv 2024 · OpenReview

Abstract

Natural gradient descent (NGD) is a powerful optimization technique for machine learning, but the computational complexity of the inverse Fisher information matrix limits its application in training deep neural networks. To overcome this challenge, we propose a novel optimization method for training deep neural networks called structured natural gradient descent (SNGD). Theoretically, we demonstrate that optimizing the original network using NGD is equivalent to using fast gradient descent (GD) to optimize the reconstructed network with a structural transformation of the parameter matrix. Thereby, we decompose the calculation of the global Fisher information matrix into the efficient computation of local Fisher matrices via constructing local Fisher layers in the reconstructed network to speed up the training. Experimental results on various deep networks and datasets demonstrate that SNGD achieves faster convergence speed than NGD while retaining comparable solutions. Furthermore, our method outperforms traditional GDs in terms of efficiency and effectiveness. Thus, our proposed method has the potential to significantly improve the scalability and efficiency of NGD in deep learning applications.

Introduction

In deep learning, the standard choice for optimization remains first-order methods like Stochastic Gradient Descent (SGD) or Adam. While computationally efficient, these methods often struggle with the complex "curvature" of the loss landscape, leading to slow convergence or entrapment in sub-optimal regions. Natural Gradient Descent (NGD) is theoretically superior because it accounts for the geometry of the parameter space using the Fisher Information Matrix (FIM). However, for modern neural networks, the FIM is too large to compute, store, or invert efficiently, requiring $O(n^3)$ operations where $n$ is the number of parameters.

Structured Natural Gradient Descent (SNGD) addresses this bottleneck by mathematically "reconstructing" the neural network. This transformation allows a standard first-order optimizer to effectively perform second-order optimization, achieving the benefits of NGD with minimal computational overhead.

Methodology: Optimization as Architecture

The core innovation of SNGD is a reconstruction strategy that transforms the network's architecture to simplify the optimization landscape.

Overview of the SNGD framework: Reconstructing the network to transform the optimization landscape.

As shown in the figure above, the authors prove that optimizing a reconstructed network (with transformed weights $w'$) using standard Gradient Descent is mathematically equivalent to optimizing the original network using NGD. The process involves:

  1. Local Fisher Layers: The global Fisher matrix is decomposed into manageable, local matrices for each layer. A "Local Fisher Layer" is inserted to apply a transformation based on the negative square root of the local Fisher matrix ($G^{-1/2}$).
  2. Efficient Matrix Computation: To avoid the $O(n^3)$ bottleneck, SNGD utilizes the Nystrom method for approximation and an optimized Denman-Beavers iterative scheme. This reduces complexity to roughly $O(n^{2.373})$ by using only matrix multiplications.
  3. Workflow Integration: During training, the network calculates local curvature, updates the Local Fisher Layer, and then uses standard GD for weight updates. Crucially, the transformation layer does not participate in backpropagation, ensuring clean gradient flow.

Experimental Results

The authors evaluated SNGD across diverse architectures including MLPs, VGG, ResNet, and LSTMs on benchmarks such as MNIST, CIFAR-10, ImageNet, and Penn Treebank.

Comparison of training loss and test accuracy between SGD, KFAC, and SNGD.

Key Performance Metrics

  • Accuracy Gains: On CIFAR-10, SNGD achieved a 94.44% Top-1 accuracy with ResNet-18, outperforming SGD (93.02%) and Adam (92.93%). On the large-scale ImageNet dataset, SNGD reached 73.41% Top-1 accuracy, significantly higher than SGD (70.23%) and RAdam (67.62%).
  • Convergence Speed: As illustrated in the training curves, SNGD converges significantly faster than both standard SGD and existing second-order approximations like K-FAC.
  • Computational Efficiency: SNGD maintains a per-epoch training time nearly identical to first-order methods. For ResNet-18 on CIFAR-10, SNGD added only a negligible 1.7% overhead compared to standard SGD (53.81s vs 52.89s per epoch).
  • Sequence Modeling: For 3-layer LSTMs on Penn Treebank, SNGD achieved a test perplexity of 58.27, superior to Adam (60.44) and SGD (61.22).

Conclusion and Future Work

SNGD demonstrates that second-order optimization benefits can be realized by embedding curvature information directly into the network structure. This approach bridges the gap between the theoretical power of NGD and the practical efficiency required for deep learning. While currently validated on CNNs and LSTMs, future work will focus on scaling SNGD to Transformer architectures and further optimizing the memory overhead required for storing local Fisher information. SNGD represents a significant step toward making sophisticated second-order optimization a standard tool for large-scale AI models.

Summary updated

BibTeX
@misc{liu2024reconstructing,
  author = {Weihua Liu and Said Boumaraf and Jianwu Li and Chaochao Lin and Xiabi Liu and Lijuan Niu and Naoufel Werghi},
  title = {{Reconstructing Deep Neural Networks: Unleashing the Optimization Potential of Natural Gradient Descent}},
  year = {2024},
  eprint = {2412.07441},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.07441},
}
Figure