TRANSMISSION // 2612.03570v1

Looking beyond a neural network’s loss landscape

Source published

An update to the Loss Landscape Analysis library adds measures of class-cluster spread, classification margins and embedding alignment. Two ViT-S image-classification studies explore how these measures relate to accuracy on changed data.

AI-generated conceptual illustration for Looking beyond a neural network’s loss landscape
AI-generated conceptual illustration; not documentary evidence.

A model can look well behaved under one kind of inspection and still struggle when its data changes. This paper adds embedding-analysis measures to the Loss Landscape Analysis software library and tests what they reveal about class structure and performance in two image-classification settings.

Why look beyond the loss landscape?

Neural networks turn inputs into internal numerical representations called embeddings, then use a classifier to assign labels. When a model encounters a changed dataset, its accuracy can fall even if familiar checks of its training process appear reassuring. One possible clue is whether class-related groups of embeddings remain compact, distinct and similarly arranged across datasets.

Nikita Gabdullin’s paper describes new embedding-analysis functions in version 1.3 of Loss Landscape Analysis (LLA), a PyTorch library that also supports loss-landscape visualization and neural-network Hessian analysis. The added measures are intended to complement those existing tools.

What the measures examine

The four measures address related but distinct questions. Mean centroid distance estimates how spread out embeddings are around their class average. Inductive margins compare an example’s similarity to its own class average with its similarity to the closest competing class average. These can be used to examine cluster compactness and classification margins within a dataset, or to assess classification using means from another dataset.

The other measures compare class arrangements. Procrustes analysis optimally rotates and normalizes one embedding distribution to align it with another, then measures how different they remain. LLA uses normalized embeddings by default. Inter-class separation compares the arrangement of class means through their pairwise relationships. The paper also describes comparing class means with an idealized arrangement in which classes are equally separated, while cautioning that real classes need not have that structure.

In everyday terms, these checks ask whether examples group tightly, whether class groups are distinguishable, and whether their arrangement changes between datasets. They capture different properties, so no single measure answers all of these questions.

Two image-classification tests

The author evaluates ViT-S vision-transformer models in two settings. In the first, different checkpoints are tested on CIFAR-10 after training on CINIC-10, with CIFAR-10 images excluded from training. The reported results do not show a simple, steadily worsening trend: by epoch 99, training accuracy is near perfect while test accuracy has improved only modestly, and several measures indicate a difference between the training and test embeddings. By epoch 999, test accuracy has risen further and some alignment measures have improved, while the training–test accuracy gap is smaller than at epoch 99. The paper presents these changing patterns as evidence that embedding measures can track aspects of the generalization gap—the difference between training and test performance.

The second experiment compares two models pretrained on ImageNet-1K and evaluated on ImageNetV2. The model with higher test accuracy shows less mismatch between training and test embeddings under several reported measures. For the weaker model, test embeddings appear separable by class even though its existing classification layer performs poorly on them. To investigate this, the author removes the original layer, freezes the encoder and trains a replacement classifier using ImageNetV2 labels. The paper reports 95% accuracy after 50 epochs.

That retraining is a diagnostic demonstration, not a valid test-time evaluation or a deployment recipe: it uses labels from the test dataset. Its purpose is to illustrate that an encoder’s representations and a classifier’s decision layer can have different levels of transferability.

What the evidence can—and cannot—show

The examples suggest that embedding analysis can add information not apparent from loss-landscape or Hessian analysis alone in these cases. They do not establish that embedding divergence causes poor generalization, or that these measures will predict performance in other settings. The reported experiments concern ViT-S models and image-classification datasets; conclusions should be kept within that scope.

Interpretation also depends on what is compared and how. Some measures describe cluster spread or margins, while others compare class arrangements. Normalization and the choice of reference distribution matter. An association between embedding alignment and accuracy can help characterize model behavior, but it does not by itself explain why representations shifted or identify a dependable fix.

The paper presents an update to an existing library and demonstrates its functions through two case studies. It is an arXiv preprint; the supplied source does not establish its peer-review status. The practical idea is to inspect not only training performance and loss geometry, but also whether a model’s internal class structure remains useful when the data changes.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.