acceptodds
Under review as a conference paper at ICLR 2027

Linear CKA Conflates Class-Mean and Within-Class Agreement: An Exact Covariance Decomposition on Labeled Benchmarks

Abstract

Linear centered kernel alignment (CKA) is a widely used measure of similarity between neural network representations, and it is commonly evaluated on labeled benchmarks. Its first step, global centering, removes the dataset-wide mean but not the offset of each class mean from it. A high CKA score can come from two networks placing the same classes in the same regions of feature space, even when they arrange the images inside each class in unrelated ways. Splitting each representation into orthogonal between-class and within-class components decomposes the cross-covariance matrix in the CKA numerator, and the two self-covariance matrices in its denominator, exactly into a between-class and a within-class term, whose squared Frobenius norms combine with a signed interference term. A constructive example makes ordinary CKA arbitrarily close to 1 while within-class CKA remains exactly 0, so a high score alone does not establish within-class agreement. Across four backbones and four labeled datasets, the final-depth gap between ordinary and within-class CKA is positive in all 24 (model pair, dataset) combinations, ranging from 0.022 to 0.273, with a positive interference term throughout. After projecting both representations to a common 64 dimensions, the gap exceeds every value of a 100-permutation label-shuffling null, at the floor empirical and Benjamini-Hochberg adjusted , while a random balanced partition of matching granularity reduces it to near zero. The overlap between the class subspace and each backbone's dominant principal-component subspace exceeds a random-subspace null by factors of six to five hundred. On ImageNet-1K, replacing ordinary CKA with within-class CKA moves the global maximum of the cross-depth heatmap for four of six model pairs, so class-mean structure can change the layer correspondence such a heatmap reports.

Primary area:
interpretability and explainable AI
Keywords:
representation similarity, centered kernel alignment, CKA, representation analysis, class-mean structure, within-class representations, neural representations, layer correspondence

Reviews

Among:
Shape:
1234this paper, Top 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.33 over 3 reviews, above 51% of the others.
Reviewer_Z5HzOpenReview ↗
Rating
2
Confidence
4
Informativeness
2
Presentation
2
Soundness
3
Read review
Paper summary

CKA is a measure for the similarity of representations, e.g., those learned by different neural networks or those between different layers of a single network. The central hypothesis of the paper is that CKA is obscured by the grouping of inputs into different labeled classes. The paper proposes to decompose the similarities into within and between class similarities and correspondingly decompose the calculation of CKA into these two components. The results demonstrate that the between class variation may have a significant impact on the calculated CKA measure.

Critical strengths

The paper presents novel insights that help understand the properties of CKA, which is a widely used method for investigating representation similarities.

Critical weaknesses

The novelty is somewhat limited by the fact that Cui et al. (2022) already demonstrated that the population structure of the dataset confounds CKA computation. In the light of that, the main claim of the present paper, that the population structure caused by class labels affects the calculation of CKA, seems somewhat incremental. The paper would benefit from including some convincing examples where the method makes a concrete, interpretable difference on the results not achievable with previous methods.

For a paper whose topic is similarities of representations between images, it is a clear minus that the paper itself does not include any illustrative visualizations. The writing could also be clearer (starting with the title and the abstract).

Questions for authors

Suggestion: the general audience would likely benefit from introducing the background of CKA, which now comes in Section 3, already earlier.

Suggestion: it would be good to include some illustrative visualizations.

Suggestion: a more in-depth analysis of some real-world examples, ideally from multiple domains (image, text, ...), and a comparison with the closest alternatives, would have been useful.

5 comments

We sincerely thank Reviewer Z5Hz for the expert review, for recognizing that the paper offers novel insight into a widely used measure, and for concrete suggestions on comparisons, domains, and presentation. We followed every suggestion with new experiments on the same features.

W1. Relation to Cui et al. (2022), and differences no previous method gives

Cui et al. regress the representation similarity matrix on an input-space similarity matrix. We ran their dCKA on our features with two confounders, the 32x32 pixel similarity and the same-class indicator, on stratified 5,000-image subsets that reproduce the full-set best depth pairs of CKA and CKAw\text{CKA}_w (Appendix A.18, Tables 16 and 17). Best-matching depth pair of the 4x4 grid:

ImageNet-1K pairCKAdCKA (pixel)dCKA (label)per-class CKA, debiased (Kornblith)CKAw\text{CKA}_w
RN18 vs CNXT(2,1)(2,1)(2,1)(1,1)(1,1)
RN18 vs DINO(3,2)(3,2)(3,2)(1,1)(1,1)
CNXT vs EffB0(1,2)(1,2)(1,2)(1,1)(1,1)
EffB0 vs DINO(2,2)(2,2)(2,2)(2,2)(1,1)
  1. Deconfounding does not remove class-mean agreement. With the pixel confounder dCKA stays within 0.025 of CKA and keeps CKA's best depth pair in 23 of 24 combinations, and with the label confounder in 24 of 24. Regressing on a similarity matrix removes a single fitted component of the Gram matrix, while PP removes the whole class-mean configuration, including which classes lie near which. Only CKAw\text{CKA}_w moves the ImageNet-1K correspondence.
  2. The structure we isolate is semantic, not input-space population structure. The decomposition applies to any partition. Pixel-space k-means with as many clusters as classes gives Δ≤0.07\Delta \le 0.07 and random partitions 0.000, while k-means clusters computed from a third backbone, without labels, give a Δ\Delta as large as the labels do (CIFAR-100, 0.19 to 0.25 against 0.17 to 0.20; Appendix A.13). The effect follows the semantic groups that networks share, and the method extends to unlabeled evaluation sets.
  3. A test no previous method supports. Because B=Xb⊤ZbB = X_b^\top Z_b makes the class-mean configuration explicit, it can be permuted in one network with everything else fixed. This lowers ordinary CKA by 45% to 85% in all 24 combinations while CKAw\text{CKA}_w is unchanged, and Δ\Delta turns negative in 24 of 24. Positive Δ\Delta thus measures agreement on where the classes sit, which a confounder regression cannot express.

Suggestion. Multiple domains

Four text encoders (BERT, RoBERTa, MiniLM, MPNet), mean-pooled tokens at four relative depths, up to 1000 test examples per class, final layer (Appendix A.17, Table 15).

dataset (classes)Δ\DeltaCKAb\text{CKA}_bshuffle CKAb\text{CKA}_bbest depth pair changes
AG-News (4)+0.096 to +0.1570.975–0.9990.805–0.8562 of 6
DBpedia-14 (14)+0.220 to +0.3010.875–0.9810.522–0.6193 of 6
20-Newsgroups (20)-0.026 to +0.0740.841–0.9810.206–0.4380 of 6

The effect transfers to text, including changes of the best depth pair. 20-Newsgroups adds an instructive case. Δ\Delta is near zero although the class means agree closely, which is the situation of Proposition 3 and is visible only through the decomposition.

W2 and suggestions. Visualization and clarity

Thank you for this suggestion. The revised PDF adds Figure 1 on page 2. Panel (a) shows two toy networks that place four classes identically and arrange the inputs inside each class in unrelated orders, giving CKA = 0.89 and CKAw\text{CKA}_w = 0. Panel (b) scales the shared class component of Proposition 2, driving CKA to 0.969 while CKAw\text{CKA}_w stays 0. Panel (c) shows the one-sided shuffle on real features for all four datasets, where CKA falls while CKAw\text{CKA}_w stays fixed. The CKA definition now appears in the first paragraph of the introduction, the abstract opens with the two agreements CKA mixes, and all figures were redrawn with larger text.

We hope these results address your concerns, and we would be glad to provide any further analysis during the discussion.

We are following up on our response of November 7, about ten days ago, and thank you again for the review and its concrete suggestions. We have not heard back, and before the discussion closes we would like to know whether the comparison with deconfounded CKA, the new Figure 1, and the text experiments are what you had in mind. If something is still missing, please tell us. The main points follow.

The idea of the paper is easiest to see in Figure 1(a) of the revised PDF. Two toy networks place four classes identically and order the inputs around each class mean in unrelated ways. Their CKA is 0.89. After each class mean is subtracted, which defines within-class CKA (CKAw\mathrm{CKA}_w), the value is 0. A CKA value on a labeled dataset thus mixes two agreements, whether two networks place the classes alike and whether they arrange the individual inputs around the class means alike. The paper proves how the two combine and measures each on real networks.

W1. Relation to Cui et al. (2022)

Cui et al. regress an input-similarity matrix out of each representation (dCKA). We applied dCKA to our features with two confounders, pixel similarity and the same-class indicator. With the pixel confounder dCKA stays within 0.025 of ordinary CKA, and with either confounder it keeps the layer correspondence of ordinary CKA (23 of 24 and 24 of 24 combinations of model pair and dataset, Appendix A.18). The class effect remains even when the labels themselves are supplied, because the two adjustments differ in form. dCKA fits one coefficient per similarity matrix, which with the label confounder encodes only whether two inputs share a class. CKAw\mathrm{CKA}_w removes every class mean, and with them the whole arrangement of the classes, including which classes lie near which.

Results that CKA and dCKA do not give

  1. Which models are most alike. At the final layer on ImageNet-1K, ordinary CKA ranks ResNet-18 and DINO ViT-S as the most similar of the six model pairs (0.417, ahead of ConvNeXt-Tiny and EfficientNet-B0 at 0.366), and dCKA keeps this order. That pair also has the largest gap between CKA and CKAw\mathrm{CKA}_w. Once class means are removed, the two convolutional networks rank first (0.344 against 0.206).
  2. Which layers correspond. For ResNet-18 versus ConvNeXt-Tiny, ordinary CKA and both dCKA variants report depths (2,1) as the most similar pair of layers, and CKAw\mathrm{CKA}_w reports (1,1). When the two networks are joined at these layers through a small trained layer (model stitching), the choice of CKAw\mathrm{CKA}_w keeps 0.967 of the target accuracy against 0.868. The most similar pair changes for four of six model pairs, in 98% to 100% of 1000 resamples of the classes. The bias-corrected per-class average of Kornblith et al. (2019) agrees with CKAw\mathrm{CKA}_w on three of the four, and stitching favors the within-class choice for the two convolutional pairs and the ordinary choice for the two pairs with the ViT.
  3. Where the class effect comes from. Swapping the class means among the classes in one network, with each image kept at the same position relative to its class mean, lowers CKA by 45% to 85% in all 24 combinations and leaves CKAw\mathrm{CKA}_w unchanged. The effect therefore comes from the two networks agreeing on class placement, which neither CKA nor dCKA can test.
  4. No evaluation labels needed. Clusters computed from a third network give a gap between CKA and CKAw\mathrm{CKA}_w as large as the labels do (0.19 to 0.25 against 0.17 to 0.20 on CIFAR-100), clusters of pixels give at most 0.069, and random groups give 0.000.

W2 and suggestions

The revised PDF adds Figure 1 on page 2, which shows the toy case above, the construction in which CKA rises to 0.969 while CKAw\mathrm{CKA}_w stays at 0, and the swap on real features for all four datasets. The definition of CKA now appears in the first paragraph of the introduction, and the abstract opens with the two agreements. We kept the title as submitted for the discussion period and would gladly adopt a plainer one. For a second domain we added four text encoders (BERT, RoBERTa, MiniLM, MPNet) on three text classification datasets. The gap is +0.096 to +0.157 on AG-News and +0.220 to +0.301 on DBpedia-14, and the most similar pair of layers changes for 5 of 18 encoder pairs.

We hope this addresses your concerns and suggestions.

Thank you for your rebuttal! I have read it and we will discuss with the other reviewers. The new experiments show that the method produces results different from other methods but I don't see it demonstrated clearly that the changes are for the better. Also, the illustration presented in Figure 1 is perhaps too simplistic to be very helpful. For now, I keep my original score.

Reviewer_wKg8OpenReview ↗
Rating
3(+1)
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

The authors investigate how class-level information structure affects linear CKA when comparing neural network representations. The idea is that two networks can exhibit a high CKA even when they organize examples in quite different ways, because part of this similarity can be explained by the class structure.

What the authors propose is to derive an exact decomposition of CKA into between-class and within-class components and propose CKA_w, calculated only on the residuals within each class and removing the contribution of class means.

The paper presents experiments using four architectures and four datasets. The results show positive differences between standard CKA and CKA_w across all the 24 evaluated configurations. Another point is the authors argue that removing class-level information can change layer correspondence what is very interesting. The proposed approach is a diagnostic tool for interpreting similarity metrics of representations.

Critical strengths
  • I found that the mathematical formulation presented is correct, the content is clearly presented, and the proposal is supported by numerical verification in experiments.

  • I liked that CKA_w is computationally simple. It can also be incorporated into the existing representation similarity analyses without additional model training. This is very useful and interesting because the computational cost is controlled.

  • The authors performed experiments covering different architectures and modes, also different datasets (including ImageNet). They also provide experimental ablations and conduct diagnostic analyses to try to understand the results.

  • I think it is a relevant methodological issue for modern architectures that is interpreting representation similarity without distinguishing class-level structure from within-class agreement.

Critical weaknesses
  • Besides the interesting approach and results I found the novelty limited as within-class CKA was previously explored by Kornblith et al. (2019). Related approaches in the literature to removing confounding information already exist and are used. A positive point is that the theoretical decomposition proposed is correct but not far from what we already have and is straightforward.

  • In my opinion the used statistical controls do not help with the central claim. I think label permutations demonstrate that class information is present in the representations, which seems clear, but I don't get how it establishes agreement between the class structures of two models. I think independent representations also could produce positive differences of similar magnitude.

  • This is something for the authors reflection, since the CKA_b operates on a small number of classes and means in high-dimensional spaces. When we have few samples and many dimensions, its value can be artificially high. So sanity checks with independent class means produce values close to those reported in the paper, particularly for datasets with few classes.

  • Another point is really interesting but maybe overstated as it is related to the layer correspondence. Since several changes in the maximum CKA location involve differences of only 0.01–0.02 (the authors could also add uncertainty estimates). As you show in the A.7 the actual layer-wise correspondence changes in only 1 out of 16 cases. If I understand correctly, removing class information changes the magnitude of similarity scores more than the correspondence between layers. I think it is an opportunity to clarify this distinction and evaluate the stability of the changes.

  • Please explain why removing principal components produces larger reductions in CKA than removing class structure. I think the observed effect is related to class information or to dominant variance directions. There is an opportunity to explore that.

  • The experiments need more comparisons between independently trained instances of the same architecture, that strategy will help to establish generality and reconcile the findings with previous work.

Questions for authors

I think some answers may help readers to understand the results better. For instance:

  • What happens to CKA_b and the reported differences when class identities are permuted in only one representation? Have the authors considered a debiased estimate of CKA_b?

  • Considering the results presented by Kornblith et al. (2019) how do you reconcile its findings with the within-class CKA experiments?

  • Why does removing the leading principal components reduce CKA substantially more than removing class structure?

  • Do the conclusions hold for independently trained models of the same architecture?

4 comments

We sincerely thank Reviewer wKg8 for the detailed and constructive review. The one-sided permutation and the debiased CKAb\text{CKA}_b you proposed became our most informative new experiments. All results below use the same features (all 24 values in the paper reproduce within 0.0001).

W2/W3/Q1. One-sided class shuffle, independent class means, and debiased CKAb\text{CKA}_b

We ran this test. In ZZ only, the class means are permuted across classes (1000 permutations) or replaced by independent Gaussian means with ZZ's between-class spectrum or an isotropic one (200 samples). Every within-class residual stays fixed, which leaves CKAw\text{CKA}_w unchanged. Final depth, ranges over six pairs:

datasetCKAb\text{CKA}_bdebiased CKAb\text{CKA}_bshuffle mean [95th pct]indep. Gaussian (spectrum / iso)Δ\DeltaΔ\Delta under shuffle
CIFAR-100.857–0.9630.800–0.9720.41–0.55 [≤0.69]0.35–0.44 / 0.61–0.75+0.176 to +0.273-0.117 to -0.044
CIFAR-1000.797–0.8980.796–0.8870.10–0.19 [≤0.21]0.09–0.18 / 0.32–0.43+0.175 to +0.196-0.232 to -0.166
Food-1010.695–0.9290.680–0.9220.09–0.14 [≤0.16]0.09–0.13 / 0.29–0.36+0.078 to +0.194-0.238 to -0.108
ImageNet-1K0.249–0.7150.234–0.7160.02–0.10 [≤0.10]0.02–0.09 / 0.12–0.22+0.022 to +0.211-0.222 to -0.045
  • Independent class means do not reach the observed values. The observed CKAb\text{CKA}_b exceeds the 95th percentile of the shuffle null by at least 0.22 in every combination (p=0.001p = 0.001, the floor for 1000 permutations). The highest of these baselines, isotropic means with 10 classes, gives 0.61 to 0.75 against 0.86 to 0.96 observed. The revision reports all baselines in Section 5.3 and Table 9. Debiasing changes CKAb\text{CKA}_b by at most 0.06, and debiased CKA, CKAw\text{CKA}_w, and Δ\Delta change by at most 0.008.
  • They also give negative differences, not positive ones, in 24 of 24 combinations. The decomposition explains why. Between-class variance always enters the CKA denominator, while it enters the numerator through B=Xb⊤ZbB = X_b^\top Z_b, whose norm is large only when the two class-mean configurations align. A positive Δ\Delta therefore requires the two networks to place the same classes in corresponding positions. The label permutation in the paper tests whether Δ\Delta depends on the label grouping, and the one-sided shuffle tests whether it depends on the two networks agreeing on that grouping. Both hold.
  • Effect size. With every within-class residual fixed, the shuffle lowers ordinary CKA by 45% to 85% (CIFAR-10 RN18 vs CNXT from 0.679 to 0.308).

W4. Uncertainty of the layer correspondence

A class-level bootstrap (1000 resamples, full 4x4 grids) shows that the four ImageNet-1K changes are stable. The CKA choice is kept in 98% to 100% of resamples, the CKAw\text{CKA}_w choice in 100%, and the two differ in 98% to 100%. The margin of CKAw\text{CKA}_w over its second-best depth pair is 0.009 [0.004, 0.015] (RN18 vs CNXT), 0.057 [0.053, 0.060] (RN18 vs DINO), 0.038 [0.033, 0.044] (CNXT vs EffB0), and 0.021 [0.018, 0.024] (EffB0 vs DINO), and every 95% interval excludes zero. Ordinary CKA's own margin is borderline only for CNXT vs EffB0 (0.008 [0.000, 0.015]).

Thank you for drawing the distinction with A.7, which the revised Section 5.4 makes explicit together with these intervals (Appendix A.14, Table 12). Removing class-mean structure changes similarity magnitudes in every combination, and magnitudes are what CKA comparisons report (for independently trained seeds, 0.935 against a within-class 0.675, see W6). Per-depth assignments are largely preserved, consistent with Kornblith et al. (2019), while the global maximum, the summary usually read from a heatmap and the subject of our layer claim, changes in 4 of 6 ImageNet-1K pairs.

(continued in Part 2/2)

W5/Q3. Why removing leading PCs lowers CKA more than removing class structure

Two facts combine.

  1. At matched rank k=c−1k = c-1, the top-kk PCA subspace carries more variance than any other rank-kk subspace (Ky Fan), and CKA weights each pair of directions by the product of their eigenvalues, which makes these directions dominate it (Nguyen et al., 2022). Removing them removes at least as much variance as removing the class subspace and more of the directions CKA weights most.
  2. The class subspace overlaps the top-kk subspace only partly (0.098 to 0.475). Against a stricter null of random rank-kk subspaces drawn inside each representation's own span (new, Section 5.3, Appendix A.3, Table 4, Figure 3), the overlap is 17 to 72 times the null mean on CIFAR-10 and 2.3 to 6.3 times on CIFAR-100 and Food-101. The class subspace is enriched in dominant directions without coinciding with them, and removing PP leaves much dominant variance in place (CIFAR-10 RN18 vs CNXT, PCA-removed CKA 0.314 vs. CKAw\text{CKA}_w 0.406; CIFAR-100, 0.116 vs. 0.399).

The effect is therefore related to both, and the controls separate them. Removing a same-rank subspace defined by permuted labels or random partitions gives ∣Δ∣|\Delta| of at most 0.0036. Removing the dominant subspace removes class and non-class variance together. Removing PP removes the class-mean part alone, and Proposition 1 quantifies it. On ImageNet-1K, k=d−1k = d-1 for three backbones and the top-kk subspace nearly fills the feature span, which is why PCA-removed CKA falls near zero there.

W6/Q4. Independently trained models of the same architecture

Five CIFAR-10 ResNet-18s trained from different initializations (test accuracy 92.9% to 93.5%), all 10 pairs, final depth (Appendix A.16, Table 14).

evaluation setCKACKAb\text{CKA}_bCKAw\text{CKA}_wΔ\DeltaΔ\Delta under shufflebest depth pair (CKA / CKAw\text{CKA}_w)nearest layer (CKA / CKAw\text{CKA}_w)
CIFAR-100.935–0.9370.996–0.9980.673–0.679+0.257 to +0.262-0.043 to -0.036(1,1) / (1,1)identity / identity
CIFAR-100 (transfer)0.776–0.7800.984–0.9880.640–0.647+0.132 to +0.138-0.381 to -0.372(1,1) / (1,1)identity / identity

The conclusions hold. Δ\Delta is positive in all 10 pairs and as large as across architectures on CIFAR-10 (+0.176 to +0.273), reflecting nearly identical class means (CKAb\text{CKA}_b of 0.997) and much weaker agreement within classes.

W1/Q2. Novelty relative to Kornblith et al. (2019) and reconciliation

Kornblith et al. (Figure F.7) average CKA computed inside each CIFAR-10 class and find it similar to CKA on all examples (our comparison is in Appendix A.18, Table 16). We reproduce this wherever it applies. Across the seeds, CKA and CKAw\text{CKA}_w select the same best depth pair and the identity layer assignment, and for all 18 architecture pairs on CIFAR-10, CIFAR-100, and Food-101, CKA, CKAw\text{CKA}_w, and debiased per-class CKA select the same best depth pair. The decomposition adds three things a per-class average does not provide: the split of the value into class placement and within-class agreement (for the seeds, a CKA of 0.935 comes with CKAb\text{CKA}_b of 0.997 and CKAw\text{CKA}_w of 0.675), the cross term that makes the one-sided test above possible, and a pooled estimate. On ImageNet-1K, with 50 images per class, debiasing lowers the per-class average by 0.12 to 0.19, and debiased per-class CKA agrees with CKAw\text{CKA}_w on 3 of the 4 changed pairs. The two results are therefore compatible. Within-class analysis preserves the layer correspondence across seeds and on datasets other than the pretraining one, and it changes the global correspondence across architectures on ImageNet-1K and on two text datasets.

We hope these results address your concerns, and we would be glad to provide any further analysis during the discussion.

We are following up on our two-part response of November 7, about ten days ago. Thank you again for the detailed review. The test you proposed, shuffling the classes in one network only, and the debiased estimate became the central new experiments of the revision. We have not heard from you since, and before the discussion closes we would welcome a short note on whether they settle your concerns, or which concern remains open. The main points follow in prose, without the tables.

Three quantities are used below. Within-class CKA (CKAw\mathrm{CKA}_w) is CKA after every class mean is subtracted, and it measures whether two networks arrange the images around their class means alike. Between-class CKA (CKAb\mathrm{CKA}_b) is CKA of the class means alone, and it measures whether the two networks place the classes alike. Δ=CKA−CKAw\Delta = \mathrm{CKA} - \mathrm{CKA}_w is the gap between ordinary and within-class CKA.

W2, Q1. Does a positive gap show agreement between the class structures of the two networks?

Your review pointed out that our label-permutation control shows only that class information is present in each network, and that two networks with unrelated class structure might give a similar positive gap. Shuffling one network only, as you proposed, tests this.

Network A is left untouched. In network B the class means are swapped among the classes at random (1000 permutations), and each image keeps its position relative to its own class mean. Network B keeps the same between-class and within-class variance, and only the correspondence between its class arrangement and that of network A is lost. If the gap reflected only the presence of class information in each network, it would stay positive. Its average becomes negative in 24 of 24 combinations of model pair and dataset, the observed gap lies above the 95th percentile of the shuffled gaps in all 24, and CKA itself falls by 45% to 85%. Independent Gaussian class means with the same covariance also give a negative average gap in all 24.

The decomposition gives the reason. Between-class variance always enters the denominator of CKA, because it is part of the total variance of each network. It enters the numerator only through the term that pairs the class means of the two networks, which is large only when the two arrangements line up. Unrelated class structures therefore lower CKA relative to CKAw\mathrm{CKA}_w on average, and the positive gap we observe requires the two networks to agree on where the classes sit.

W3. Few class means in a high-dimensional space

You were right that CKAb\mathrm{CKA}_b can be high by chance when the classes are few, and the revision reports the chance level beside every value (Table 9). With 10 classes (CIFAR-10), shuffled class means give 0.41 to 0.55 on average, and random means spread equally in all directions give 0.61 to 0.75. The observed values are 0.86 to 0.96. With 1000 classes (ImageNet-1K) the shuffled level is 0.02 to 0.10 and the observed values are 0.249 to 0.715. In each of the 24 combinations the observed value lies above all 1000 shuffles. The debiased estimator you suggested changes CKAb\mathrm{CKA}_b by at most 0.06, and CKA, CKAw\mathrm{CKA}_w, and Δ\Delta by at most 0.008.

W4. Stability of the change in layer correspondence

We resampled the ImageNet-1K classes 1000 times. For the four model pairs whose most similar pair of layers changes, ordinary CKA and CKAw\mathrm{CKA}_w pick different pairs in 98% to 100% of resamples. Under CKAw\mathrm{CKA}_w the top pair leads the second by 0.009 [0.004, 0.015], 0.057 [0.053, 0.060], 0.038 [0.033, 0.044], and 0.021 [0.018, 0.024], and every 95% interval excludes zero.

Your reading of Appendix A.7 (A.8 in the revised PDF) is correct. For a given layer of one network, the closest layer of the other is largely the same with and without class means, consistent with Kornblith et al. (2019). What changes is the single most similar pair of layers over the whole grid, in four of six model pairs on ImageNet-1K, together with the value of the score in every combination (the gap ranges from 0.022 to 0.273). These two effects are what the paper claims, and Section 5.4 of the revision reports the first with the stability results above.

(continued in 2/2)

(2/2)

W5, Q3. Class information or dominant variance directions?

Both are involved, as you suspected, and two results separate them.

The shuffle in part 1 leaves the covariance matrix of network B unchanged, and with it every principal direction and its variance. CKA still falls by 45% to 85%. The class contribution to CKA therefore does not come from high-variance directions as such. It comes from the class arrangements of the two networks matching.

A larger drop from removing the top kk principal components is expected for a separate reason. These are the kk directions with the most variance, CKA weights directions by their variance (Nguyen et al., 2022), and removing them deletes class and non-class information together. The class directions are related to the top directions without being the same. Their overlap is 0.098 to 0.475, which is 17 to 72 times the overlap of random directions inside the same feature space on CIFAR-10 and 2.3 to 6.3 times on CIFAR-100 and Food-101 (Table 4). On ImageNet-1K the top-kk subspace nearly fills the feature space of three backbones, and the comparison is uninformative there (1.00 to 1.18 times). Subtracting class means removes the class part alone, and Proposition 1 states what that part contributes. Removing a subspace defined by permuted labels or by random groups of images changes CKA by at most 0.0036.

W6, Q4. Independently trained networks of the same architecture

We trained five ResNet-18 networks on CIFAR-10 from different random initializations (test accuracy 92.9% to 93.5%) and compared all 10 pairs at the last layer. CKA is 0.935 to 0.937, CKAw\mathrm{CKA}_w is 0.673 to 0.679, and the gap is +0.257 to +0.262, comparable to the gaps across architectures on CIFAR-10 (+0.176 to +0.273). With only ten classes the shuffled CKAb\mathrm{CKA}_b stays high for these networks (0.89 to 0.90 against 0.996 to 0.998 observed), the situation your W3 describes, and the informative quantity is the gap, which falls from about +0.26 to about -0.04 under the shuffle. On CIFAR-100, which the networks never saw in training, CKAb\mathrm{CKA}_b is 0.984 to 0.988 against 0.05 after the shuffle, and the gap is +0.132 to +0.138. The conclusions therefore hold for independently trained networks. Both measures select the same most similar pair of layers and match every layer to its own depth in all 10 pairs, as earlier work found.

W1, Q2. Relation to Kornblith et al. (2019)

Kornblith et al. (Appendix F.7) computed CKA inside each CIFAR-10 class, averaged over classes, and found the result similar to CKA on all examples. Our results agree wherever the two overlap. On CIFAR-10, CIFAR-100, and Food-101, and across the five networks above, removing class means leaves the most similar pair of layers unchanged. On ImageNet-1K their per-class average, once corrected for small-sample bias, moves three of the four changed pairs to the same layers as CKAw\mathrm{CKA}_w, which supports the finding with an independent estimate.

The decomposition adds what a second number cannot. It states how the full score is built from the between-class and within-class parts. It contains the term that pairs the class means of the two networks, which made the shuffle test possible. And it gives one estimate over all images, which matters when classes are small. With 50 images per class on ImageNet-1K, the bias correction lowers the per-class average by 0.12 to 0.19 and changes CKAw\mathrm{CKA}_w by at most 0.008.

We hope this resolves the concerns raised in your review.

Reviewer_JfUPOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
3
Soundness
3
Read review
Paper summary

This paper investigates how class-mean structure influences linear Centered Kernel Alignment (CKA) when comparing neural network representations on labeled datasets. The authors propose an exact decomposition of the cross-covariance and self-covariance matrices underlying linear CKA into between-class and within-class components, including a signed interference term. Based on this decomposition, they consider within-class CKA obtained by removing the class-mean components from both representations.

The paper provides a constructive example showing that ordinary CKA can approach 1 even when within-class CKA is zero. Experiments across four neural network backbones and four datasets demonstrate that ordinary CKA generally exceeds within-class CKA. Additional statistical controls, including label permutations, random partitions, and bootstrap analyses, support the observation that the difference is associated with class-label structure. The authors also show that removing class-mean components changes the globally best-matching layer pair for four of six model pairs on ImageNet-1K.

Critical strengths
  1. Clear mathematical analysis. The paper provides an exact decomposition of the cross-covariance and self-covariance matrices underlying linear CKA into between-class and within-class components. The constructive example showing that ordinary CKA can approach 1 while within-class CKA remains zero clearly illustrates an important limitation in interpreting representation similarity.

  2. Systematic empirical evaluation. The experiments cover multiple architectures and labeled datasets, including ImageNet-1K. The use of label permutations, random partitions, and bootstrap analyses strengthens the empirical findings. In particular, the observation that removing class-mean structure can change the best-matching layer pair provides a potentially useful insight for representation similarity analysis.

Critical weaknesses
  1. Limited theoretical novelty. The proposed decomposition follows directly from the orthogonality of the between-class and within-class projections, which is closely related to the classical decomposition of feature variability in linear discriminant analysis. Moreover, previous work has already investigated within-class CKA and the influence of population structure on representation similarity. Although the exact decomposition of cross-covariance matrices and the interference term provide a useful perspective, the mathematical results appear relatively straightforward. It is unclear whether the proposed framework offers substantially new theoretical insights beyond existing approaches to representation similarity analysis.

  2. The practical implications of within-class CKA are not sufficiently established. The paper demonstrates that removing class-mean structure changes CKA values and sometimes changes the best-matching layer pair. However, class-level information is an important and meaningful component of learned representations, rather than necessarily an undesirable confounding factor. Therefore, a lower within-class CKA score does not by itself imply that ordinary CKA provides a misleading assessment of representation similarity. Furthermore, although the globally best-matching depth pair changes for four of six model pairs on ImageNet-1K, Appendix A.7 shows that most per-depth nearest-layer assignments remain unchanged. The paper would benefit from stronger evidence demonstrating when within-class CKA provides a more meaningful or reliable interpretation than ordinary CKA.

Questions for authors
  1. Regarding the novelty of the proposed decomposition: The between-class and within-class decomposition is closely related to classical covariance decomposition, and prior work has considered within-class CKA and deconfounded representation similarity. Could the authors clarify the main theoretical insights that are not captured by these existing approaches? In particular, what additional understanding or practical capability does the signed interference term provide?

  2. Regarding the interpretation of within-class CKA: Since class-mean structure represents meaningful discriminative information learned by neural networks, why should its contribution to ordinary CKA necessarily be considered a confounding factor? Can the authors provide additional evidence, potentially through functional similarity measures or controlled experiments, showing situations in which within-class CKA provides a more informative assessment of representation similarity than ordinary CKA?

  3. Regarding the depth-matching results: The paper reports that the globally best-matching layer pair changes for four of six model pairs on ImageNet-1K. However, Appendix A.7 indicates that most per-depth nearest-layer assignments remain unchanged, and the global best-matching pairs do not change on the other evaluated datasets. Could the authors further clarify the practical significance and stability of these changes? In particular, are the differences between the best and second-best layer matches statistically significant?

5 comments

We sincerely thank Reviewer JfUP for the careful, fair review, for finding the decomposition clear and the evaluation systematic, and for three focused questions, each of which led to a new experiment on the same features (all 24 paper values reproduce within 0.0001).

Q1/W1. What the decomposition adds beyond LDA and prior work

LDA splits the covariance of one representation. Our term B=Xb⊤ZbB = X_b^\top Z_b is a cross product of the class-mean configurations of two networks and has no single-representation analogue. A new experiment isolates it by permuting, in one network, which class mean belongs to which class while every within-class residual stays fixed. Since all four datasets are class-balanced, the LDA split (ΣB\Sigma_B, ΣW\Sigma_W, ρ\rho) of both networks is unchanged, yet ordinary CKA falls by 45% to 85% in all 24 combinations (e.g., from 0.679 to 0.308 on CIFAR-10 RN18 vs CNXT; Figure 1c, Section 5.3). Any per-representation decomposition is identical before and after, and only the cross term separates the two.

Proposition 3 gives a capability a single gap lacks. On 20-Newsgroups (new text result), Δ\Delta is -0.026 to +0.074 although the encoders' class means agree closely (CKAb\text{CKA}_b 0.84 to 0.98, shuffle 0.21 to 0.44). The gap alone suggests no class effect, while the decomposition shows aligned class means entering the numerator and both denominators in near proportion, the case of Proposition 3.

On identical features, Cui et al.'s dCKA (pixel or label confounder) keeps ordinary CKA's best depth pair in all four ImageNet-1K pairs where CKAw\text{CKA}_w moves it. Kornblith et al.'s per-class average (50 images per class) drops by 0.12 to 0.19 once debiased, while the pooled CKAw\text{CKA}_w changes by at most 0.008 (Appendix A.18).

Q2/W2. When is CKAw\text{CKA}_w more informative?

We share this view, and it is why the paper says "conflates" and not "confounds". Because class-mean structure is meaningful, mixing it with within-class agreement in one number matters, and CKAb\text{CKA}_b with CKAw\text{CKA}_w separates the two (revised Section 6). Two controlled settings show where this changes the conclusion.

  • Same within-class geometry, different class placement. The shuffle above lowers ordinary CKA by up to 85% with CKAw\text{CKA}_w unchanged. CKA alone cannot tell this from a loss of within-class agreement, and (CKAb\text{CKA}_b, CKAw\text{CKA}_w) can.
  • Same architecture, different seeds (five CIFAR-10 ResNet-18s, 93% accuracy). CKA is 0.935, which reads as near-identical networks, while CKAb\text{CKA}_b = 0.997 and CKAw\text{CKA}_w = 0.675. The seeds agree almost perfectly on class placement and much less on how images are arranged within classes.

Functional test (new, Appendix A.15). ImageNet-1K model stitching (1x1 convolution, 25 training and 25 test images per class, accuracy relative to the target network).

pairCKA choicestitch acc.CKAw\text{CKA}_w choicestitch acc.
RN18 vs CNXT(2,1)0.868(1,1)0.967
CNXT vs EffB0(1,2)0.805(1,1)0.971
RN18 vs DINO(3,2)0.886(1,1)0.761
EffB0 vs DINO(2,2)0.980(1,1)0.274

For the two CNN pairs, the within-class choice moves to the matched-depth diagonal and gains 0.099 and 0.166, and for the two pairs with the ViT the ordinary choice stitches better. Grid-level rank correlations are similar (0.49 to 0.75 for CKA, 0.41 to 0.79 for CKAw\text{CKA}_w). Functional compatibility thus draws on both components, which a single CKA value cannot separate and the decomposition reports.

Q3. Stability and significance

Class-level bootstrap (new, 1000 resamples of the full 4x4 grids; Section 5.4, Appendix A.14).

ImageNet-1K pairP(CKA kept)P(CKAw\text{CKA}_w kept)P(differ)CKAw\text{CKA}_w margin over 2nd [95% CI]
RN18 vs CNXT1.001.001.000.009 [0.004, 0.015]
RN18 vs DINO1.001.001.000.057 [0.053, 0.060]
CNXT vs EffB00.981.000.980.038 [0.033, 0.044]
EffB0 vs DINO1.001.001.000.021 [0.018, 0.024]

The margin of CKAw\text{CKA}_w is significant in all four pairs and that of ordinary CKA in three, and in the fourth (CNXT vs EffB0, 0.008 [0.000, 0.015]) the two measures still differ in 98% of resamples. The change also occurs in 5 of 18 text-encoder pairs (AG-News, DBpedia-14), while on CIFAR-10, CIFAR-100, and Food-101 the two choices coincide for all 18 pairs.

On practical significance, the two results answer different questions. The per-depth assignment (the closest layer to a given layer) is largely preserved, consistent with Kornblith et al. (2019). The global maximum (the most similar layer pair overall, the summary usually read from a heatmap) changes stably in the cases above, and it is what the paper's claim refers to.

We hope these results answer your questions and would be glad to provide further analysis during the discussion.

We are writing again about ten days after our response of November 7. Thank you once more for the careful review. We have not heard back yet, and before the discussion closes we would value your view on whether the answers settle your three questions. A one-line note on whichever point remains open would be enough for us to respond. The main points follow.

In short, a CKA value on a labeled dataset mixes two agreements between networks. One is whether they place the classes alike (cats near dogs, far from trucks), and the other is whether they arrange the individual images around each class mean alike. The first alone can drive CKA toward 1 while the second is zero. Within-class CKA (CKAw\mathrm{CKA}_w) is CKA after every class mean is subtracted, and it measures the second.

Q1. What the decomposition adds to LDA and to earlier within-class analyses

The derivation is short, as you note, and its value lies in what the terms are. LDA describes one network at a time. The between-class term of our decomposition pairs the class means of network A with those of network B, and no statistic of a single network contains it.

A test shows that CKA responds to this term. In network B we swap the class means among the classes (the cat mean moves to where the truck mean was) and keep each image's position relative to its own class mean. The covariance matrix of network B is unchanged, and with it every LDA quantity. CKA between A and B still falls by 45% to 85% in all 24 combinations of model pair and dataset. No description of either network alone changes, and only the between-class term does.

The per-class average of Kornblith et al. (2019) and the deconfounded CKA of Cui et al. (2022) each give a second number, and neither relates that number to CKA or contains this term. On the same features, deconfounded CKA keeps the best-matching layer pair of ordinary CKA in all four ImageNet-1K cases where CKAw\mathrm{CKA}_w moves it.

The signed interference term closes the identity. The numerator of CKA equals the between-class part plus the within-class part plus this term, which is positive when the two parts point the same way, as in all 24 combinations, and negative when they oppose. The decomposition also explains a case that the difference CKA−CKAw\mathrm{CKA} - \mathrm{CKA}_w alone misreads. On 20-Newsgroups this difference is small (-0.026 to +0.074), which suggests that class structure plays no role. Yet the class means of the text encoders agree closely (between-class CKA of 0.84 to 0.98, against 0.21 to 0.44 after the swap). CKA is a ratio, and here the class part raises its numerator and its denominator by offsetting amounts, the kind of offset that Proposition 3 describes.

Q2. Why separate class structure if it is meaningful?

We share this view. Class placement is meaningful, which is why mixing it with a second quantity in one number hides information. Five ResNet-18 networks that differ only in random initialization have a CKA of 0.935 to 0.937 on CIFAR-10, which reads as nearly identical networks. After class means are subtracted the value is 0.673 to 0.679. The score falls by more than a quarter, and a reader of the single number cannot know that.

As a functional test we used model stitching on ImageNet-1K. The early layers of one network are connected to the later layers of another through a small trained layer, and the accuracy that is kept is measured for all 16 pairs of depths. For the four model pairs where CKA and CKAw\mathrm{CKA}_w pick different depth pairs, the within-class pick stitches better for the two convolutional pairs (0.967 vs. 0.868 and 0.971 vs. 0.805) and worse for the two pairs with the vision transformer (0.761 vs. 0.886 and 0.274 vs. 0.980). Neither number alone predicts functional compatibility, which is why the paper reports both.

Q3. Stability and practical significance of the layer-matching change

CKA is often computed for every pair of layers, one from each network, and the pair with the highest value is read as the layers that correspond. On ImageNet-1K this pair changes for four of six model pairs when class means are removed. We resampled the classes 1000 times, and the two measures pick different pairs in 98% to 100% of resamples. Under CKAw\mathrm{CKA}_w the top pair leads the second by a margin whose 95% interval excludes zero in all four cases (the smallest is 0.009 [0.004, 0.015]). The change also appears for 5 of 18 pairs of text encoders. On CIFAR-10, CIFAR-100, and Food-101 the two measures pick the same pair for all 18 model pairs.

Appendix A.7 of the submission (A.8 in the revised PDF) asks a different question, namely which layer of one network is closest to a given layer of the other. That assignment is largely preserved. The claim of the paper concerns the single most similar pair, the summary usually read from a heatmap of these values.

We hope these answers resolve your questions.

A brief update on the revised PDF. Figure 1 has been redrawn as a single overview of the decomposition. The example cited as Figure 1c in our first reply, in which ordinary CKA falls from 0.679 to 0.308 for RN18 vs CNXT on CIFAR-10 when the class means of one network are permuted while within-class CKA stays at 0.406, now appears on the right of Figure 1.

Comments on the paper

1 comment
AuthorsOpenReview ↗

General Response to All Reviewers

We thank all three reviewers for their careful and constructive reviews. The reviews converge on three questions, and we answer each with new experiments on the same features (all 24 values in the paper reproduce within 0.0001).

1. Does a positive Δ\Delta show that two models agree on class structure? (wKg8) In one network we permuted which class mean belongs to which class, leaving every within-class residual and both networks' between/within variance split unchanged. Ordinary CKA falls by 45% to 85% in all 24 combinations, and Δ\Delta becomes negative in 24 of 24. Class-mean structure raises CKA only when two networks place the same classes in corresponding positions. The observed CKAb\text{CKA}_b exceeds the 95th percentile of this null by at least 0.22 in every combination (p=0.001p = 0.001).

2. Are the layer-correspondence changes stable and meaningful? (JfUP, wKg8) The four ImageNet-1K changes recur in 98% to 100% of 1000 class-level bootstrap resamples, and the margin of CKAw\text{CKA}_w over its second-best depth pair has a 95% interval excluding zero in all four. Model stitching shows that each component predicts functional compatibility for different model pairs, which is why the decomposition reports both.

3. What does the decomposition add over LDA, Kornblith et al. (2019), and Cui et al. (2022)? (all) The permutation in point 1 leaves each network's LDA decomposition unchanged, and only the cross term B=Xb⊤ZbB = X_b^\top Z_b detects it. Cui et al.'s dCKA, with a pixel or a label confounder, keeps ordinary CKA's best depth pair in all four ImageNet-1K pairs where CKAw\text{CKA}_w moves it. Kornblith et al.'s per-class average drops by 0.12 to 0.19 on ImageNet-1K once debiased, while debiasing changes the pooled CKAw\text{CKA}_w by at most 0.008.

Further new evidence. Five independently trained ResNet-18s (wKg8), four text encoders on three text classification datasets (Z5Hz), debiased CKAb\text{CKA}_b (wKg8), and projection dimensions from 32 to 256 plus the full space (504 settings, all at the permutation floor).

Revised PDF (uploaded). New Figure 1 with a concept illustration and the one-sided shuffle on real features (Z5Hz, wKg8); the CKA definition in the first paragraph of the introduction (Z5Hz); the one-sided shuffle in Sections 4.2 and 5.3 (wKg8); bootstrap stability, seeds, text encoders, and stitching in Section 5.4 (JfUP, wKg8); a statement in Section 6 that CKAw\text{CKA}_w complements ordinary CKA (JfUP); and Appendices A.12 to A.18 with every new table. All figures were redrawn with larger text from the same data, and the main text stays within 10 pages, with the permutation-null figure in Appendix A.6 and its values in Table 2.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.