Time series patterns reveal neural network internal changes during training
What Can a Time Series of Loss, Weight Norm, or Neuron Activation Reveal About a Neural Network?
Machine Learning
Summary
When training a neural network, it's common to track numbers like loss or weight size over time, but it's unclear what those numbers tell us about the network’s inner changes. The authors show that by analyzing the complexity of these time series using a mathematical method called the MacKay-Ghahramani estimator, they can gain insights about what the network is learning or how it adapts. For example, they found that neural activities become simpler for certain tasks or that specific training techniques affect weight updates and performance. This method also helps in choosing better performing encoders without relying on labeled data.
What this means in practice
- •For machine learning engineers: Use intrinsic dimension estimates of loss or gradients to monitor and interpret neural network training progress and internal changes.
- •For ai model developers: Select better unsupervised feature encoders by comparing the intrinsic dimensionality of their gradient norms late in training to improve downstream classification.
Authors
Nickolay Karlov, Alexey Kravatskiy
Abstract
It is easy to record the loss or weight norm at each step of neural network training. Can one such time series reveal what is changing inside the network? For a scalar quantity $x$ recorded over time, we form delay vectors from samples taken at fixed time lags. We estimate the local intrinsic dimension of their distribution with the MacKay-Ghahramani (MG) variant of the Levina-Bickel estimator, which pools log ratios of nearest-neighbor distances across the delay vectors. We call this estimate the MG of $x$. After a recurrent network learns periodic motion, MG from the activation time series of one hidden neuron is close to one, as expected for a periodic orbit. In ResNet-18, freezing the feature extractor lowers the MG of the weight norm and concentrates weight updates in fewer directions. In a text variational autoencoder, the MG of reconstruction loss on fixed sentences is lower under settings where the decoder relies less on the latent code. We also use MG to select among candidate encoders trained on unlabeled MNIST digits with SimCLR, SimSiam, BYOL, and VICReg. For each frozen encoder, we fit a logistic regression classifier to predict digit labels from its features. In initial experiments, the MG of the gradient norm late in training correlated positively with classifier accuracy across encoders. When we selected the encoder with the highest MG of the gradient norm in each held-out run, its test accuracy averaged only 0.41 percentage points below the maximum for that set of encoders.