Loss
1.00
0.80
0.60
0.40
0.20
0.00

Visualizing the

Loss Landscape
of Neural Nets

Based on the research by Li, Xu, Taylor, Studer & Goldstein (2018)

Scroll to explore
Scroll to continue
01

The Problem

A neural network with millions of parameters exists in an unimaginably high-dimensional space.

Training a neural network means finding a set of weights that minimizes the loss function— a measure of how wrong the network's predictions are. But how does gradient descent navigate this vast, complex terrain?

We can't visualize millions of dimensions directly. But we canslice through this space and see what the landscape looks like around a trained network's solution.

?

Why do some networks train easily while others get stuck? The answer lies in the shape of their loss landscape.

02

The Method

We create a 2D slice through the high-dimensional loss landscape using two random direction vectors.

f(α,β)=L(θ∗+αδ+βη)f(\alpha, \beta) = L(\theta^* + \alpha\delta + \beta\eta)f(α,β)=L(θ∗+αδ+βη)
θ∗\theta^*θ∗Trained network weights
δ,η\delta, \etaδ,ηRandom direction vectors
α,β\alpha, \betaα,βPerturbation magnitudes
LLLLoss function value

By sampling LLL at many points on this 2D plane, we build a surface that reveals the local geometry of the loss landscape around our trained solution.

03

Filter-wise Normalization

A crucial insight: random directions must be normalized to match the scale of each filter in the network.

Without normalization, large filters dominate the visualization. With filter-wise normalization, each filter contributes proportionally to its learned magnitude.

Without Normalization

Random noise overpowers the structure. The landscape appears artificially rough.

With Normalization

The true geometry emerges. We can now see meaningful differences between architectures.

For each filter iii:

di←di∥di∥⋅∥θi∗∥d_i \leftarrow \frac{d_i}{\|d_i\|} \cdot \|\theta^*_i\|di​←∥di​∥di​​⋅∥θi∗​∥
04

The Reveal

Watch the landscape transform as we toggle skip connections.

Without Skip

ResNet-56

Chaotic — riddled with local minima and sharp ridges. Optimization is treacherous.

With Skip

ResNet-56

Smooth — a gentle bowl with clear gradients pointing toward the minimum.

This is why ResNets train so much better than plain networks. Skip connections fundamentally reshape the optimization landscape.

05

Optimizer Trajectory

Watch SGD navigate the loss landscape in real-time.

The glowing path traces the optimizer's journey from a random starting point toward the minimum. On a smooth landscape, the path is direct. On a chaotic one, it wanders.

~100Training Epochs
SGDOptimizer
0.1Learning Rate

The trajectory is projected onto the same 2D plane as the loss surface, showing how the optimizer's path appears when viewed through our visualization lens.

07

Citation & Resources

Original Paper

“Visualizing the Loss Landscape of Neural Nets”

Hao Li, Zheng Xu, Gavin Taylor, Christoph Studer, Tom Goldstein

NeurIPS 2018

Read Paper (arXiv)

BibTeX

@inproceedings{li2018visualizing,
  title={Visualizing the Loss Landscape of Neural Nets},
  author={Li, Hao and Xu, Zheng and Taylor, Gavin and Studer, Christoph and Goldstein, Tom},
  booktitle={Advances in Neural Information Processing Systems},
  pages={6389--6399},
  year={2018}
}
📦Official Codegithub.com/tomgoldstein/loss-landscape

This interactive visualization was created to help understand the key insights from the original research. It demonstrates how architectural choices—particularly skip connections—fundamentally affect the optimization landscape of neural networks.