Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of...

20
Similarity of Neural Network Representations Revisited Simon Kornblith 1 Mohammad Norouzi 1 Honglak Lee 1 Geoffrey Hinton 1 Abstract Recent work has sought to understand the behav- ior of neural networks by comparing representa- tions between layers and between different trained models. We examine methods for comparing neu- ral network representations based on canonical correlation analysis (CCA). We show that CCA belongs to a family of statistics for measuring mul- tivariate similarity, but that neither CCA nor any other statistic that is invariant to invertible linear transformation can measure meaningful similari- ties 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 simi- larity index is equivalent to centered kernel align- ment (CKA) and is also closely connected to CCA. Unlike CCA, CKA can reliably identify corre- spondences between representations in networks trained from different initializations. 1. Introduction Across a wide range of machine learning tasks, deep neural networks enable learning powerful feature representations automatically from data. Despite impressive empirical ad- vances of deep neural networks in solving various tasks, the problem of understanding and characterizing the neu- ral network representations learned from data remains rel- atively under-explored. Previous work (e.g. Advani & Saxe (2017); Amari et al. (2018); Saxe et al. (2014)) has made progress in understanding the theoretical dynamics of the neural network training process. These studies are insightful, but fundamentally limited, because they ignore the complex interaction between the training dynamics and structured data. A window into the network’s representation can provide more information about the interaction between machine learning algorithms and data than the value of the loss function alone. 1 Google Brain. Correspondence to: Simon Kornblith <skorn- [email protected]>. Proceedings of the 36 th International Conference on Machine Learning, Long Beach, California, PMLR 97, 2019. Copyright 2019 by the author(s). This paper investigates the problem of measuring similari- ties between deep neural network representations. An effec- tive method for measuring representational similarity could help answer many interesting questions, including: (1) Do deep neural networks with the same architecture trained from different random initializations learn similar repre- sentations? (2) Can we establish correspondences between layers of different network architectures? (3) How simi- lar are the representations learned using the same network architecture from different datasets? We build upon previous studies investigating similarity be- tween the representations of neural networks (Laakso & Cottrell, 2000; Li et al., 2015; Raghu et al., 2017; Morcos et al., 2018; Wang et al., 2018). We are also inspired by the extensive neuroscience literature that uses representational similarity analysis (Kriegeskorte et al., 2008a; Edelman, 1998) to compare representations across brain areas (Haxby et al., 2001; Freiwald & Tsao, 2010), individuals (Connolly et al., 2012), species (Kriegeskorte et al., 2008b), and be- haviors (Elsayed et al., 2016), as well as between brains and neural networks (Yamins et al., 2014; Khaligh-Razavi & Kriegeskorte, 2014; Sussillo et al., 2015). Our key contributions are summarized as follows: We discuss the invariance properties of similarity in- dexes and their implications for measuring similarity of neural network representations. We motivate and introduce centered kernel alignment (CKA) as a similarity index and analyze the relationship between CKA, linear regression, canonical correlation analysis (CCA), and related methods (Raghu et al., 2017; Morcos et al., 2018). We show that CKA is able to determine the correspon- dence between the hidden layers of neural networks trained from different random initializations and with different widths, scenarios where previously proposed similarity indexes fail. We verify that wider networks learn more similar repre- sentations, and show that the similarity of early layers saturates at fewer channels than later layers. We demon- strate that early layers, but not later layers, learn similar representations on different datasets. arXiv:1905.00414v4 [cs.LG] 19 Jul 2019

Transcript of Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of...

Page 1: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Simon Kornblith 1 Mohammad Norouzi 1 Honglak Lee 1 Geoffrey Hinton 1

AbstractRecent work has sought to understand the behav-ior of neural networks by comparing representa-tions between layers and between different trainedmodels. We examine methods for comparing neu-ral network representations based on canonicalcorrelation analysis (CCA). We show that CCAbelongs to a family of statistics for measuring mul-tivariate similarity, but that neither CCA nor anyother statistic that is invariant to invertible lineartransformation can measure meaningful similari-ties between representations of higher dimensionthan the number of data points. We introducea similarity index that measures the relationshipbetween representational similarity matrices anddoes not suffer from this limitation. This simi-larity index is equivalent to centered kernel align-ment (CKA) and is also closely connected to CCA.Unlike CCA, CKA can reliably identify corre-spondences between representations in networkstrained from different initializations.

1. IntroductionAcross a wide range of machine learning tasks, deep neuralnetworks enable learning powerful feature representationsautomatically from data. Despite impressive empirical ad-vances of deep neural networks in solving various tasks,the problem of understanding and characterizing the neu-ral network representations learned from data remains rel-atively under-explored. Previous work (e.g. Advani &Saxe (2017); Amari et al. (2018); Saxe et al. (2014)) hasmade progress in understanding the theoretical dynamicsof the neural network training process. These studies areinsightful, but fundamentally limited, because they ignorethe complex interaction between the training dynamics andstructured data. A window into the network’s representationcan provide more information about the interaction betweenmachine learning algorithms and data than the value of theloss function alone.

1Google Brain. Correspondence to: Simon Kornblith <[email protected]>.

Proceedings of the 36 th International Conference on MachineLearning, Long Beach, California, PMLR 97, 2019. Copyright2019 by the author(s).

This paper investigates the problem of measuring similari-ties between deep neural network representations. An effec-tive method for measuring representational similarity couldhelp answer many interesting questions, including: (1) Dodeep neural networks with the same architecture trainedfrom different random initializations learn similar repre-sentations? (2) Can we establish correspondences betweenlayers of different network architectures? (3) How simi-lar are the representations learned using the same networkarchitecture from different datasets?

We build upon previous studies investigating similarity be-tween the representations of neural networks (Laakso &Cottrell, 2000; Li et al., 2015; Raghu et al., 2017; Morcoset al., 2018; Wang et al., 2018). We are also inspired by theextensive neuroscience literature that uses representationalsimilarity analysis (Kriegeskorte et al., 2008a; Edelman,1998) to compare representations across brain areas (Haxbyet al., 2001; Freiwald & Tsao, 2010), individuals (Connollyet al., 2012), species (Kriegeskorte et al., 2008b), and be-haviors (Elsayed et al., 2016), as well as between brainsand neural networks (Yamins et al., 2014; Khaligh-Razavi& Kriegeskorte, 2014; Sussillo et al., 2015).

Our key contributions are summarized as follows:

• We discuss the invariance properties of similarity in-dexes and their implications for measuring similarity ofneural network representations.

• We motivate and introduce centered kernel alignment(CKA) as a similarity index and analyze the relationshipbetween CKA, linear regression, canonical correlationanalysis (CCA), and related methods (Raghu et al., 2017;Morcos et al., 2018).

• We show that CKA is able to determine the correspon-dence between the hidden layers of neural networkstrained from different random initializations and withdifferent widths, scenarios where previously proposedsimilarity indexes fail.

• We verify that wider networks learn more similar repre-sentations, and show that the similarity of early layerssaturates at fewer channels than later layers. We demon-strate that early layers, but not later layers, learn similarrepresentations on different datasets.

arX

iv:1

905.

0041

4v4

[cs

.LG

] 1

9 Ju

l 201

9

Page 2: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Problem Statement

Let X ∈ Rn×p1 denote a matrix of activations of p1 neu-rons for n examples, and Y ∈ Rn×p2 denote a matrix ofactivations of p2 neurons for the same n examples. Weassume that these matrices have been preprocessed to centerthe columns. Without loss of generality we assume thatp1 ≤ p2. We are concerned with the design and analysis ofa scalar similarity index s(X,Y ) that can be used to com-pare representations within and across neural networks, inorder to help visualize and understand the effect of differentfactors of variation in deep learning.

2. What Should Similarity Be Invariant To?This section discusses the invariance properties of similarityindexes and their implications for measuring similarity ofneural network representations. We argue that both intuitivenotions of similarity and the dynamics of neural networktraining call for a similarity index that is invariant to orthog-onal transformation and isotropic scaling, but not invertiblelinear transformation.

2.1. Invariance to Invertible Linear Transformation

A similarity index is invariant to invertible linear transfor-mation if s(X,Y ) = s(XA,Y B) for any full rank A andB. If activations X are followed by a fully-connected layerf(X) = σ(XW + β), then transforming the activationsby a full rank matrix A as X ′ = XA and transforming theweights by the inverse A−1 as W ′ = A−1W preserves theoutput of f(X). This transformation does not appear tochange how the network operates, so intuitively, one mightprefer a similarity index that is invariant to invertible lineartransformation, as argued by Raghu et al. (2017).

However, a limitation of invariance to invertible linear trans-formation is that any invariant similarity index gives thesame result for any representation of width greater than orequal to the dataset size, i.e. p2 ≥ n. We provide a simpleproof in Appendix A.

Theorem 1. Let X and Y be n × p matrices. Suppose sis invariant to invertible linear transformation in the firstargument, i.e. s(X,Z) = s(XA,Z) for arbitrary Z andany A with rank(A) = p. If rank(X) = rank(Y ) = n, thens(X,Z) = s(Y,Z).

There is thus a practical problem with invariance to invert-ible linear transformation: Some neural networks, especiallyconvolutional networks, have more neurons in some layersthan there are examples the training dataset (Springenberget al., 2015; Lee et al., 2018; Zagoruyko & Komodakis,2016). It is somewhat unnatural that a similarity indexcould require more examples than were used for training.

A deeper issue is that neural network training is not invari-

Net A PC 2

Net

A P

C 1

Net B PC 2

Net

B P

C 1

Examples Colored By Net A Principal Components

Figure 1. First principal components of representations of net-works trained from different random initializations are similar.Each example from the CIFAR-10 test set is shown as a dot col-ored according to the value of the first two principal components ofan intermediate layer of one network (left) and plotted on the firsttwo principal components of the same layer of an architecturallyidentical network trained from a different initialization (right).

ant to arbitrary invertible linear transformation of inputsor activations. Even in the linear case, gradient descentconverges first along the eigenvectors corresponding to thelargest eigenvalues of the input covariance matrix (LeCunet al., 1991), and in cases of overparameterization or earlystopping, the solution reached depends on the scale of theinput. Similar results hold for gradient descent trainingof neural networks in the infinite width limit (Jacot et al.,2018). The sensitivity of neural networks training to lineartransformation is further demonstrated by the popularity ofbatch normalization (Ioffe & Szegedy, 2015).

Invariance to invertible linear transformation implies that thescale of directions in activation space is irrelevant. Empiri-cally, however, scale information is both consistent acrossnetworks and useful across tasks. Neural networks trainedfrom different random initializations develop representa-tions with similar large principal components, as shown inFigure 1. Consequently, Euclidean distances between ex-amples, which depend primarily upon large principal com-ponents, are similar across networks. These distances aremeaningful, as demonstrated by the success of perceptualloss and style transfer (Gatys et al., 2016; Johnson et al.,2016; Dumoulin et al., 2017). A similarity index that isinvariant to invertible linear transformation ignores this as-pect of the representation, and assigns the same score tonetworks that match only in large principal components ornetworks that match only in small principal components.

2.2. Invariance to Orthogonal Transformation

Rather than requiring invariance to any invertible lineartransformation, one could require a weaker condition; in-variance to orthogonal transformation, i.e. s(X,Y ) =s(XU, Y V ) for full-rank orthonormal matrices U and Vsuch that UTU = I and V TV = I .

Page 3: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Indexes invariant to orthogonal transformations do not sharethe limitations of indexes invariant to invertible linear trans-formation. When p2 > n, indexes invariant to orthogonaltransformation remain well-defined. Moreover, orthogo-nal transformations preserve scalar products and Euclideandistances between examples.

Invariance to orthogonal transformation seems desirable forneural networks trained by gradient descent. Invariance toorthogonal transformation implies invariance to permuta-tion, which is needed to accommodate symmetries of neuralnetworks (Chen et al., 1993; Orhan & Pitkow, 2018). Inthe linear case, orthogonal transformation of the input doesnot affect the dynamics of gradient descent training (LeCunet al., 1991), and for neural networks initialized with rota-tionally symmetric weight distributions, e.g. i.i.d. Gaussianweight initialization, training with fixed orthogonal trans-formations of activations yields the same distribution oftraining trajectories as untransformed activations, whereasan arbitrary linear transformation would not.

Given a similarity index s(·, ·) that is invariant to orthog-onal transformation, one can construct a similarity indexs′(·, ·) that is invariant to any invertible linear transforma-tion by first orthonormalizing the columns of X and Y ,and then applying s(·, ·). Given thin QR decompositionsX = QARA and Y = QBRB one can construct a similarityindex s′(X,Y ) = s(QX , QY ), where s′(·, ·) is invariant toinvertible linear transformation because orthonormal baseswith the same span are related to each other by orthonormaltransformation (see Appendix B).

2.3. Invariance to Isotropic Scaling

We expect similarity indexes to be invariant to isotropic scal-ing, i.e. s(X,Y ) = s(αX, βY ) for any α, β ∈ R+. Thatsaid, a similarity index that is invariant to both orthogonaltransformation and non-isotropic scaling, i.e. rescaling ofindividual features, is invariant to any invertible linear trans-formation. This follows from the existence of the singularvalue decomposition of the transformation matrix. Gener-ally, we are interested in similarity indexes that are invariantto isotropic but not necessarily non-isotropic scaling.

3. Comparing Similarity StructuresOur key insight is that instead of comparing multivariatefeatures of an example in the two representations (e.g. via re-gression), one can first measure the similarity between everypair of examples in each representation separately, and thencompare the similarity structures. In neuroscience, suchmatrices representing the similarities between examplesare called representational similarity matrices (Kriegesko-rte et al., 2008a). We show below that, if we use an innerproduct to measure similarity, the similarity between repre-

sentational similarity matrices reduces to another intuitivenotion of pairwise feature similarity.

Dot Product-Based Similarity. A simple formula relatesdot products between examples to dot products betweenfeatures:

〈vec(XXT), vec(Y Y T)〉 = tr(XXTY Y T) = ||Y TX||2F.(1)

The elements of XXT and Y Y T are dot products betweenthe representations of the ith and jth examples, and indi-cate the similarity between these examples according to therespective networks. The left-hand side of (1) thus mea-sures the similarity between the inter-example similaritystructures. The right-hand side yields the same result bymeasuring the similarity between features from X and Y ,by summing the squared dot products between every pair.

Hilbert-Schmidt Independence Criterion. Equation 1implies that, for centered X and Y :

1

(n− 1)2tr(XXTY Y T) = ||cov(XT, Y T)||2F. (2)

The Hilbert-Schmidt Independence Criterion (Gretton et al.,2005) generalizes Equations 1 and 2 to inner productsfrom reproducing kernel Hilbert spaces, where the squaredFrobenius norm of the cross-covariance matrix becomesthe squared Hilbert-Schmidt norm of the cross-covarianceoperator. Let Kij = k(xi,xj) and Lij = l(yi,yj) where kand l are two kernels. The empirical estimator of HSIC is:

HSIC(K,L) =1

(n− 1)2tr(KHLH), (3)

where H is the centering matrix Hn = In − 1n11

T. Forlinear kernels k(x,y) = l(x,y) = xTy, HSIC yields (2).

Gretton et al. (2005) originally proposed HSIC as a teststatistic for determining whether two sets of variables areindependent. They prove that the empirical estimator con-verges to the population value at a rate of 1/

√n, and Song

et al. (2007) provide an unbiased estimator. When k andl are universal kernels, HSIC = 0 implies independence,but HSIC is not an estimator of mutual information. HSICis equivalent to maximum mean discrepancy between thejoint distribution and the product of the marginal distribu-tions, and HSIC with a specific kernel family is equivalentto distance covariance (Sejdinovic et al., 2013).

Centered Kernel Alignment. HSIC is not invariant toisotropic scaling, but it can be made invariant through nor-malization. This normalized index is known as centered ker-nel alignment (Cortes et al., 2012; Cristianini et al., 2002):

CKA(K,L) =HSIC(K,L)√

HSIC(K,K)HSIC(L,L). (4)

Page 4: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Invariant toInvertible Linear Orthogonal Isotropic

Similarity Index Formula Transform Transform ScalingLinear Reg. (R2

LR) ||QTYX||2F/||X||2F Y only 3 3

CCA (R2CCA) ||QT

YQX ||2F/p1 3 3 3CCA (ρCCA) ||QT

YQX ||∗/p1 3 3 3SVCCA (R2

SVCCA) ||(UY TY )TUXTX ||2F/min(||TX ||2F, ||TY ||2F) If same subspace kept 3 3SVCCA (ρSVCCA) ||(UY TY )TUXTX ||∗/min(||TX ||2F, ||TY ||2F) If same subspace kept 3 3PWCCA

∑p1i=1 αiρi/||α||1, αi =

∑j |〈hi,xj〉| 7 7 3

Linear HSIC ||Y TX||2F/(n− 1)2 7 3 7Linear CKA ||Y TX||2F/(||XTX||F||Y TY ||F) 7 3 3

RBF CKA tr(KHLH)/√

tr(KHKH)tr(LHLH) 7 3 3∗

Table 1. Summary of similarity methods investigated. QX and QY are orthonormal bases for the columns of X and Y . UX and UY

are the left-singular vectors of X and Y sorted in descending order according to the corresponding singular vectors. || · ||∗ denotes thenuclear norm. TX and TY are truncated identity matrices that select left-singular vectors such that the cumulative variance explainedreaches some threshold. For RBF CKA, K and L are kernel matrices constructed by evaluating the RBF kernel between the examples asin Section 3, and H is the centering matrix Hn = In − 1

n11T. See Appendix C for more detail about each technique.

∗Invariance of RBF CKA to isotropic scaling depends on the procedure used to select the RBF kernel bandwidth parameter. In ourexperiments, we selected the bandwidth as a fraction of the median distance, which ensures that the similarity index is invariant toisotropic scaling.

For a linear kernel, CKA is equivalent to the RV coefficient(Robert & Escoufier, 1976) and to Tucker’s congruence co-efficient (Tucker, 1951; Lorenzo-Seva & Ten Berge, 2006).

Kernel Selection. Below, we report results of CKA witha linear kernel and the RBF kernel k(xi, xj) = exp(−||xi−xj ||22/(2σ2)). For the RBF kernel, there are several possiblestrategies for selecting the bandwidth σ, which controls theextent to which similarity of small distances is emphasizedover large distances. We set σ as a fraction of the mediandistance between examples. In practice, we find that RBFand linear kernels give similar results across most exper-iments, so we use linear CKA unless otherwise specified.Our framework extends to any valid kernel, including ker-nels equivalent to neural networks (Lee et al., 2018; Jacotet al., 2018; Garriga-Alonso et al., 2019; Novak et al., 2019).

4. Related Similarity IndexesIn this section, we briefly review linear regression, canon-ical correlation, and other related methods in the contextof measuring similarity between neural network representa-tions. We let QX and QY represent any orthonormal basesfor the columns of X and Y , i.e. QX = X(XTX)−1/2,QY = Y (Y TY )−1/2 or orthogonal transformations thereof.Table 1 summarizes the formulae and invariance propertiesof the indexes used in experiments. For a comprehensivegeneral review of linear indexes for measuring multivariatesimilarity, see Ramsay et al. (1984).

Linear Regression. A simple way to relate neural net-work representations is via linear regression. One can fit

every feature in X as a linear combination of features fromY . A suitable summary statistic is the total fraction of vari-ance explained by the fit:

R2LR = 1− minB ||X − Y B||2F

||X||2F=||QT

YX||2F||X||2F

. (5)

We are unaware of any application of linear regression tomeasuring similarity of neural network representations, al-though Romero et al. (2015) used a least squares loss be-tween activations of two networks to encourage thin anddeep “student” networks to learn functions similar to wideand shallow “teacher” networks.

Canonical Correlation Analysis (CCA). Canonical cor-relation finds bases for two matrices such that, when theoriginal matrices are projected onto these bases, the cor-relation is maximized. For 1 ≤ i ≤ p1, the ith canonicalcorrelation coefficient ρi is given by:

ρi = maxwiX ,w

iY

corr(XwiX , Ywi

Y )

subject to ∀j<i XwiX ⊥ Xwj

X

∀j<i YwiY ⊥ Ywj

Y .

(6)

The vectors wiX ∈ Rp1 and wi

Y ∈ Rp2 that maximize ρiare the canonical weights, which transform the original datainto canonical variables Xwi

X and YwiY . The constraints

in (6) enforce orthogonality of the canonical variables.

For the purpose of this work, we consider two summary

Page 5: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

statistics of the goodness of fit of CCA:

R2CCA =

∑p1i=1 ρ

2i

p1=||QT

YQX ||2Fp1

(7)

ρCCA =

∑p1i=1 ρip1

=||QT

YQX ||∗p1

, (8)

where || · ||∗ denotes the nuclear norm. The mean squaredCCA correlation R2

CCA is also known as Yanai’s GCD mea-sure (Ramsay et al., 1984), and several statistical pack-ages report the sum of the squared canonical correlationsp1R

2CCA =

∑p1i=1 ρ

2i under the name Pillai’s trace (SAS In-

stitute, 2015; StataCorp, 2015). The mean CCA correlationρCCA was previously used to measure similarity betweenneural network representations in Raghu et al. (2017).

SVCCA. CCA is sensitive to perturbation when the con-dition number of X or Y is large (Golub & Zha, 1995). Toimprove robustness, singular vector CCA (SVCCA) per-forms CCA on truncated singular value decompositions ofX and Y (Raghu et al., 2017; Mroueh et al., 2015; Kuss& Graepel, 2003). As formulated in Raghu et al. (2017),SVCCA keeps enough principal components of the inputmatrices to explain a fixed proportion of the variance, anddrops remaining components. Thus, it is invariant to invert-ible linear transformation only if the retained subspace doesnot change.

Projection-Weighted CCA. Morcos et al. (2018) pro-pose a different strategy to reduce the sensitivity of CCA toperturbation, which they term “projection-weighted canoni-cal correlation” (PWCCA):

ρPW =

∑ci=1 αiρi∑i=1 αi

αi =∑j

|〈hi,xj〉|, (9)

where xj is the jth column of X , and hi = XwiX is the

vector of canonical variables formed by projecting X to theith canonical coordinate frame. As we show in AppendixC.3, PWCCA is closely related to linear regression, since:

R2LR =

∑ci=1 α

′iρ

2i∑

i=1 α′i

α′i =∑j

〈hi,xj〉2. (10)

Neuron Alignment Procedures. Other work has studiedalignment between individual neurons, rather than align-ment between subspaces. Li et al. (2015) examined correla-tion between the neurons in different neural networks, andattempt to find a bipartite match or semi-match that maxi-mizes the sum of the correlations between the neurons, andthen to measure the average correlations. Wang et al. (2018)proposed to search for subsets of neurons X ⊂ X andY ⊂ Y such that, to within some tolerance, every neuronin X can be represented by a linear combination of neu-rons from Y and vice versa. They found that the maximummatching subsets are very small for intermediate layers.

Mutual Information. Among non-linear measures, onecandidate is mutual information, which is invariant not onlyto invertible linear transformation, but to any invertible trans-formation. Li et al. (2015) previously used mutual infor-mation to measure neuronal alignment. In the context ofcomparing representations, we believe mutual informationis not useful. Given any pair of representations produced bydeterministic functions of the same input, mutual informa-tion between either and the input must be at least as large asmutual information between the representations. Moreover,in fully invertible neural networks (Dinh et al., 2017; Jacob-sen et al., 2018), the mutual information between any twolayers is equal to the entropy of the input.

5. Linear CKA versus CCA and RegressionLinear CKA is closely related to CCA and linear regression.IfX and Y are centered, thenQX andQY are also centered,so:

R2CCA = CKA(QXQ

TX , QYQ

TY )

√p2p1. (11)

When performing the linear regression fit of X with designmatrix Y , R2

LR = ||QTYX||2F /||X||2F , so:

R2LR = CKA(XXT, QYQ

TY )

√p1||XTX||F||X||2F

. (12)

When might we prefer linear CKA over CCA? One wayto show the difference is to rewrite X and Y in terms oftheir singular value decompositions X = UXΣXV

TX , Y =

UY ΣY VTY . Let the ith eigenvector of XXT (left-singular

vector of X) be indexed as uiX . Then R2

CCA is:

R2CCA = ||UT

Y UX ||2F/p1 =

p1∑i=1

p2∑j=1

〈uiX ,ujY 〉

2/p1. (13)

Let the ith eigenvalue of XXT (squared singular value ofX) be indexed as λiX . Linear CKA can be written as:

CKA(XXT, Y Y T) =||Y TX||2F

||XTX||F||Y TY ||F

=

∑p1i=1

∑p2j=1 λ

iXλ

jY 〈uiX ,u

jY 〉2√∑p1

i=1(λiX)2√∑p2

j=1(λjY )2.

(14)

Linear CKA thus resembles CCA weighted by the eigen-values of the corresponding eigenvectors, i.e. the amountof variance in X or Y that each explains. SVCCA (Raghuet al., 2017) and projection-weighted CCA (Morcos et al.,2018) were also motivated by the idea that eigenvectorsthat correspond to small eigenvalues are less important, but

Page 6: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

2

4

6

8

Laye

rCCA (R 2

CCA)

0.2

0.3

0.4

0.5

Linear Regression

0.10.20.30.40.50.60.70.80.9

Sim

ilarit

y

2

4

6

8

Laye

r

SVCCA (ρ)

0.3

0.4

0.5

0.6

0.7

0.8SVCCA (R 2

CCA)

0.20.30.40.50.60.7

Sim

ilarit

y

2 4 6 8Layer

2

4

6

8

Laye

r

CKA (Linear)

0.20.30.40.50.60.70.80.9

2 4 6 8Layer

CKA (RBF 0.4)

0.30.40.50.60.70.80.9

Sim

ilarit

y

Figure 2. CKA reveals consistent relationships between layers ofCNNs trained with different random initializations, whereas CCA,linear regression, and SVCCA do not. For linear regression, whichis asymmetric, we plot R2 for the fit of the layer on the x-axis withthe layer on the y-axis. Results are averaged over 10 networks onthe CIFAR-10 training set. See Table 2 for a numerical summary.

linear CKA incorporates this weighting symmetrically andcan be computed without a matrix decomposition.

Comparison of (13) and (14) immediately suggests the pos-sibility of alternative weightings of scalar products betweeneigenvectors. Indeed, as we show in Appendix D.1, the sim-ilarity index induced by “canonical ridge” regularized CCA(Vinod, 1976), when appropriately normalized, interpolatesbetween R2

CCA, linear regression, and linear CKA.

6. Results6.1. A Sanity Check for Similarity Indexes

We propose a simple sanity check for similarity indexes:Given a pair of architecturally identical networks trainedfrom different random initializations, for each layer in thefirst network, the most similar layer in the second networkshould be the architecturally corresponding layer. We train10 networks and, for each layer of each network, we com-pute the accuracy with which we can find the correspondinglayer in each of the other networks by maximum similarity.We then average the resulting accuracies. We compare CKAwith CCA, SVCCA, PWCCA, and linear regression.

Index Accuracy

CCA (ρ) 1.4CCA (R2

CCA) 10.6SVCCA (ρ) 9.9SVCCA (R2

CCA) 15.1PWCCA 11.1Linear Reg. 45.4Linear HSIC 22.2CKA (Linear) 99.3CKA (RBF 0.2) 80.6CKA (RBF 0.4) 99.1CKA (RBF 0.8) 99.3

Table 2. Accuracy of identifying corresponding layers based onmaximum similarity for 10 architecturally identical 10-layer CNNstrained from different initializations, with logits layers excluded.For SVCCA, we used a truncation threshold of 0.99 as recom-mended in Raghu et al. (2017). For asymmetric indexes (PWCCAand linear regression) we symmetrized the similarity as S + ST.CKA RBF kernel parameters reflect the fraction of the medianEuclidean distance used as σ. Results not significantly differentfrom the best result are bold-faced (p < 0.05, jackknife z-test).

We first investigate a simple VGG-like convolutional net-work based on All-CNN-C (Springenberg et al., 2015) (seeAppendix E) on CIFAR-10. Figure 2 and Table 2 show thatCKA passes our sanity check, but other methods performsubstantially worse. For SVCCA, we experimented witha range of truncation thresholds, but no threshold revealedthe layer structure (Appendix F.2); our results are consistentwith those in Appendix E of Raghu et al. (2017).

We also investigate Transformer networks, where all layersare of equal width. In Appendix F.1, we show similaritybetween the 12 sublayers of the encoders of Transformermodels (Vaswani et al., 2017) trained from different randominitializations. All similarity indexes achieve non-trivialaccuracy and thus pass the sanity check, although RBF CKAand R2

CCA performed slightly better than other methods.However, we found that there are differences in featurescale between representations of feed-forward network andself-attention sublayers that CCA does not capture becauseit is invariant to non-isotropic scaling.

6.2. Using CKA to Understand Network Architectures

CKA can reveal pathology in neural networks representa-tions. In Figure 3, we show CKA between layers of individ-ual CNNs with different depths, where layers are repeated2, 4, or 8 times. Doubling depth improved accuracy, butgreater multipliers hurt accuracy. At 8x depth, CKA indi-cates that representations of more than half of the networkare very similar to the last layer. We validated that theselater layers do not refine the representation by training an `2-regularized logistic regression classifier on each layer of thenetwork. Classification accuracy in shallower architecturesprogressively improves with depth, but for the 8x deeper

Page 7: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

1 2 3 4 5 6 7 8 9123456789

Laye

r1x Depth (94.1%)

5 10 15

5

10

15

2x Depth (95.0%)

5 10 15 20 25 30

51015202530

4x Depth (93.2%)

10 20 30 40 50 60

102030405060

8x Depth (91.9%)

0.10.20.30.40.50.60.70.80.91.0

Sim

ilarit

y

1 2 3 4 5 6 7 8 9Layer

0.6

0.8

1.0

Accu

racy

5 10 15Layer

0.6

0.8

1.0

5 10 15 20 25 30Layer

0.6

0.8

1.0

10 20 30 40 50 60Layer

0.6

0.8

1.0

Figure 3. CKA reveals when depth becomes pathological. Top: Linear CKA between layers of individual networks of different depths onthe CIFAR-10 test set. Titles show accuracy of each network. Later layers of the 8x depth network are similar to the last layer. Bottom:Accuracy of a logistic regression classifier trained on layers of the same networks is consistent with CKA.

15 30 45 60Layer

15

30

45

60

Laye

r

All Layers

8 16 24Layer

8

16

24

Even Layers

8 16 24Layer

8

16

24

Odd Layers

0.20.30.40.50.60.70.80.91.0

Sim

ilarit

y

Figure 4. Linear CKA between layers of a ResNet-62 model onthe CIFAR-10 test set. The grid pattern in the left panel arisesfrom the architecture. Right panels show similarity separately foreven layer (post-residual) and odd layer (block interior) activations.Layers in the same block group (i.e. at the same feature map scale)are more similar than layers in different block groups.

network, accuracy plateaus less than halfway through thenetwork. When applied to ResNets (He et al., 2016), CKAreveals no pathology (Figure 4). We instead observe a gridpattern that originates from the architecture: Post-residualactivations are similar to other post-residual activations, butactivations within blocks are not.

CKA is equally effective at revealing relationships betweenlayers of different architectures. Figure 5 shows the relation-ship between different layers of networks with and withoutresidual connections. CKA indicates that, as networks aremade deeper, the new layers are effectively inserted in be-tween the old layers. Other similarity indexes fail to revealmeaningful relationships between different architectures, aswe show in Appendix F.5.

In Figure 6, we show CKA between networks with differ-ent layer widths. Like Morcos et al. (2018), we find thatincreasing layer width leads to more similar representationsbetween networks. As width increases, CKA approaches 1;CKA of earlier layers saturates faster than later layers. Net-works are generally more similar to other networks of thesame width than they are to the widest network we trained.

2 4 6 8 10121416Plain-18 Layer

2

4

6

8

Plai

n-10

Lay

er

2 4 6 8 10 12ResNet-14 Layer

2

4

6

8

Plai

n-10

Lay

er

5 10 15 20 25 30ResNet-32 Layer

2468

10121416

Plai

n-18

Lay

er

5 10 15 20 25 30ResNet-32 Layer

2468

1012

Res

Net

-14

Laye

r

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

CKA

(Lin

ear)

Figure 5. Linear CKA between layers of networks with differentarchitectures on the CIFAR-10 test set.

4 16 64 256 1024 4096Width

0.5

0.6

0.7

0.8

0.9

1.0

CKA

(Lin

ear)

Similarity with Width 4096

4 16 64 256 1024 4096Width

Similarity with Same Width

conv1conv2conv3conv4

conv5conv6conv7conv8

Figure 6. Layers become more similar to each other and to widenetworks as width increases, but similarity of earlier layers satu-rates first. Left: Similarity of networks with the widest networkwe trained. Middle: Similarity of networks with other networksof the same width trained from random initialization. All CKAvalues are computed between 10 networks on the CIFAR-10 testset; shaded regions reflect jackknife standard error.

Page 8: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

1 2 3 4 5 6 7 8 9Layer

0.00.20.40.60.81.0

CKA

(Lin

ear)

Similarity on CIFAR-10

1 2 3 4 5 6 7 8 9Layer

Similarity on CIFAR-100

CIFAR-10 Net vs. CIFAR-10 NetCIFAR-100 Net vs. CIFAR-100 NetCIFAR-10 Net vs. CIFAR-100 Net

Untrained vs. CIFAR-10 NetUntrained vs. CIFAR-100 Net

Figure 7. CKA shows that models trained on different datasets(CIFAR-10 and CIFAR-100) develop similar representations, andthese representations differ from untrained models. The left panelshows similarity between the same layer of different models on theCIFAR-10 test set, while the right panel shows similarity computedon CIFAR-100 test set. CKA is averaged over 10 models of eachtype (45 pairs).

6.3. Similar Representations Across Datasets

CKA can also be used to compare networks trained on dif-ferent datasets. In Figure 7, we show that models trained onCIFAR-10 and CIFAR-100 develop similar representationsin their early layers. These representations require training;similarity with untrained networks is much lower. We fur-ther explore similarity between layers of untrained networksin Appendix F.3.

6.4. Analysis of the Shared Subspace

Equation 14 suggests a way to further elucidating what CKAis measuring, based on the action of one representationalsimilarity matrix (RSM) Y Y T applied to the eigenvectorsuiX of the other RSM XXT. By definition, XXTuiX pointsin the same direction as uiX , and its norm ||XXTuiX ||2 isthe corresponding eigenvalue. The degree of scaling androtation by Y Y T thus indicates how similar the action ofY Y T is to XXT, for each eigenvector of XXT. For visu-alization purposes, this approach is somewhat less usefulthan the CKA summary statistic, since it does not collapsethe similarity to a single number, but it provides a morecomplete picture of what CKA measures. Figure 8 showsthat, for large eigenvectors, XXT and Y Y T have similaractions, but the rank of the subspace where this holds issubstantially lower than the dimensionality of the activa-tions. In the penultimate (global average pooling) layer, thedimensionality of the shared subspace is approximately 10,which is the number of classes in the CIFAR-10 dataset.

7. Conclusion and Future WorkMeasuring similarity between the representations learnedby neural networks is an ill-defined problem, since it is notentirely clear what aspects of the representation a similarity

Figure 8. The shared subspace of two networks trained on CIFAR-10 from different random initializations is spanned primarily by theeigenvectors corresponding to the largest eigenvalues. Each rowrepresents a different network layer. Note that the average poolinglayer has only 64 units. Left: Scaling of the eigenvectors ui

X ofthe RSM XXT from network A by RSMs of networks A and B.Orange lines show ||XXTui

X ||2, i.e. the eigenvalues. Purple dotsshow ||Y Y Tui

X ||2, the scaling of the eigenvectors of the RSMof network A by the RSM of network B. Right: Cosine of therotation by the RSM of network B, (ui

X)TY Y TuiX/||Y Y Tui

X ||2.

index should focus on. Previous work has suggested thatthere is little similarity between intermediate layers of neu-ral networks trained from different random initializations(Raghu et al., 2017; Wang et al., 2018). We propose CKA asa method for comparing representations of neural networks,and show that it consistently identifies correspondences be-tween layers, not only in the same network trained fromdifferent initializations, but across entirely different archi-tectures, whereas other methods do not. We also provide aunified framework for understanding the space of similarityindexes, as well as an empirical framework for evaluation.

We show that CKA captures intuitive notions of similarity,i.e. that neural networks trained from different initializa-tions should be similar to each other. However, it remainsan open question whether there exist kernels beyond thelinear and RBF kernels that would be better for analyzingneural network representations. Moreover, there are otherpotential choices of weighting in Equation 14 that may bemore appropriate in certain settings. We leave these ques-tions as future work. Nevertheless, CKA seems to be muchbetter than previous methods at finding correspondences be-tween the learned representations in hidden layers of neuralnetworks.

Page 9: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

AcknowledgementsWe thank Gamaleldin Elsayed, Jaehoon Lee, Paul-HenriMignot, Maithra Raghu, Samuel L. Smith, Alex Williams,and Michael Wu for comments on the manuscript, RishabhAgarwal for ideas, and Aliza Elkin for support.

ReferencesAdvani, M. S. and Saxe, A. M. High-dimensional dynamics

of generalization error in neural networks. arXiv preprintarXiv:1710.03667, 2017.

Amari, S.-i., Ozeki, T., Karakida, R., Yoshida, Y., andOkada, M. Dynamics of learning in MLP: Natural gradi-ent and singularity revisited. Neural Computation, 30(1):1–33, 2018.

Bjorck, A. and Golub, G. H. Numerical methods for com-puting angles between linear subspaces. Mathematics ofComputation, 27(123):579–594, 1973.

Bojar, O., Federmann, C., Fishel, M., Graham, Y., Haddow,B., Huck, M., Koehn, P., and Monz, C. Findings of the2018 Conference on Machine Translation (WMT18). InEMNLP 2018 Third Conference on Machine Translation(WMT18), 2018.

Chen, A. M., Lu, H.-m., and Hecht-Nielsen, R. On thegeometry of feedforward neural network error surfaces.Neural Computation, 5(6):910–927, 1993.

Connolly, A. C., Guntupalli, J. S., Gors, J., Hanke, M.,Halchenko, Y. O., Wu, Y.-C., Abdi, H., and Haxby, J. V.The representation of biological classes in the humanbrain. Journal of Neuroscience, 32(8):2608–2618, 2012.

Cortes, C., Mohri, M., and Rostamizadeh, A. Algorithmsfor learning kernels based on centered alignment. Journalof Machine Learning Research, 13(Mar):795–828, 2012.

Cristianini, N., Shawe-Taylor, J., Elisseeff, A., and Kandola,J. S. On kernel-target alignment. In Advances in NeuralInformation Processing Systems, 2002.

Dinh, L., Sohl-Dickstein, J., and Bengio, S. Density esti-mation using real NVP. In International Conference onLearning Representations, 2017.

Dumoulin, V., Shlens, J., and Kudlur, M. A learned repre-sentation for artistic style. In International Conferenceon Learning Representations, 2017.

Edelman, S. Representation is representation of similarities.Behavioral and Brain Sciences, 21(4):449–467, 1998.

Elsayed, G. F., Lara, A. H., Kaufman, M. T., Churchland,M. M., and Cunningham, J. P. Reorganization betweenpreparatory and movement population responses in motorcortex. Nature Communications, 7:13239, 2016.

Freiwald, W. A. and Tsao, D. Y. Functional compartmental-ization and viewpoint generalization within the macaqueface-processing system. Science, 330(6005):845–851,2010.

Garriga-Alonso, A., Rasmussen, C. E., and Aitchison, L.Deep convolutional networks as shallow Gaussian pro-cesses. In International Conference on Learning Repre-sentations, 2019.

Gatys, L. A., Ecker, A. S., and Bethge, M. Image styletransfer using convolutional neural networks. In IEEEConference on Computer Vision and Pattern Recognition,2016.

Golub, G. H. and Zha, H. The canonical correlations ofmatrix pairs and their numerical computation. In LinearAlgebra for Signal Processing, pp. 27–49. Springer, 1995.

Gretton, A., Bousquet, O., Smola, A., and Scholkopf, B.Measuring statistical dependence with Hilbert-Schmidtnorms. In International Conference on AlgorithmicLearning Theory, 2005.

Haxby, J. V., Gobbini, M. I., Furey, M. L., Ishai, A.,Schouten, J. L., and Pietrini, P. Distributed and over-lapping representations of faces and objects in ventraltemporal cortex. Science, 293(5539):2425–2430, 2001.

He, K., Zhang, X., Ren, S., and Sun, J. Deep residuallearning for image recognition. In IEEE Conference onComputer Vision and Pattern Recognition, 2016.

Ioffe, S. and Szegedy, C. Batch normalization: Acceleratingdeep network training by reducing internal covariate shift.In International Conference on Machine Learning, 2015.

Jacobsen, J.-H., Smeulders, A. W., and Oyallon, E. i-RevNet: Deep invertible networks. In International Con-ference on Learning Representations, 2018.

Jacot, A., Gabriel, F., and Hongler, C. Neural tangent ker-nel: Convergence and generalization in neural networks.In Advances in Neural Information Processing Systems,2018.

Johnson, J., Alahi, A., and Fei-Fei, L. Perceptual losses forreal-time style transfer and super-resolution. In EuropeanConference on Computer Vision, 2016.

Khaligh-Razavi, S.-M. and Kriegeskorte, N. Deep super-vised, but not unsupervised, models may explain it corti-cal representation. PLoS Computational Biology, 10(11):e1003915, 2014.

Kriegeskorte, N., Mur, M., and Bandettini, P. A. Repre-sentational similarity analysis-connecting the branches ofsystems neuroscience. Frontiers in Systems Neuroscience,2:4, 2008a.

Page 10: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Kriegeskorte, N., Mur, M., Ruff, D. A., Kiani, R., Bodurka,J., Esteky, H., Tanaka, K., and Bandettini, P. A. Matchingcategorical object representations in inferior temporalcortex of man and monkey. Neuron, 60(6):1126–1141,2008b.

Kuss, M. and Graepel, T. The geometry of kernel canon-ical correlation analysis. Technical report, Max PlanckInstitute for Biological Cybernetics, 2003.

Laakso, A. and Cottrell, G. Content and cluster analysis:assessing representational similarity in neural systems.Philosophical Psychology, 13(1):47–76, 2000.

LeCun, Y., Kanter, I., and Solla, S. A. Second order proper-ties of error surfaces: Learning time and generalization.In Advances in Neural Information Processing Systems,1991.

Lee, J., Sohl-dickstein, J., Pennington, J., Novak, R.,Schoenholz, S., and Bahri, Y. Deep neural networksas gaussian processes. In International Conference onLearning Representations, 2018.

Li, Y., Yosinski, J., Clune, J., Lipson, H., and Hopcroft, J.Convergent learning: Do different neural networks learnthe same representations? In NIPS 2015 Workshop onFeature Extraction: Modern Questions and Challenges,2015.

Lorenzo-Seva, U. and Ten Berge, J. M. Tucker’s congru-ence coefficient as a meaningful index of factor similarity.Methodology, 2(2):57–64, 2006.

Morcos, A., Raghu, M., and Bengio, S. Insights on repre-sentational similarity in neural networks with canonicalcorrelation. In Advances in Neural Information Process-ing Systems, 2018.

Mroueh, Y., Marcheret, E., and Goel, V. Asymmetri-cally weighted CCA and hierarchical kernel sentenceembedding for multimodal retrieval. arXiv preprintarXiv:1511.06267, 2015.

Novak, R., Xiao, L., Bahri, Y., Lee, J., Yang, G., Abolafia,D. A., Pennington, J., and Sohl-dickstein, J. Bayesiandeep convolutional networks with many channels areGaussian processes. In International Conference onLearning Representations, 2019.

Orhan, E. and Pitkow, X. Skip connections eliminate singu-larities. In International Conference on Learning Repre-sentations, 2018.

Press, W. H. Canonical correlation clarified bysingular value decomposition, 2011. URLhttp://numerical.recipes/whp/notes/CanonCorrBySVD.pdf.

Raghu, M., Gilmer, J., Yosinski, J., and Sohl-Dickstein, J.SVCCA: Singular vector canonical correlation analysisfor deep learning dynamics and interpretability. In Ad-vances in Neural Information Processing Systems, 2017.

Ramsay, J., ten Berge, J., and Styan, G. Matrix correlation.Psychometrika, 49(3):403–423, 1984.

Robert, P. and Escoufier, Y. A unifying tool for linear multi-variate statistical methods: the RV-coefficient. AppliedStatistics, 25(3):257–265, 1976.

Romero, A., Ballas, N., Kahou, S. E., Chassang, A., Gatta,C., and Bengio, Y. FitNets: Hints for thin deep nets. InInternational Conference on Learning Representations,2015.

SAS Institute. Introduction to Regression Proce-dures. 2015. URL https://support.sas.com/documentation/onlinedoc/stat/141/introreg.pdf.

Saxe, A. M., McClelland, J. L., and Ganguli, S. Exactsolutions to the nonlinear dynamics of learning in deeplinear neural networks. In International Conference onLearning Representations, 2014.

Sejdinovic, D., Sriperumbudur, B., Gretton, A., and Fuku-mizu, K. Equivalence of distance-based and RKHS-basedstatistics in hypothesis testing. The Annals of Statistics,pp. 2263–2291, 2013.

Smith, S. L., Turban, D. H., Hamblin, S., and Hammerla,N. Y. Offline bilingual word vectors, orthogonal trans-formations and the inverted softmax. In InternationalConference on Learning Representations, 2017.

Song, L., Smola, A., Gretton, A., Borgwardt, K. M., andBedo, J. Supervised feature selection via dependence esti-mation. In International Conference on Machine learning,2007.

Springenberg, J. T., Dosovitskiy, A., Brox, T., and Ried-miller, M. Striving for simplicity: The all convolutionalnet. In International Conference on Learning Represen-tations Workshop, 2015.

StataCorp. Stata Multivariate Statistics Reference Man-ual. 2015. URL https://www.stata.com/manuals14/mv.pdf.

Sussillo, D., Churchland, M. M., Kaufman, M. T., andShenoy, K. V. A neural network that finds a naturalisticsolution for the production of muscle activity. NatureNeuroscience, 18(7):1025, 2015.

Tucker, L. R. A method for synthesis of factor analysisstudies. Technical report, Educational Testing Service,Princeton, NJ, 1951.

Page 11: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones,L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. Atten-tion is all you need. In Advances in Neural InformationProcessing Systems, pp. 5998–6008, 2017.

Vaswani, A., Bengio, S., Brevdo, E., Chollet, F., Gomez,A. N., Gouws, S., Jones, L., Kaiser, Ł., Kalchbrenner,N., Parmar, N., et al. Tensor2tensor for neural machinetranslation. arXiv preprint arXiv:1803.07416, 2018.

Vinod, H. D. Canonical ridge and econometrics of joint pro-duction. Journal of Econometrics, 4(2):147–166, 1976.

Wang, L., Hu, L., Gu, J., Wu, Y., Hu, Z., He, K., andHopcroft, J. E. Towards understanding learning repre-sentations: To what extent do different neural networkslearn the same representation. In Advances in NeuralInformation Processing Systems, 2018.

Yamins, D. L., Hong, H., Cadieu, C. F., Solomon, E. A.,Seibert, D., and DiCarlo, J. J. Performance-optimizedhierarchical models predict neural responses in highervisual cortex. Proceedings of the National Academy ofSciences, 111(23):8619–8624, 2014.

Zagoruyko, S. and Komodakis, N. Wide residual networks.In British Machine Vision Conference, 2016.

Page 12: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

A. Proof of Theorem 1Theorem. Let X and Y be n× p matrices. Suppose s is invariant to invertible linear transformation in the first argument,i.e. s(X,Z) = s(XA,Z) for arbitrary Z and any A with rank(A) = p. If rank(X) = rank(Y ) = n, then s(X,Z) =s(Y, Z).

Proof. Let

X ′ =

[XKX

]Y ′ =

[YKY

],

where KX is a basis for the null space of the rows of X and KY is a basis for the null space of the rows of Y . Then letA = X ′−1Y ′. [

XKX

]A =

[YKY

]=⇒ XA = Y.

Because X ′ and Y ′ have rank p by construction, A also has rank p. Thus, s(X,Z) = s(XA,Z) = s(Y,Z).

B. Orthogonalization and Invariance to Invertible Linear TransformationHere we show that any similarity index that is invariant to orthogonal transformation can be made invariant to invertiblelinear transformation by orthogonalizing the columns of the input.

Proposition 1. Let X be an n× p matrix of full column rank and let A be an invertible p× p matrix. Let X = QXRX andXA = QXARXA, where QTXQX = QTXAQXA = I and RX and RXA are invertible. If s(·, ·) is invariant to orthogonaltransformation, then s(QX , Y ) = s(QXA, Y ).

Proof. Let B = RXAR−1XA. Then QXB = QXA, and B is an orthogonal transformation:

BTB = BTQTXQXB = QT

XAQXA = I.

Thus s(QX , Y ) = s(QXB, Y ) = s(QXA, Y ).

C. CCA and Linear RegressionC.1. Linear Regression

Consider the linear regression fit of the columns of an n×m matrix C with an n× p matrix A:

B = arg minB

||C −AB||2F = (ATA)−1ATC.

Let A = QR, the thin QR decomposition of A. Then the fitted values are given by:

C = AB

= A(ATA)−1ATC

= QR(RTQTQR)−1RTQTC

= QRR−1(RT)−1RTQTC

= QQTC.

The residuals E = C − C are orthogonal to the fitted values, i.e.

ETC = (C −QQTC)TQQTC

= CTQQTC − CTQQTC = 0.

Page 13: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Thus:

||E||2F = tr(ETE)

= tr(ETC − ETC)

= tr((C − C)TC)

= tr(CTC)− tr(CTQQTC)

= ||C||2F − ||QTC||2F. (15)

Assuming that C was centered by subtracting its column means prior to the linear regression fit, the total fraction of varianceexplained by the fit is:

R2 = 1− ||E||2F

||C||2F= 1− ||C||

2F − ||QTC||2F||C||2F

=||QTC||2F||C||2F

. (16)

Although we have assumed that Q is obtained from QR decomposition, any orthonormal basis with the same span willsuffice, because orthogonal transformations do not change the Frobenius norm.

C.2. CCA

Let X be an n× p1 matrix and Y be an n× p2 matrix, and let p = min(p1, p2). Given the thin QR decompositions of Xand Y , X = QXRX , Y = QYRY such that QT

XQX = I , QTYQY = I , the canonical correlations ρi are the singular values

of A = QTXQY (Bjorck & Golub, 1973; Press, 2011) and thus the square roots of the eigenvalues of ATA. The squared

canonical correlations ρ2i are the eigenvalues of ATA = QTYQXQ

TXQY . Their sum is

∑pi=1 ρ

2i = tr(ATA) = ||QT

YQX ||2F.

Now consider the linear regression fit of the columns of QX with Y . Assume that QX has zero mean. Substituting QY forQ and QX for C in Equation 16, and noting that ||QX ||2F = p1:

R2 =||QT

YQX ||2Fp1

=

∑pi=1 ρ

2i

p1. (17)

C.3. Projection-Weighted CCA

Let X be an n × p1 matrix and Y be an n × p2 matrix, with p1 ≤ p2. Morcos et al. (2018) proposed to computeprojection-weighted canonical correlation as:

ρPW =

∑ci=1 αiρi∑i=1 αi

αi =∑j

|〈hi,xj〉|,

where the xj are the columns ofX , and the hi are the canonical variables formed by projectingX to the canonical coordinateframe. Below, we show that if we modify ρPW by squaring the dot products and ρi, we recover linear regression.:

R2MPW =

∑ci=1 α

′iρ

2i∑

i=1 α′i

= R2LR α′i =

∑j

〈hi,xj〉2.

Our derivation begins by forming the SVD QTXQY = UΣV T. Σ is a diagonal matrix of the canonical correlations ρi, and

the matrix of canonical variables H = QXU . Then R2MPW is:

R2MPW =

||XTHΣ||2F||XTH||2F

(18)

=tr((XTHΣ)T(XTHΣ))

tr((XTH)T(XTH))

=tr(ΣHTXXTHΣ)

tr(HTXXTH)

=tr(XTHΣ2HTX)

tr(XTHHTX)

=tr(RT

XQTXHΣ2HTQXRX)

tr(RTXQ

TXQXUU

TQTXQXRX)

.

Page 14: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Because we assume p1 ≤ p2, U is a square orthogonal matrix and UUT = I . Further noting that QTXH = U and

UΣ = QTXQY V :

R2MPW =

tr(RTXUΣ2UTRX)

tr(RTXQ

TXQXRX)

=tr(RT

XQTXQY V ΣUTRX)

tr(XTX)

=tr(XTQYQ

TYQXRX)

tr(XTX)

=tr(XTQYQ

TYX)

tr(XTX)

=||QT

YX||2F||X||2F

.

Substituting QY for Q and X for C in Equation 16:

R2LR =

||QTYX||2F||X||2F

= R2MPW.

D. Notes on Other MethodsD.1. Canonical Ridge

Beyond CCA, we could also consider the “canonical ridge” regularized CCA objective (Vinod, 1976):

σi = maxwiX ,w

iY

(XwiX)T(Ywi

Y )√||Xwi

X ||2 + κX ||wiX ||22

√||Ywi

Y ||2 + κY ||wiY ||2

subject to ∀j<i (wiX)T(XTX + κI)wjX = 0

∀j<i (wiY )T(Y TY + κI)wjY = 0.

(19)

Given the singular value decompositionsX = UXΣXVTX and Y = UY ΣY V

TY , one can form “partially orthogonalized” bases

QX = UXΣX(Σ2X+κXI)−1/2 and QY = UY ΣY (Σ2

Y +κY I)−1/2. Given the singular value decomposition of their productU ΣV T = QT

XQY , the canonical weights are given by WX = VX(Σ2X + κXI)−1/2U and WY = VY (Σ2

Y + κY I)−1/2V ,as previously shown by Mroueh et al. (2015). As in the unregularized case (Equation 13), there is a convenient expressionfor the sum of the squared singular values

∑σ2i in terms of the eigenvalues and eigenvectors of XXT and Y Y T. Let the ith

left-singular vector of X (eigenvector of XXT) be indexed as uiX and let the ith eigenvalue of XXT (squared singular value

of X) be indexed as λiX , and similarly let the left-singular vectors of Y Y T be indexed as uiY and the eigenvalues as λiY .

Then:

p1∑i=1

σ2i = ||QT

Y QX ||2F (20)

= ||(Σ2Y + κY I)−1/2ΣY U

TY UXΣX(Σ2

X + κXI)−1/2||2F (21)

=

p1∑i=1

p2∑j=1

λiXλjY

(λiX + κX)(λjY + κY )〈uiX ,u

jY 〉

2. (22)

Unlike in the unregularized case, the singular values σi do not measure the correlation between the canonical variables.Instead, they become arbitrarily small as κX or κY increase. Thus, we need to normalize the statistic to remove thedependency on the regularization parameters.

Page 15: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Applying von Neumann’s trace inequality yields a bound:

p1∑i=1

σ2i = tr(QY QT

Y QXQTX) (23)

= tr((UY Σ2Y (Σ2

Y + κY I)−1UTY )(UXΣ2

X(Σ2X + κXI)−1UT

X)) (24)

≤p1∑i=1

λiXλiY

(λiX + κX)(λiY + κY ). (25)

Applying the Cauchy-Schwarz inequality to (25) yields the alternative bounds:

p1∑i=1

σ2i ≤

√√√√ p1∑i=1

(λiX

λiX + κX

)2√√√√ p1∑

i=1

(λiY

λiY + κY

)2

(26)

√√√√ p1∑i=1

(λiX

λiX + κX

)2√√√√ p2∑

i=1

(λiY

λiY + κY

)2

. (27)

A normalized form of (22) could be produced by dividing by any of (25), (26), or (27).

If κX = κY = 0, then (25) and (26) are equal to p1. In this case, (22) is simply the sum of the squared canonical correlations,so normalizing by either of these bounds recovers R2

CCA.

If κY = 0, then as κX →∞, normalizing by the bound from (25) recovers R2:

limκX→∞

∑p1i=1

∑p2j=1

λiXλjY

(λiX+κX)(λjY +0)〈uiX ,u

jY 〉2∑p1

i=1λiXλ

iY

(λiX+κX)(λiY +0)

(28)

= limκX→∞

∑p1i=1

∑p2j=1

λiX(λiXκX

+1

) 〈uiX ,ujY 〉2∑p1i=1

λiX(λiXκX

+1

) (29)

=

∑p1i=1

∑p2j=1 λ

iX〈uiX ,u

jY 〉2∑p1

i=1 λiX

(30)

=||UT

Y UXΣX ||2F||X||2F

=||QT

YX||2F||X||2F

= R2LR. (31)

The bound from (27) differs from the bounds in (25) and (26) because it is multiplicatively separable in X and Y .Normalizing by this bound leads to CKA(QXQ

TX , QY Q

TY ):

∑p1i=1

∑p2j=1

λiXλjY

(λiX+κX)(λjY +κY )〈uiX ,u

jY 〉2√∑p1

i=1

(λiX

λiX+κX

)2√∑p2i=1

(λiY

λiY +κY

)2 (32)

=||QT

Y QX ||2F||QT

XQX ||F||QTY QY ||F

= CKA(QXQTX , QY Q

TY ). (33)

Page 16: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

Moreover, setting κX = κY = κ and taking the limit as κ→∞, the normalization from (27) leads to CKA(XXT, Y Y T):

limκ→∞

∑p1i=1

∑p2j=1

λiXλjY

(λiX+κ)(λjY +κ)〈uiX ,u

jY 〉2√∑p1

i=1

(λiX

λiX+κ

)2√∑p2i=1

(λiY

λiY +κ

)2 (34)

= limκ→∞

∑p1i=1

∑p2j=1

λiXλjY(

λiXκ +1

)(λjYκ +1

) 〈uiX ,ujY 〉2√∑p1i=1

(λiX

λiXκ +1

)2√∑p2

i=1

(λiY

λiYκ +1

)2(35)

=

∑p1i=1

∑p2j=1 λ

iXλ

jY 〈uiX ,u

jY 〉2√∑p1

i=1

(λiX)2√∑p2

i=1

(λiY)2 (36)

= CKA(XXT, Y Y T).

Overall, the hyperparameters of the canonical ridge objective make it less useful for exploratory analysis. These hyperpa-rameters could be selected by cross-validation, but this is computationally expensive, and the resulting estimator would bebiased by sample size. Moreover, our goal is not to map representations of networks to a common space, but to measure thesimilarity between networks. Appropriately chosen regularization will improve out-of-sample performance of the mapping,but it makes the meaning of “similarity” more ambiguous.

D.2. The Orthogonal Procrustes Problem

The orthogonal Procrustes problem consists of finding an orthogonal rotation in feature space that produces the smallesterror:

Q = arg minQ

||Y −XQ||2F subject to QTQ = I. (37)

The objective can be written as:

||Y −XQ||2F = tr((Y −XQ)T(Y −XQ))

= tr(Y TY )− tr(Y TXQ)− tr(QTXTY ) + tr(QTXTXQ)

= ||Y ||2F + ||X||2F − 2tr(Y TXQ). (38)

Thus, an equivalent objective is:

Q = arg maxQ

tr(Y TXQ) subject to QTQ = I. (39)

The solution is Q = UV T where UΣV T = XTY , the singular value decomposition. At the maximum of (39):

tr(Y TXQ) = tr(V ΣUTUV T) = tr(Σ) = ||XTY ||∗ = ||Y TX||∗, (40)

which is similar to what we call “dot product-based similarity” (Equation 1), but with the squared Frobenius norm of Y TX(the sum of the squared singular values) replaced by the nuclear norm (the sum of the singular values). The Frobenius normof Y TX can be obtained as the solution to a similar optimization problem:

||Y TX||F = maxW

tr(Y TXW ) subject to tr(W TW ) = 1. (41)

In the context of neural networks, Smith et al. (2017) previously proposed using the solution to the orthogonal Procrustesproblem to align word embeddings from different languages, and demonstrated that it outperformed CCA.

Page 17: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

E. Architecture DetailsAll non-ResNet architectures are based on All-CNN-C (Springenberg et al., 2015), but none are architecturally identical. ThePlain-10 model is very similar, but we place the final linear layer after the average pooling layer and use batch normalizationbecause these are common choices in modern architectures. We use these models because they train in minutes on modernhardware.

Tiny-10

3× 3 conv. 16-BN-ReLu ×23× 3 conv. 32 stride 2-BN-ReLu3× 3 conv. 32-BN-ReLu ×23× 3 conv. 64 stride 2-BN-ReLu3× 3 conv. 64 valid padding-BN-ReLu1× 1 conv. 64-BN-ReLuGlobal average poolingLogits

Table E.1. The Tiny-10 architecture, used in Figures 2, 8, F.3, and F.5. The average Tiny-10 model achieved 89.4% accuracy.

Plain-(8n+ 2)

3× 3 conv. 96-BN-ReLu ×(3n− 1)3× 3 conv. 96 stride 2-BN-ReLu3× 3 conv. 192-BN-ReLu ×(3n− 1)3× 3 conv. 192 stride 2-BN-ReLu3× 3 conv. 192 BN-ReLu ×(n− 1)3×3 conv. 192 valid padding-BN-ReLu1× 1 conv. 192-BN-ReLu ×nGlobal average poolingLogits

Table E.2. The Plain-(8n+ 2) architecture, used in Figures 3, 5, 7, F.4, F.5, F.6, and F.7. Mean accuracies: Plain-10, 93.9%; Plain-18:94.8%; Plain-34: 93.7%; Plain-66: 91.3%

Width-n

3× 3 conv. n-BN-ReLu ×23× 3 conv. n stride 2-BN-ReLu3× 3 conv. n-BN-ReLu ×23× 3 conv. n stride 2-BN-ReLu3× 3 conv. n valid padding-BN-ReLu1× 1 conv. n-BN-ReLuGlobal average poolingLogits

Table E.3. The architectures used for width experiments in Figure 6.

Page 18: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

F. Additional ExperimentsF.1. Sanity Check for Transformer Encoders

CCA (R 2CCA)

SVCCA (R 2CCA)

Linear Regression

CKA (Linear)

CKA (RBF 0.4)

369

12

Subl

ayer

Layer Norm Scale Attention/FFN Residual

369

12

Subl

ayer

369

12

Subl

ayer

369

12

Subl

ayer

3 6 9 12Sublayer

369

12

Subl

ayer

3 6 9 12Sublayer

3 6 9 12Sublayer

3 6 9 12Sublayer

Figure F.1. All similarity indices broadly reflect the structure ofTransformer encoders. Similarity indexes are computed betweenthe 12 sublayers of Transformer encoders, for each of the 4 possibleplaces in each sublayer that representations may be taken (see Fig-ure F.2), averaged across 10 models trained from different randominitializations.

Layer Normalization

Channel-wise Scale

Self-Attention orFeed-Forward Network

+Residual

From Previous Sublayer

To Next Sublayer

Figure F.2. Architecture of a single sublayer of the Transformerencoder used for our experiments. The full encoder includes 12 sub-layers, alternating between self-attention and feed-forward networksublayers.

Index Layer Norm Scale Attn/FFN Residual

CCA (ρ) 85.3 85.3 94.9 90.9CCA (R2

CCA) 87.8 87.8 95.3 95.2SVCCA (ρ) 78.2 83.0 89.5 75.9SVCCA (R2

CCA) 85.4 86.9 90.8 84.7PWCCA 88.5 88.9 96.1 87.0Linear Reg. 78.1 83.7 76.0 36.9CKA (Linear) 78.6 95.6 86.0 73.6CKA (RBF 0.2) 76.5 73.1 70.5 76.2CKA (RBF 0.4) 92.3 96.5 89.1 98.1CKA (RBF 0.8) 80.8 95.8 93.6 90.0

Table F.1. Accuracy of identifying corresponding sublayers basedmaximum similarity, for 10 architecturally identical 12-sublayerTransformer encoders at the 4 locations in each sublayer after whichthe representation may be taken (see Figure F.2). Results not sig-nificantly different from the best result are bold-faced (p < 0.05,jackknife z-test).

When applied to Transformer encoders, all similarity indexes we investigated passed the sanity check described in Section 6.1.We trained Transformer models using the tensor2tensor library (Vaswani et al., 2018) on the English to Germantranslation task from the WMT18 dataset (Bojar et al., 2018) (Europarl v7, Common Crawl, and News Commentary v13corpora) and computed representations of each of the 75,804 tokens from the 3,000 sentence newstest2013 developmentset, ignoring end of sentence tokens. In Figure F.1, we show similarity between the 12 sublayers of the encoders of 10Transformer models (45 pairs) trained from different random initializations. Each Transformer sublayer contains fouroperations, shown in Figure F.2; results vary based which operation the representation is taken after. Table F.1 shows theaccuracy with which we identify corresponding layers between network pairs by maximal similarity.

The Transformer architecture alternates between self-attention and feed-forward network (FFN) sublayers. The checkerboardpattern in representational similarity after the self-attention/feed-forward network operation in Figure F.1 indicates thatrepresentations of attention sublayers are more similar to other attention sublayers than to FFN sublayers, and similarly,representations of FFN sublayers are more similar to other FFN than to feed-forward network layers. CKA reveals acheckerboard pattern for activations after the channel-wise scale operation (before the attention/FFN operation) that othermethods do not. Because CCA is invariant to non-isotropic scaling, CCA similarities before and after channel-wise scalingare identical. Thus, CCA cannot capture this structure, even though the structure is consistent across networks.

Page 19: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

F.2. SVCCA at Alternative Thresholds

2

4

6

8La

yer

R 2SVCCA Threshold 0.5

0.10.20.30.40.50.60.70.80.9

R 2SVCCA Threshold 0.6

0.10.20.30.40.50.60.70.8

R 2SVCCA Threshold 0.7

0.10.20.30.40.50.60.70.80.9

R 2SVCCA Threshold 0.8

0.10.20.30.40.50.60.70.80.9

2 4 6 8Layer

2

4

6

8

Laye

r

R 2SVCCA Threshold 0.9

0.10.20.30.40.50.60.70.80.9

2 4 6 8Layer

R 2SVCCA Threshold 0.99

0.20.30.40.50.60.7

2 4 6 8Layer

SVCCA ρ Threshold 0.9

0.20.30.40.50.60.70.80.9

2 4 6 8Layer

SVCCA ρ Threshold 0.99

0.30.40.50.60.70.8

Figure F.3. Same as Figure 2 row 2, but for more SVCCA thresholds than the 0.99 threshold suggested by Raghu et al. (2017). Nothreshold reveals the structure of the network.

F.3. CKA at Initialization

5 10 15Layer

5

10

15

Laye

r

Same Net

5 10 15Layer

5

10

15Different Nets

5 10 15Layer

5

10

15Vs. Trained

0.20.40.60.81.0

CKA

(Lin

ear)

Figure F.4. Similarity of the Plain-18 network at initialization. Left:Similarity between layers of the same network. Middle: Similaritybetween untrained networks with different initializations. Right:Similarity between untrained and trained networks.

5 10 15 20 25 30

Layer

51015202530

Laye

r

Plain-34

10 20 30 40 50 60Layer

102030405060

Plain-66

10 20 30 40 50 60

Layer

102030405060

ResNet-62

0.20.40.60.81.0

CKA

(Lin

ear)

Figure F.5. Similarity between layers at initialization for deeperarchitectures.

F.4. Additional CKA Results

2 4 6 8Layer

2468

Laye

r

BN vs. BN

2 4 6 8Layer

No BN vs. No BN

2 4 6 8Layer

BN vs. No BN

0.20.30.40.50.60.70.80.9

CKA

(Lin

ear)

Figure F.6. Networks with and without batch normalization trainedfrom different random initializations learn similar representationsaccording to CKA. The largest difference between networks is atthe last convolutional layer. Optimal hyperparameters were sepa-rately selected for the batch normalized network (93.9% averageaccuracy) and the network without batch normalization (91.5%average accuracy).

2 4 6 8Layer

2

4

6

8

Laye

r

All Examples

2 4 6 8Layer

Within Class

0.10.20.30.40.50.60.70.80.9

CKA

(Lin

ear)

Figure F.7. Within-class CKA is similar to CKA based on all exam-ples. To measure within-class CKA, we computed CKA separatelyfor examples belonging to each CIFAR-10 class based on represen-tations from Plain-10 networks, and averaged the resulting CKAvalues across classes.

Page 20: Similarity of Neural Network Representations Revisitedhinton/absps/similarity.pdf · Similarity of Neural Network Representations Revisited Problem Statement Let X2Rn p 1 denote a

Similarity of Neural Network Representations Revisited

F.5. Similarity Between Different Architectures with Other Indexes

2

4

6

8

Tiny

-10

Laye

r

CCA (ρ)

0.4

0.5

0.6

0.7

CCA (R 2CCA)

0.2

0.3

0.4

0.5

0.6SVCCA (ρ)

0.4

0.5

0.6

0.7

0.8SVCCA (R 2

CCA)

0.20.30.40.50.6

2 4 6 8 10 12ResNet-14 Layer

2

4

6

8

Tiny

-10

Laye

r

PWCCA

0.5

0.6

0.7

0.8

2 4 6 8 10 12ResNet-14 Layer

Linear Regression

0.10.20.30.40.50.60.70.80.9

2 4 6 8 10 12ResNet-14 Layer

CKA (Linear)

0.20.30.40.50.60.70.80.9

2 4 6 8 10 12ResNet-14 Layer

CKA (RBF)

0.20.30.40.50.60.70.80.9

Figure F.8. Similarity between layers of different architectures (Tiny-10 and ResNet-14) for all methods investigated. Only CKA revealsmeaningful correspondence. SVCCA results resemble Figure 7 of Raghu et al. (2017). In order to achieve better performance forCCA-based techniques, which are sensitive to the number of examples used to compute similarity, all plots show similarity on theCIFAR-10 training set.