SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability

Maithra Raghu, Justin Gilmer, Jason Yosinski, Jascha Sohl-Dickstein

Deep neural networks are famously effective but notoriously opaque. When two different models achieve the same accuracy, are they "thinking" the same way? If we look at a single layer, how much of its activity is actually useful information versus random noise?

In their NIPS 2017 paper, researchers from Google Brain, Cornell, and Uber AI Labs introduced SVCCA (Singular Vector Canonical Correlation Analysis)—a powerful tool designed to compare neural representations across different layers, time steps, and even entirely different architectures.

TL;DR

SVCCA combines Singular Value Decomposition (SVD) and Canonical Correlation Analysis (CCA) to create a fast, transform-invariant method for comparing neural network representations. It reveals that networks converge from the "bottom-up" (lower layers first) and that the useful information in a layer often resides in a tiny fraction of its total neurons.

What Problem Does This Paper Address?

The core challenge in deep learning interpretability is that neural representations are distributed. A single "concept" isn't usually held by one neuron; it’s spread across many. Furthermore, if you train two identical networks from different random starts, their neurons will be in different orders and have different scaling, making direct comparison impossible.

Previous methods were either too slow, specific to certain architectures, or sensitive to simple linear transformations (like scaling or rotation). We needed a way to compare the subspaces learned by layers—essentially asking if two layers are looking at the same features, even if they describe them using a different "coordinate system."

Methods

The authors propose a two-step process called SVCCA:

  1. SVD (Singular Value Decomposition): First, they take the activation vectors of a layer and perform SVD. This identifies the directions of maximal variance and allows them to strip away "noise"—the low-variance directions that don't contribute much to the network's output. In practice, they keep enough directions to explain 99% of the variance.
  2. CCA (Canonical Correlation Analysis): Next, they use CCA to linearly transform the remaining subspaces so they are as aligned as possible. This makes the comparison invariant to affine transformations (scaling, rotation, and translation).

To handle the massive computational requirements of Convolutional Neural Networks (CNNs), the authors introduced a Discrete Fourier Transform (DFT) optimization. By moving to the frequency domain, they turned massive covariance matrices into smaller, block-diagonal ones, making the analysis of large ImageNet-scale models feasible.

Datasets

The researchers validated SVCCA across several setups:

  • CIFAR-10: Used with standard Convolutional Networks and ResNets.
  • ImageNet: Used with a ResNet-50 to study class-specific learning.
  • Toy Regression Task: A simple four-layer fully connected network used for intuitive visualizations of the method.

Key Insights and Ideas

  • Intrinsic Dimensionality is Low: One of the most striking findings is that a layer with 512 neurons might only need 25 "directions" (dimensions) to maintain its full accuracy. This suggests massive over-parameterization in modern networks.
  • Bottom-Up Convergence: By comparing layers at different points during training to their final state, the authors found that networks solidify their representations from the input layer upwards. The early layers finish learning their features long before the final layers do.
  • Freeze Training: Based on the bottom-up insight, the authors proposed "Freeze Training"—sequentially freezing lower layers during the training process. This not only saves significant computation (no gradients needed for frozen layers) but can also act as a form of regularization, improving generalization.
  • Semantic Sensitivity: SVCCA can measure when a network becomes "sensitive" to a specific class. For example, a ResNet learns to distinguish "firetrucks" much earlier in its architecture than it learns to distinguish between two similar breeds of terriers.

Key Results

  • Compression: In a fully connected layer with 512 neurons, projecting the output onto just the top 25 SVCCA directions resulted in almost no loss in accuracy.
  • Efficiency: The DFT-based SVCCA allowed for the comparison of convolutional layers that would otherwise be computationally prohibitive due to the number of neurons.
  • Learning Dynamics: The study showed that while neurons might look completely different across two different random initializations, the SVCCA subspaces they span are nearly identical.
SVCCA aligns representations across different networks

As seen in the figure above, while individual highest-activating neurons (b) and top SVD directions (c) differ significantly between two identically trained networks (maroon vs. green), SVCCA successfully aligns their underlying subspaces (d), proving they learned the same fundamental representations.

Limitations and Future Work

While SVCCA is a leap forward, it has some constraints:

  • Dataset Dependency: The representation of a neuron is defined by its response to a specific dataset. If the dataset is biased or too small, the SVCCA results might not reflect the "true" functional form of the neuron.
  • Linearity: CCA is a linear method. While it handles affine transformations well, it might miss highly non-linear relationships between layers.
  • Architecture Scope: While the authors showed results for CNNs and ResNets, the behavior of newer architectures like Transformers remains a fertile ground for SVCCA analysis.

By providing a mathematical "bridge" between different neural representations, SVCCA remains a foundational tool for researchers trying to understand why deep learning works and how we can make it more efficient.

Summary updated

BibTeX
@inproceedings{raghu2017svcca,
  author = {Maithra Raghu and Justin Gilmer and Jason Yosinski and Jascha Sohl-Dickstein},
  title = {{SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=Hk4HIvW_WS},
}
Figure