Exploring the Geometry and Topology of Neural Network Loss Landscapes

Stefan Horoi, Jessie Huang, Bastian Rieck, Guillaume Lajoie, Guy Wolf, Smita Krishnaswamy

TL;DR

This paper introduces a novel "jump and retrain" sampling procedure combined with non-linear dimensionality reduction (PHATE) and topological data analysis to map the high-dimensional loss landscapes of neural networks. The authors demonstrate that these dynamical trajectories capture significantly more information about a network's ability to generalize than traditional linear visualization methods, revealing that "good" minima act as powerful attractors with low topological complexity.

What Problem Does This Paper Address?

Understanding why deep neural networks generalize well despite being massively overparameterized remains a central mystery in AI. Researchers have long suspected that the "geometry" of the loss landscape—the mathematical surface representing how error changes as weights are adjusted—holds the key. Specifically, "flat" minima are thought to generalize better than "sharp" ones.

However, visualizing these landscapes is incredibly difficult because they exist in millions of dimensions. Current techniques usually rely on linear methods like PCA or simple 1D/2D interpolations (lines and planes). These methods are often too rigid to capture the highly non-linear, manifold-like structures that optimizers actually traverse, potentially missing the very features that explain generalization.

Methods

The authors propose a three-step pipeline to better characterize the loss landscape:

  1. Jump and Retrain (J&R) Sampling: Instead of static sampling, they start at a converged minimum ($\theta_o$), "jump" a certain distance in a random direction, and then "retrain" the network back toward the minimum using the original optimizer. This process samples the actual dynamical paths (trajectories) that are relevant to the training process.
  2. Non-linear Visualization via PHATE: To visualize these high-dimensional trajectories, they use PHATE (Potential of Heat-diffusion for Affinity-based Trajectory Embedding). Unlike t-SNE or UMAP, which can "shatter" continuous paths into clusters, PHATE is specifically designed to preserve trajectory structures and global relationships. The authors adapt it using cosine distance to better suit weight space geometry.
  3. Topological Data Analysis (TDA): To move beyond qualitative visuals, they use persistent homology to quantify the "shape" of the sampled manifolds. They calculate total persistence, a complexity measure that tracks how topological features (like holes or connected components) appear and disappear as they filter the landscape by loss value.

Datasets

The study primarily uses the CIFAR-10 image classification task. The authors trained 108 different Wide Residual Networks (Wide ResNets), varying:

  • Depth: 10, 16, or 22 layers.
  • Width factor: 1 or 2.
  • Hyperparameters: Batch size, weight decay, and the presence/absence of data augmentation.
  • Labels: One model was trained on completely randomized labels to study the "memorization" regime.

Key Insights and Ideas

  • Dynamics over Statics: The J&R procedure proves that the path back to a minimum is more informative than the geometry of a flat plane intersecting that minimum.
  • Minima as Attractors: In networks that generalize well, the minimum acts as a powerful attractor. PHATE visualizations show a distinctive "star-shaped" pattern where trajectories return directly to the valley. In contrast, "bad" minima show chaotic, outward-diverging paths.
  • Topological Activity vs. Generalization: There is a clear link between the "bumpiness" of the landscape and performance. Landscapes surrounding "good" optima have lower topological activity (lower total persistence), suggesting they are smoother and less prone to non-convexities that trap optimizers.
  • Regularization Smooths the Map: The authors found that weight decay directly leads to landscapes with lower topological complexity, providing a geometric explanation for why it helps generalization.

Key Results

The authors validated their J&R sampling by training 11 simple classifiers to predict a network's generalization class based on sampled loss and accuracy values.

Table 1: Mean and standard error (%) of the 11 classifiers accuracies on the 5 class generalization, weight decay and data aug. classification tasks with different features.

As shown in Figure 2 (Table 1), J&R sampling significantly outperformed grid and naive sampling across all tasks. For the 5-class generalization task, J&R achieved 39.2% accuracy (compared to ~30% for other methods), and it was particularly effective at identifying whether data augmentation was used (72.1% accuracy).

Qualitatively, PHATE proved superior at maintaining the integrity of training trajectories compared to other popular dimensionality reduction tools.

Fig. 1: 2D embeddings of the J&R experiment (5 random seeds) results for a WResNet28- 2 network using PHATE (A1), t-SNE (A2), UMAP (A3) and the linear method PCA (A4). B: embeddings of an artificial data set having a fully connected tree-like structure found using the same techniques. We see that PHATE consistently retains continuous trajectory structures while other embeddings (tSNE/UMAP) shatter the structure, or miss important features (PCA) because of uninformative projections to low dimensions.

As seen in Figure 1, PHATE (A1, B1) preserves the continuous, branching nature of the trajectories, whereas t-SNE and UMAP (A2/A3, B2/B3) tend to fragment the data into disconnected clusters.

Limitations and Future Work

The authors acknowledge that while their method captures the manifold structure well, it does not fully account for the time dependency of the training data. Future work could involve applying dimensionality reduction techniques that explicitly incorporate the temporal order of the retraining epochs. Additionally, while the study provides deep insights into CIFAR-10 and ResNets, testing these topological signatures on even larger architectures (like Transformers) or different domains (like NLP) remains an open challenge.

Summary updated

BibTeX
@inproceedings{horoi2022exploring,
  author = {Stefan Horoi and Jessie Huang and Bastian Rieck and Guillaume Lajoie and Guy Wolf and Smita Krishnaswamy},
  title = {{Exploring the Geometry and Topology of Neural Network Loss Landscapes}},
  booktitle = {IDA},
  year = {2022},
  doi = {10.1007/978-3-031-01333-1\_14},
}
Figure