Self Expanding Neural Networks

Rupert Mitchell, Martin Mundt, Kristian KerstingarXiv 2023

Abstract: The results of training a neural network are heavily dependent on the architecture chosen; and even a modification of only its size, however small, typically involves restarting the training process. In contrast to this, we begin training with a small architecture, only increase its capacity as necessary for the problem, and avoid interfering with previous optimization while doing so. We thereby introduce a natural gradient based approach which intuitively expands both the width and depth of a neural network when this is likely to substantially reduce the hypothetical converged training loss. We prove an upper bound on the "rate" at which neurons are added, and a computationally cheap lower bound on the expansion score. We illustrate the benefits of such Self-Expanding Neural Networks with full connectivity and convolutions in both classification and regression problems, including those where the appropriate architecture size is substantially uncertain a priori.

Introduction

A central challenge in deep learning is selecting an architecture that is "just right"—sufficiently large to capture complex patterns but not so overparameterized that it wastes computational resources. Traditionally, if a model is found to be under-capacity during training, the optimization process must be restarted from scratch with a larger architecture. Self-Expanding Neural Networks (SENN) address this "Goldilocks" problem by allowing models to dynamically increase their width and depth during training, guided by a principled mathematical framework.

Methodology

The core of the SENN approach is the natural expansion score ($\eta$), which determines when, where, and how to add new parameters.

The Natural Expansion Score

The score is defined as $\eta = g^T F^{-1} g$, where $g$ is the gradient and $F$ is the Fisher Information Matrix. This metric measures the potential for loss reduction by projecting the gradient into the subspace of functions reachable by adding new neurons or layers. To ensure computational efficiency, the authors utilize Kronecker-factored Approximate Curvature (KFAC) to approximate the Fisher matrix.

Figure 1: Schematic of function-preserving expansion for width (left), depth (middle), and convolutional features (right).

Function-Preserving Growth

To prevent optimization shocks, SENN employs function-preserving initializations. When a new neuron or layer is added, its weights are initialized such that the network's output remains identical to its state prior to expansion. For instance, new output weights may be zeroed, or new layers may be initialized as identity mappings. This allows the training process to continue seamlessly without the need for a "warm start."

Experimental Evaluation

The authors tested SENN across various tasks, from synthetic regression to complex image classification.

Figure 5: Visualization of the natural expansion score on a 1D regression task. The heatmaps illustrate how the score identifies optimal locations and scales for new features.

Key Results

  • Architecture Discovery: On MNIST, SENN models starting with only 10 hidden neurons automatically expanded to 50-60 neurons, achieving >97% accuracy. The system correctly identified the need for additional depth almost immediately.
  • Transfer Learning: In adapting models from CIFAR-10 to Tiny-ImageNet, self-expansion provided a 3-4% relative accuracy boost over fixed-architecture baselines, reaching 48.2%.
  • Dynamic Adaptation: The framework also supports pruning. In experiments with cyclic learning rates, the network expanded its width as the learning rate rose and pruned redundant neurons as it fell, demonstrating a stable cycle of expansion and contraction.

Conclusion

SENN offers a rigorous, natural gradient-based approach to neural architecture search that operates during the training process itself. By combining the natural expansion score with function-preserving initializations, it enables the development of models that are tailored to the complexity of the data. Future work will explore extending these principles to Transformers and more complex generative models.

Summary updated

BibTeX
@misc{mitchell2023self,
  author = {Rupert Mitchell and Martin Mundt and Kristian Kersting},
  title = {{Self Expanding Neural Networks}},
  year = {2023},
  eprint = {2307.04526},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.04526},
}
Figure