Towards Understanding Learning Representations: To What Extent Do Different Neural Networks Learn the Same Representation

Liwei Wang, Lunjia Hu, Jiayuan Gu, Zhiqiang Hu, Yue Wu, Kun He, John E. Hopcroft

Introduction

Do two identical neural networks, trained on the same data but starting from different random seeds, "see" the world the same way? While we know deep neural networks are highly effective, they remain famously opaque "black boxes." A long-standing debate in artificial intelligence is whether internal representations are local (where one neuron detects one specific feature, like a "cat ear") or distributed (where a group of neurons collectively represent a concept).

Previous studies have attempted to compare networks using heuristic methods, such as looking for one-to-one correlations between individual neurons. However, these methods often fail because neural layers are followed by affine transformations (linear shifts and scaling). If Network A learns a feature in one neuron, and Network B learns the exact same feature but distributed and scaled across three neurons, a simple one-to-one comparison will incorrectly conclude they are different.

This paper introduces a rigorous, transformation-invariant mathematical framework called neuron activation subspace match to quantitatively characterize and compare what representations deep neural networks actually learn.

A New Metric: Neuron Activation Subspace Match

To overcome the limitations of one-to-one neuron comparisons, the authors propose modeling similarity as a subspace match.

  1. Activation Vectors: For every neuron, the researchers record its output (activation) across a set of input images. This creates a high-dimensional vector representing that neuron's unique "signature."
  2. Subspace Spanning: Instead of comparing individual neurons, the method examines the subspace spanned by a cluster of neurons. If the subspace of a cluster in Network A matches a cluster in Network B, they have captured the same information—even if the individual neurons are organized differently.
  3. Theoretical Framework: The paper defines two core concepts:
  4. Maximum Match: The largest possible set of neurons in both networks that represent the same overall information.
  5. Simple Match: The "atomic" units of similarity; the finest, smallest groups of neurons that cannot be broken down further into smaller matches.

To apply this theory, the authors developed polynomial-time algorithms (max_match, min_match, and all_min_match) to efficiently find these overall and fine-grained similarities.

Experimental Findings: The "U-Shaped" Similarity

The researchers evaluated their framework using popular architectures (VGG16, ResNet18, and ResNet34) on standard benchmarks (CIFAR-10 and ImageNet). To ensure findings weren't anomalies of a single training run, they trained five differently initialized versions of each network.

Surprisingly, the authors discovered that internal representations in convolutional layers are far less similar than previously assumed.

Maximum matching similarity across layers for CIFAR10-ResNet18 and ImageNet-VGG16.
  • The "U-Shaped" Curve: As seen in the figure above, similarity is highest at the very beginning (input) and the very end (output) of the networks. However, the middle layers—where the "heavy lifting" of feature extraction occurs—show surprisingly low similarity, often dropping to nearly zero.
  • Input/Output Constraints: The high similarity at the network boundaries is likely a "forced" coincidence. The first layers are strictly constrained by the raw pixels of the same input data, while the final layers are constrained by the need to predict the exact same labels.
  • Representations are Highly Unique: The near-zero similarity in intermediate layers suggests there are many different, equally valid ways for a network to represent the same complex features. Two networks can achieve identical, high accuracy while utilizing totally different internal "languages."
  • Evidence for Distributed Representations: When analyzing "simple matches" (the atomic units of similarity), the authors found very few small-sized matches. This indicates that when networks do agree, they agree across large, complex clusters of neurons, strongly supporting the theory that information is highly distributed rather than localized in single "grandmother cells."

Implications and Future Directions

The vanishing similarity in intermediate layers acknowledges a provocative possibility: Is subspace match the right metric? If two networks perform identically but exhibit zero subspace similarity, it raises a philosophical question about whether a universal "representation" even exists in a way that can be measured linearly across different models.

Future work could investigate whether other metrics, such as non-linear mappings, might uncover hidden similarities that linear subspaces miss. Additionally, while this study focuses on networks with identical architectures, comparing entirely different architectures (e.g., VGG vs. ResNet) remains a significant and exciting challenge for the field of representation learning.

Summary updated

BibTeX
@inproceedings{wang2018towards,
  author = {Liwei Wang and Lunjia Hu and Jiayuan Gu and Zhiqiang Hu and Yue Wu and Kun He and John E. Hopcroft},
  title = {{Towards Understanding Learning Representations: To What Extent Do Different Neural Networks Learn the Same Representation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
  url = {https://openreview.net/forum?id=SJWRXwZdZr},
}
Figure