Similarity of Neural Network Representations Revisited
About
Recent work has sought to understand the behavior of neural networks by comparing representations between layers and between different trained models. We examine methods for comparing neural network representations based on canonical correlation analysis (CCA). We show that CCA belongs to a family of statistics for measuring multivariate similarity, but that neither CCA nor any other statistic that is invariant to invertible linear transformation can measure meaningful similarities between representations of higher dimension than the number of data points. We introduce a similarity index that measures the relationship between representational similarity matrices and does not suffer from this limitation. This similarity index is equivalent to centered kernel alignment (CKA) and is also closely connected to CCA. Unlike CCA, CKA can reliably identify correspondences between representations in networks trained from different initializations.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Cross-Lingual Knowledge Alignment | BMLAMA | Pearson Correlation0.828 | 48 | |
| Zero-Shot Cross-Lingual Transfer | XNLI | Pearson Correlation0.8944 | 48 | |
| Network Similarity Identification | CIFAR-10 (test) | Noise Proportion100 | 36 | |
| OOD Detection | CIFAR-10 vs SVHN (test) | Accuracy96.25 | 19 | |
| Image Classification | MNIST (test) | FGSM Accuracy72.6 | 18 | |
| Pearson correlation analysis | m-ARC | Pearson Correlation0.8333 | 13 | |
| Rank correlation between representation similarity and prediction accuracy similarity | CIFAR-10-C (test) | Spearman's Rho0.15 | 12 | |
| OOD Detection | Dirty-MNIST vs Fashion MNIST (test) | NLL0.377 | 10 | |
| Cross-lingual transferability | FLORES | Avg Pearson Correlation0.6804 | 6 | |
| Multilingual performance | FLORES | Avg Pearson Correlation0.7596 | 6 |