The Loss Surfaces of Neural Networks with General Activation Functions

Nicholas P. Baskerville, Jonathan P. Keating, Francesco Mezzadri, Joseph NajnudelarXiv 2020 · DOI

Abstract

The loss surfaces of deep neural networks have been the subject of several studies, theoretical and experimental, over the last few years. One strand of work considers the complexity, in the sense of local optima, of high dimensional random functions with the aim of informing how local optimisation methods may perform in such complicated settings. Prior work of Choromanska et al (2015) established a direct link between the training loss surfaces of deep multi-layer perceptron networks and spherical multi-spin glass models under some very strong assumptions on the network and its data. In this work, we test the validity of this approach by removing the undesirable restriction to ReLU activation functions. In doing so, we chart a new path through the spin glass complexity calculations using supersymmetric methods in Random Matrix Theory which may prove useful in other contexts. Our results shed new light on both the strengths and the weaknesses of spin glass models in this context.

Introduction

Despite the ubiquity of deep learning, a rigorous theoretical understanding of why gradient-based optimization consistently finds high-quality solutions remains elusive. Neural networks are trained on high-dimensional, non-convex loss surfaces that, in theory, should be plagued by poor local minima. Yet, in practice, simple gradient descent methods rarely get stuck in suboptimal regions.

In 2015, Choromanska et al. proposed a landmark analogy: the loss surfaces of deep multi-layer perceptrons (MLPs) are mathematically equivalent to "spin glasses"—disordered systems studied in physics. However, this equivalence relied on several restrictive assumptions, most notably the use of Rectified Linear Unit (ReLU) activation functions. This paper investigates whether the spin glass analogy holds for general activation functions, such as Tanh or Sigmoid, or if the previous findings were merely a mathematical artifact of the ReLU’s specific properties.

Methodology

To analyze the loss surface of a neural network as a random function over a high-dimensional weight space, the authors employ a combination of theoretical physics and random matrix theory:

  • Piece-wise Linear Approximation: General activation functions are modeled as continuous piece-wise linear functions. This allows the network's output to be decomposed into a sum of paths, facilitating a more granular analysis of the landscape.
  • Kac-Rice Formula: This mathematical framework is used to count the expected number of critical points (minima, maxima, and saddles) on the random loss surface.
  • Supersymmetry (SUSY) in Random Matrix Theory: This represents the paper's primary technical contribution. When moving beyond ReLU, the Hessian matrices—which describe the local curvature of the loss surface—become "perturbed" versions of standard random matrices. Because standard methods fail to account for these perturbations, the authors utilize SUSY techniques from theoretical physics to calculate the "complexity" (the growth rate of the number of critical points).
  • Empirical Testing: The theoretical framework was validated using MLPs and Convolutional Neural Networks (CNNs) trained on both synthetic Gaussian data and the MNIST dataset.

Key Insights: The Universality of the Landscape

The Deterministic "Spike"

The transition from ReLU to general activation functions introduces a deterministic term to the random spin glass model. In physical terms, this is akin to adding a specific "magnetic field" or directional bias to a disordered landscape. While this complicates the mathematics, the authors demonstrate that the fundamental structure of the surface remains intact.

Logarithmic Complexity and the "Banded" Structure

Surprisingly, the authors prove that at the level of logarithmic complexity—how the number of critical points scales with network size—the results for general activations are identical to the ReLU case. This suggests that the "banded" structure of the loss surface is a universal property of deep architectures. In this structure, local minima are concentrated at low energy (loss) levels, while high loss levels are dominated by high-index saddle points.

The Role of Saddles

The findings reinforce the idea that gradient descent succeeds because high-loss regions are populated by saddles rather than minima. These saddle points have many "downward" directions, allowing optimization algorithms to escape them easily and descend toward the lower-energy regions where high-quality local minima reside.

Results and Validation

The theoretical results are formalized in several key theorems:

  • Theorems 3.3 & 3.4: These establish that for any "well-behaved" activation function, there exists a threshold energy $E_\infty$ below which local minima become exponentially abundant, matching the spin glass predictions.
  • Theorem 3.6: This provides a sharp asymptotic expression for the number of critical points, showing that while the logarithmic rate is universal, the specific choice of activation function does influence the lower-order terms of the landscape's complexity.

Empirical validation showed that the variance of pre-activation distributions remains small across different architectures (MLP vs. CNN) and activations (ReLU vs. HardTanh). This supports the authors' "path-averaging" heuristic, though the theory begins to deviate from reality once a network is trained on structured data like MNIST, suggesting that training introduces correlations not yet captured by the random model.

Conclusion and Future Work

This work generalizes the theoretical link between deep learning and spin glass theory, demonstrating that the favorable properties of the loss landscape are not unique to ReLU networks. However, the authors note that the "path-independence" assumption—treating the activation state of different paths as independent variables—is a simplification. Future research may focus on modeling the correlations introduced by structured data and training processes to bring the theory closer to real-world deep learning applications.

Summary updated

BibTeX
@misc{baskerville2020loss,
  author = {Nicholas P. Baskerville and Jonathan P. Keating and Francesco Mezzadri and Joseph Najnudel},
  title = {{The Loss Surfaces of Neural Networks with General Activation Functions}},
  year = {2020},
  eprint = {2004.03959},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.03959},
}
Figure