A Trace-restricted Kronecker-Factored Approximation to Natural Gradient

Kai-Xin Gao, Xiao-Lei Liu, Zheng-Hai Huang, Min Wang, Zidong Wang, Dachuan Xu, Fan Yu

Introduction

Training deep neural networks (DNNs) efficiently is a cornerstone of modern machine learning. While first-order methods like Stochastic Gradient Descent (SGD) and Adam are standard due to their low computational cost, they often struggle with "pathological curvature"—regions where the loss surface's steepness varies wildly across different directions, leading to slow convergence. Second-order methods, specifically Natural Gradient Descent (NGD), address this by using the Fisher Information Matrix (FIM) to precondition the gradient. However, the exact FIM is computationally prohibitive for large models, necessitating efficient approximations.

The Challenge of Curvature Approximation

Kronecker-factored Approximate Curvature (KFAC) has emerged as a popular way to approximate the FIM by treating it as a product of smaller matrices. While KFAC captures parameter correlations well, it often fails to accurately represent the scale of individual parameter sensitivities. This paper introduces TKFAC (Trace-restricted Kronecker-factored Approximate Curvature), which refines the KFAC approximation by ensuring it preserves the "trace" (the sum of diagonal elements) of the original FIM blocks.

Methodology: Trace-Restricted Approximation

The core innovation of TKFAC is the introduction of a scaling coefficient $\delta_l$ for each layer $l$: $$F_l \approx \delta_l \Phi_l \otimes \Psi_l$$ By calculating $\delta_l$ such that the trace of the approximation matches the trace of the exact FIM block, the authors preserve the "total volume" of curvature information. This leads to a more faithful representation of the network's geometry compared to standard KFAC, which can lose information about the magnitude of diagonal elements.

Visual comparison of Fisher Information Matrix approximations. The trace-restricted approach (TKFAC) aims to better capture the magnitude and structure of the exact curvature compared to standard Kronecker-factored methods.

Solving the Damping Bottleneck in CNNs

A critical observation made by the authors is that standard damping techniques—used to stabilize matrix inversion—often hinder second-order methods in Convolutional Neural Networks (CNNs). As training progresses, the ratio of damping to the actual curvature signal (the trace) can grow excessively large, effectively drowning out the second-order information and reducing the optimizer to a first-order method.

Analysis of damping and trace behavior during training. Plots (a) and (b) show the ratio of damping to average trace for different layers, illustrating how damping can dominate the signal over time. Plot (c) shows the convergence of the trace over iterations.

To combat this, the authors propose TKFAC_new, an automatic damping scheme that scales damping relative to the trace of the FIM blocks. This ensures that the curvature signal remains dominant throughout the training process, preventing the optimizer from being "damped into mediocrity."

Experimental Results

The researchers evaluated TKFAC on MNIST (auto-encoder), CIFAR-10, and CIFAR-100 using VGG16 and ResNet20 architectures.

  • Higher Accuracy: On CIFAR-100 with ResNet20, TKFAC_new achieved a test accuracy of 77.01%, significantly outperforming KFAC (74.18%) and Adam (73.79%).
  • Faster Convergence: In the MNIST auto-encoder task, TKFAC reached lower reconstruction errors faster than all baselines in both epochs and wall-clock time.
  • Generalization: Unlike some second-order methods that overfit training data, TKFAC consistently showed better generalization (higher test accuracy) than standard KFAC across all benchmarks.

Conclusion

TKFAC provides a more precise and stable second-order optimization framework by focusing on trace preservation and adaptive damping. While it introduces a slight computational overhead, the gains in convergence speed and final accuracy make it a compelling alternative for training complex deep learning models. Future work will explore its scalability to massive datasets like ImageNet and its application to Transformer architectures.

Summary updated

BibTeX
@inproceedings{gao2021trace,
  author = {Kai-Xin Gao and Xiao-Lei Liu and Zheng-Hai Huang and Min Wang and Zidong Wang and Dachuan Xu and Fan Yu},
  title = {{A Trace-restricted Kronecker-Factored Approximation to Natural Gradient}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i9.16921},
}
Figure