Modify Training Directions in Function Space to Reduce Generalization Error

Yi Yu, Wenlian Lu, Boyu ChenarXiv 2023 · DOI · arXiv

Introduction

Understanding why over-parameterized neural networks generalize effectively remains a central challenge in deep learning theory. While optimization typically occurs in parameter space (the weights), analyzing generalization is often more tractable in function space—the space of the network's outputs. Leveraging the Neural Tangent Kernel (NTK) framework, researchers have begun to bridge the gap between optimization (fitting training data) and generalization (predicting unseen data). This paper introduces a "Modified Natural Gradient Descent" (NGD) framework that optimizes generalization by selectively adjusting training directions in function space.

Methodology: Modified Natural Gradient Descent

The core innovation lies in decomposing the training process into independent "directions" via the eigendecomposition of the Fisher Information Matrix and the NTK.

Error Decomposition

The authors prove that total generalization error can be partitioned into two components:

  1. $R_1$ (Training Fit): Error arising from insufficient fitting of the training set.
  2. $R_2$ (Distribution Discrepancy): Error caused by the gap between the finite training samples and the true underlying data distribution.

The Modification Criterion

Standard optimizers like SGD or NGD treat all training directions equally as long as they reduce training loss. However, some directions primarily capture the "noise" or discrepancies of the training set ($R_2$) rather than the true signal. The proposed Modified NGD introduces a modification operation ($\phi$) on the eigenvalues of the Fisher matrix. By applying a specific mathematical criterion (Equation 65), the algorithm "mutes" directions that would otherwise increase generalization error, effectively pruning the training process in function space.

This framework provides a unified theoretical explanation for several empirical successes in deep learning, such as self-distillation and small-batch training, which can be viewed as implicit modifications of the kernel's spectrum.

Experimental Results

The framework was validated using a two-layer Multi-Layer Perceptron (MLP) with 4,096 neurons, approximating the infinite-width limit. The task involved approximating the synthetic function $f^*(x) = \cos x \sin x$ under varying levels of input perturbation ($\sigma^2$).

Test loss comparison between standard NGD and Modified NGD across varying levels of input perturbation ($\sigma^2$).

As shown in the figures above, Modified NGD consistently outperforms standard NGD in terms of both final Mean Squared Error (MSE) and training stability. While standard NGD often exhibits high variance and can get trapped in suboptimal solutions—especially at higher perturbation levels like $\sigma^2 = 10$—Modified NGD converges reliably to a lower test loss. The results confirm that selectively pruning training directions based on the derived criterion is more effective than simple heuristics, such as merely cutting small eigenvalues.

Discussion and Limitations

While the theoretical results are compelling, several hurdles remain for practical application:

  • Scale: Experiments were conducted on synthetic 1D data. Scaling these insights to complex architectures like Transformers or ResNets on large-scale datasets (e.g., ImageNet) is a necessary next step.
  • NTK Assumptions: The theory relies on the "infinite width" regime where the kernel remains constant. In finite networks, the kernel evolves during training, which may require more dynamic modification strategies.
  • Computational Complexity: Computing the full Fisher Information Matrix and its eigendecomposition is prohibitively expensive for large models. Practical implementations will likely require efficient approximations like K-FAC (Kronecker-factored Approximate Curvature).

Conclusion

By shifting the focus from parameter optimization to function-space directionality, this work provides a rigorous framework for improving generalization. Modified NGD offers a principled way to navigate the trade-off between fitting training data and avoiding distribution-specific noise, offering a theoretical foundation for many of the "tricks" currently used to train robust neural networks.

Summary updated

Abstract

We propose theoretical analyses of a modified natural gradient descent method in the neural network function space based on the eigendecompositions of neural tangent kernel and Fisher information matrix. We firstly present analytical expression for the function learned by this modified natural gradient under the assumptions of Gaussian distribution and infinite width limit. Thus, we explicitly derive the generalization error of the learned neural network function using theoretical methods from eigendecomposition and statistics theory. By decomposing of the total generalization error attributed to different eigenspace of the kernel in function space, we propose a criterion for balancing the errors stemming from training set and the distribution discrepancy between the training set and the true data. Through this approach, we establish that modifying the training direction of the neural network in function space leads to a reduction in the total generalization error. Furthermore, We demonstrate that this theoretical framework is capable to explain many existing results of generalization enhancing methods. These theoretical results are also illustrated by numerical examples on synthetic data.
BibTeX
@misc{yu2023modify,
  author = {Yi Yu and Wenlian Lu and Boyu Chen},
  title = {{Modify Training Directions in Function Space to Reduce Generalization Error}},
  year = {2023},
  eprint = {2307.13290},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.13290},
}
Figure