Centered Kernel Alignment (CKA) has become the go-to metric for comparing the internal representations of different neural networks. However, recent research reveals it has severe blind spots. By mathematically proving and empirically demonstrating that CKA is highly sensitive to outliers and simple data shifts, researchers have shown that a network's CKA profile can be easily manipulated to mimic entirely different architectures—without altering its actual predictive performance.
The Problem: Peeking into the Black Box
As deep learning models grow larger and more complex, researchers increasingly want to peek inside the "black box" to understand how they work. A common way to do this is by comparing the internal representations (activations) of different models. For example, one might ask, "Does a Vision Transformer learn the same features as a CNN?" or "Do wide networks learn differently than deep ones?"
Recently, a metric called Centered Kernel Alignment (CKA)—specifically its linear variant—has become the gold standard for quantifying these similarities. It has been used in numerous high-profile papers to draw sweeping conclusions about model behavior.
This paper questions the reliability of CKA. The authors investigate whether CKA actually captures meaningful functional similarities, or if it can be easily fooled by trivial differences in data geometry that don't affect how the network performs its task.
Methodology
The authors tackle the reliability of CKA through theoretical proofs, empirical experiments, and novel optimization techniques:
- Theoretical Analysis: They mathematically formalize how linear CKA reacts to "subset translation"—a simple transformation where a subset of data points is shifted in a specific direction within the representation space.
- Empirical Testing: They test CKA on artificial datasets and real Convolutional Neural Networks (CNNs) trained on CIFAR-10 to see how sensitive the metric is to outliers and data shifts in practice.
- CKA Map Optimization: To prove that CKA doesn't dictate model behavior, they set up a novel training objective. They take a trained network and continue training it using a distillation loss (to ensure final predictions don't change) combined with a CKA map loss (forcing its layer-by-layer CKA similarity grid to match an arbitrary target map).
Key Insights and Discoveries
Extreme Sensitivity to Outliers
The math proves—and experiments confirm—that linear CKA is incredibly sensitive to outliers. Moving just a single data point out of tens of thousands in the representation space can cause the CKA similarity score between two otherwise identical networks to plummet to zero.
As shown above, translating just a single class (or even a single point) in the latent space successfully drives the CKA value from nearly 1.0 down to 0.0 as the translation distance increases.
Functional Equivalence $\neq$ CKA Similarity
You can shift a group of representations in a way that perfectly preserves how a linear classifier would separate them. This maintains the exact same decision boundaries and margins.
Even though the features are functionally identical for a classification task (as the decision boundary remains valid), CKA will claim the representations are completely dissimilar because the underlying geometry of the points has shifted.
The "Early Layer" Illusion
Networks trained on real data, networks trained to memorize random labels, and completely untrained networks all show high CKA similarity in their early layers. However, looking at their actual convolution filters reveals they are learning drastically different (and differently useful) features. High CKA does not necessarily mean features are equally useful.
CKA Maps are a Mirage
Researchers often use "CKA maps" (heatmaps showing how similar layer $i$ is to layer $j$) as a signature of an architecture. The authors showed you can explicitly optimize a network to have any CKA map—like forcing a wide ResNet to have the signature of a thin ResNet, or even drawing pixel-art patterns in the heatmap—without changing the network's accuracy.
When optimizing a network to adopt completely unnatural CKA maps, the network maintained its performance. For example, a model's accuracy only dropped trivially from 85.9% to 85.4% on CIFAR-10, despite its internal CKA map being entirely rewritten. Furthermore, these manipulated CKA maps persisted even when the network was fed completely different, out-of-distribution data (Patch Camelyon), proving the manipulation permanently altered the network's geometric signature without breaking its logic.
Limitations and Future Directions
While the theoretical proofs in the paper apply specifically to linear CKA, the authors demonstrate empirically that non-linear (RBF kernel) CKA suffers from similar vulnerabilities. Formal mathematical bounds for the non-linear case remain an area for future work.
Additionally, the subset translations used to break CKA in the experiments were manually induced. While these shifts can happen organically during training, it is hard to quantify exactly how often this specific phenomenon occurs "in the wild."
Ultimately, the authors strongly caution against relying solely on CKA to compare models. Future research should utilize a diverse suite of similarity metrics (like orthogonal Procrustes or activation sparsity) and visualization techniques to get a more robust, holistic understanding of neural representations.
Summary updated