Abstract
Recent work has established clear links between the generalization performance of trained neural networks and the geometry of their loss landscape near the local minima to which they converge. This suggests that qualitative and quantitative examination of the loss landscape geometry could yield insights about neural network generalization performance during training. To this end, researchers have proposed visualizing the loss landscape through the use of simple dimensionality reduction techniques. However, such visualization methods have been limited by their linear nature and only capture features in one or two dimensions, thus restricting sampling of the loss landscape to lines or planes. Here, we expand and improve upon these in three ways. First, we present a novel "jump and retrain" procedure for sampling relevant portions of the loss landscape. We show that the resulting sampled data holds more meaningful information about the network's ability to generalize. Next, we show that non-linear dimensionality reduction of the jump and retrain trajectories via PHATE, a trajectory and manifold-preserving method, allows us to visualize differences between networks that are generalizing well vs poorly. Finally, we combine PHATE trajectories with a computational homology characterization to quantify trajectory differences.
Introduction
Deep neural networks are typically overparameterized, yet they demonstrate an impressive ability to generalize to unseen data. A prevailing hypothesis suggests that the geometric properties of the loss landscape—the high-dimensional surface representing error as a function of model weights—are intrinsically linked to this generalization capability. Specifically, "flat" minima are thought to generalize better than "sharp" ones. However, exploring these landscapes is challenging due to their extreme dimensionality. Traditional visualization methods often rely on linear projections or simple 1D/2D slices, which fail to capture the complex, non-linear paths taken by optimization algorithms during training.
Methodology
To address these limitations, we propose a framework consisting of three key components:
- Jump and Retrain (J&R) Sampling: This procedure involves taking a model at a local minimum, applying a random perturbation ("jump") in parameter space, and then retraining the model for several epochs. This process effectively explores the "low-loss manifold" surrounding the minimum, capturing how the optimizer behaves when perturbed.
- PHATE Visualization: We utilize PHATE (Potential of Heat-diffusion for Affinity-based Trajectory Embedding) to project these high-dimensional trajectories into a visualizable space. Unlike methods like t-SNE or UMAP, which can fragment continuous paths, PHATE is designed to preserve the global and local structure of trajectories. We adapt it using cosine distance to better handle high-dimensional weight vectors.
- Topological Data Analysis (TDA): We apply persistent homology to the sampled points to quantify the topological complexity of the landscape. By calculating "total persistence," we can assign a numerical value to the "bumpiness" or non-convexity of the region surrounding a minimum.
Results and Quantitative Analysis
Our experiments on CIFAR-10 with Wide ResNet architectures reveal that the J&R procedure provides superior information about a network's generalization potential. As shown in Figure 1, PHATE successfully captures the continuous nature of the retraining trajectories, revealing a distinctive "star-shaped" attractor pattern for well-generalizing minima (B1), whereas other methods like t-SNE and UMAP tend to cluster points unnaturally.
Quantitatively, classifiers trained on J&R sampled data significantly outperformed those using grid or naive sampling in predicting generalization-related features such as weight decay or data augmentation usage. As shown in the table below, J&R sampling achieved 39.2% accuracy on a 5-class generalization task, compared to 30.1% for grid sampling.
Furthermore, we found a strong correlation between low topological complexity (total persistence) and high test accuracy. For instance, "good" minima (91% test accuracy) exhibited a total persistence of only 73, while "bad" minima (83% test accuracy) that had memorized randomized labels showed a much higher persistence of 1198. This suggests that generalization is fundamentally linked to the topological simplicity and flatness of the regions found by optimizers.
Conclusion
By combining novel sampling techniques with non-linear manifold learning and topological analysis, we provide a more faithful representation of the neural network loss landscape. Our results demonstrate that techniques like weight decay and data augmentation directly lead to landscapes with lower topological complexity. Future work will explore these dynamics in larger architectures and more diverse datasets to further validate the link between landscape geometry and generalization.
Summary updated