TL;DR
This paper argues that the widely-used Centered Kernel Alignment (CKA) metric for comparing deep learning representations is inadequate, often producing counterintuitive results. The authors demonstrate that CKA can assign high similarity to representations with differing functional behaviors and can be manipulated to show low similarity even when functional behavior is preserved, questioning its reliability for drawing conclusions about model similarity.
What Problem Does This Paper Address?
Understanding how deep neural networks learn and represent information is a fundamental challenge. A key tool for this is measuring the similarity between the internal representations of different layers within a network, or between different networks. The Centered Kernel Alignment (CKA) metric, particularly its linear variant, has become the de facto standard for this task due to its perceived superiority over older methods. However, the authors of this paper question whether CKA truly captures meaningful similarity, especially when it comes to preserving functional behavior. They highlight a gap in our understanding: does a high CKA score reliably indicate that two representations are functionally similar, and can we trust CKA to reflect genuine differences when the score is low?
Methods
The paper investigates the limitations of linear CKA through a series of experiments.
- Counterintuitive Similarity: They compare representations from networks trained to generalize, "memorize" (with random labels), and randomly initialized networks. Despite high CKA scores between early layers of the generalized and memorized networks, the actual learned filters are drastically different, suggesting CKA doesn't reflect functional similarity here.
- Sensitivity to Affine Transformations: The authors create artificial representations and apply transformations like translation and invertible linear transformations. They show that CKA scores drop significantly even when these transformations preserve the underlying structure and separability of the data, indicating CKA is overly sensitive to geometric changes.
- Preserving Functional Behavior While Manipulating CKA: They devise methods to modify representations. Specifically, they translate data points in a way that preserves linear separability (and thus, likely, classification accuracy) but observe a drastic drop in CKA. They also explore manipulating the "CKA map" (a matrix of CKA values between all layer pairs) of a trained network to either maximize or minimize inter-layer similarity, finding that performance is only slightly affected, suggesting CKA can be manipulated without significant functional impact.
Datasets
- CIFAR10: Used for training and evaluating the generalized network in Section 3.1.
- Artificial Datasets: Generated for experiments on sensitivity to affine transformations (Section 3.2), including points sampled from unit cubes and multivariate Gaussians.
Key Insights and Ideas
- CKA is not a reliable proxy for functional similarity: High CKA scores between representations of networks trained differently (e.g., generalization vs. memorization) do not necessarily mean their learned features are functionally alike.
- CKA is overly sensitive to geometric transformations: Even simple translations that preserve data structure and separability can lead to very low CKA scores, implying CKA doesn't robustly capture semantic similarity.
- CKA can be manipulated: It's possible to alter representations to achieve very low or very high CKA values without significantly impacting the network's performance on its task. This suggests CKA might not be a fundamental measure of representation quality or similarity.
- The "CKA map" can be misleading: Manipulating the CKA map to enforce specific inter-layer similarity patterns can be done with minimal performance degradation, further questioning the inherent meaning of these CKA values.
Key Results
- In Section 3.1, early layers of a generalized network and a "memorized" network showed high CKA values, but their convolution filters were drastically different.
- In Section 3.2, translating artificial data points by small distances caused CKA values to drop below 0.2, despite preserving topological structure and local geometry. Similarly, invertible linear transformations led to CKA scores dropping to 0, even when representations were only slightly changed.
- In Section 3.3, translating data points to preserve linear separability (achieving >90% accuracy with an SVM) resulted in CKA values dropping to 0.
- In Section 3.4, manipulating the CKA map to maximize similarity between the first and last layers, or between all layers, resulted in only a slight loss in performance (e.g., accuracy dropping from 85.9% to 84.8% or 82.9%), contradicting previous findings that suggested such manipulations would severely impact performance.
Limitations and Future Work
- Theoretical Understanding: The authors acknowledge the need for a more theoretical understanding of CKA's sensitivity to various transformations.
- Alternative Measures: They encourage researchers to explore other similarity measures and data analysis/visualization techniques beyond CKA.
- Validation of Existing Conclusions: They suggest investigating whether conclusions drawn from previous studies using CKA would hold if analyzed with alternative methods.
Summary updated