Jiaqing Chen and Nicholas Hadler and Tiankai Xie and Rostyslav Hnatyshyn
About
I spent the summer of 2025 in the bay area working for Lawrence Berkeley National Lab. I had the opportunity to contribute to an interesting machine learning project there called Landscaper.
Landscaper allows users to examine a model’s training process through the lens of its loss landscape. Using only a few lines of code, users can generate loss landscapes of arbitrary dimensions and visualize them with landscape profiles and obtain various diagnostic metrics. The goal of this project is to give users insight into what happens when a model’s parameters are perturbed: the prevailing theory is that smoother landscapes are indicative of models that generalize well.
How it works (abridged)
We generate our loss landscapes by calculating the Hessian (via PyHessian) of the loss function and then selecting n eigenvectors to perturb the model’s parameters with. These n eigenvectors correspond directly to the number of dimensions in the landscape and capture directions where the model’s loss changes the most when it’s perturbed. We then move along each eigenvector and calculate the total (or average) loss for each new perturbed model which gives us a scalar value for each point in the landscape.
It’s trivial to draw the landscape when we only have 2 eigenvectors (3 dimensions, x,y and the loss value), but visualizing a higher-dimensional landscape is far more difficult. To solve this problem, we turned to topological data analysis: landscape profiles allow us to capture the critical points of a high-dimensional landscape and plot them in 2D. The profiles are essentially merge trees with scalar values wrapped around them; in our case, they are the loss values of the perturbed models. These visualizations allow users to extract more information out of the Hessian than was possible before and are a valuable diagnostic tool for ML practitioners.
Bibtex
@misc{https://doi.org/10.5281/zenodo.15874987,
doi = {10.5281/ZENODO.15874987},
url = {https://zenodo.org/doi/10.5281/zenodo.15874987},
author = {Jiaqing Chen and Nicholas Hadler and Tiankai Xie and Rostyslav Hnatyshyn},
title = {Vis4SciML/Landscaper},
publisher = {Zenodo},
year = {2025},
copyright = {Lawrence Berkeley National Labs BSD Variant License}
}