The Local Elasticity of Neural Networks

Hangfeng He, Weijie J. Su

Neural networks possess a unique property called local elasticity: when you update a model's weights based on one data point, the predictions only change significantly for "similar" points, leaving distant points mostly unaffected. This phenomenon helps explain why massive neural networks don't catastrophically overfit, and it can even be leveraged to build surprisingly effective clustering algorithms.

The Problem: Global Leverage vs. Local Learning

Deep learning is full of mysteries. One of the biggest is why neural networks—which often have millions more parameters than training examples—don't just "break" or overfit wildly when we update them.

In classical statistics, linear models suffer from the leverage effect. If you have a line of best fit and you move one data point far out on the edge, the entire line tilts. A single update can have a massive global impact. Neural networks, however, seem to learn "locally." If you teach a network what a "Persian Cat" looks like, it shouldn't suddenly forget what a "Truck" looks like. The authors of this paper formally define this "local" behavior and explore the mechanism that distinguishes neural networks from the rigid linear models of the past.

Defining Local Elasticity

The researchers introduce the concept of Local Elasticity. A classifier is locally elastic if an update at an input $x$ significantly impacts the prediction at $x'$ only if $x'$ is in the "local vicinity" of $x$.

To measure this, they propose two similarity measures:

  1. Relative Similarity ($S_{rel}$): This looks at the ratio of the change in prediction at a test point $x'$ versus the change at the training point $x$ after one step of Stochastic Gradient Descent (SGD).
  2. Kernelized Similarity ($S_{ker}$): This links the phenomenon to the Neural Tangent Kernel (NTK). It essentially measures the inner product of the gradients of the model's output with respect to its weights at two different points.

They then turn this theory into a Clustering Algorithm. By training a network to distinguish between a "primary" superclass (e.g., mammals) and an "auxiliary" class (e.g., vehicles), they record how the predictions of all mammal images change relative to one another. Because of local elasticity, two different "cats" will see their predictions move together, while a "cat" and a "dog" will move less. This allows the model to discover sub-clusters purely through training dynamics.

Key Insights and Results

The authors validated their hypothesis across a wide range of data, from synthetic geometric shapes (1D cosine functions, 2D tori, double helices) to real-world image datasets like MNIST, CIFAR-10, and ImageNet.

Non-linearity is the Secret Sauce

Linear classifiers are "rigid." Because they lack non-linear activation functions, an update anywhere propagates everywhere. In contrast, the "on/off" nature of ReLU neurons in a deep net means that only a specific subset of neurons "fires" for a specific region of the input space, creating a natural buffer.

Comparison of non-linear and linear networks on synthetic datasets.

In synthetic tests (like the torus and folded boxes shown above), the correlation between the distance between points and their "relative change" was as high as -0.97 for non-linear networks. As geodesic distance increased, the impact of an update dropped off sharply and monotonically. Linear networks, however, failed to exhibit this localized drop-off.

The "Aha!" Moment for Generalization

Local elasticity explains why networks can "memorize" noisy or random labels without destroying their ability to generalize on clean data. The "damage" from fitting a weird, noisy point is contained to a small local neighborhood.

Furthermore, the paper shows that the process of learning is itself a similarity metric. Most similarity measures (like Euclidean distance) are static. Local elasticity is dynamic—it depends on the current state of the weights and the path of the SGD optimizer. We don't just need to look at where points sit in space; we can look at how they "react" together when the model is nudged.

Clustering Performance

Their local elasticity-based clustering outperformed standard K-means and PCA on difficult MNIST and CIFAR-10 pairs. For example, on the "5 vs 8" MNIST task, their method achieved 75.9% accuracy, while standard K-means sat at roughly random chance (~50%). While the effect is strongest in deep CNNs, it was also observed in simple Feed-Forward Networks (FNNs) and across different activation functions.

Limitations and Future Work

  • Theoretical Gap: While the authors provide a geometric interpretation via the NTK for two-layer networks, a rigorous mathematical proof for very deep, complex architectures remains an open challenge.
  • Computational Cost: The clustering algorithm requires tracking prediction changes for many pairs of points during training, which can be computationally expensive compared to static methods.
  • Auxiliary Data Dependency: The clustering method relies on having an "auxiliary" dataset from a different superclass, and the choice of this data can impact the quality of the resulting clusters.
  • The "Elasticity" Limit: The paper focuses on the existence of this property. Future work could explore how to increase local elasticity to make models more robust to adversarial attacks or better at "continual learning" (learning new tasks without forgetting old ones).

Summary updated

Abstract

This paper presents a phenomenon in neural networks that we refer to as \textit{local elasticity}. Roughly speaking, a classifier is said to be locally elastic if its prediction at a feature vector $\bx'$ is \textit{not} significantly perturbed, after the classifier is updated via stochastic gradient descent at a (labeled) feature vector $\bx$ that is \textit{dissimilar} to $\bx'$ in a certain sense. This phenomenon is shown to persist for neural networks with nonlinear activation functions through extensive simulations on real-life and synthetic datasets, whereas this is not observed in linear classifiers. In addition, we offer a geometric interpretation of local elasticity using the neural tangent kernel \citep{jacot2018neural}. Building on top of local elasticity, we obtain pairwise similarity measures between feature vectors, which can be used for clustering in conjunction with $K$-means. The effectiveness of the clustering algorithm on the MNIST and CIFAR-10 datasets in turn corroborates the hypothesis of local elasticity of neural networks on real-life data. Finally, we discuss some implications of local elasticity to shed light on several intriguing aspects of deep neural networks.
BibTeX
@inproceedings{he2020local,
  author = {Hangfeng He and Weijie J. Su},
  title = {{The Local Elasticity of Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure