Title: Inner Product-based Neural Network Similarity
Venue: NeurIPS 2023
Accepted: yes
Keywords: Neural Network Similarity

Filter Subspace
Abstract: Analyzing representational similarity among neural networks (NNs) is essential for interpreting or transferring deep models. In application scenarios where numerous NN models are learned, it becomes crucial to assess model similarities in computationally efficient ways. In this paper, we propose a new paradigm for reducing NN representational similarity to filter subspace distance. Specifically, when convolutional filters are decomposed as a linear combination of a set of filter subspace elements, denoted as filter atoms, and have those decomposed atom coefficients shared across networks, NN representational similarity can be significantly simplified as calculating the cosine distance among respective filter atoms, to achieve millions of times computation reduction over popular probing-based methods. We provide both theoretical and empirical evidence that such simplified filter subspace-based similarity preserves a strong linear correlation with other popular probing-based metrics, while being significantly more efficient to obtain and robust to probing data. We further validate the effectiveness of the proposed method in various application scenarios where numerous models exist, such as federated and continual learning as well as analyzing training dynamics. We hope our findings can help further explorations of real-time large-scale representational similarity analysis in neural networks.

Inner Product-based Neural Network Similarity

Abstract

Analyzing representational similarity among neural networks (NNs) is essential for interpreting or transferring deep models. In application scenarios where numerous NN models are learned, it becomes crucial to assess model similarities in computationally efficient ways. In this paper, we propose a new paradigm for reducing NN representational similarity to filter subspace distance. Specifically, when convolutional filters are decomposed as a linear combination of a set of filter subspace elements, denoted as filter atoms , and have those decomposed atom coefficients shared across networks, NN representational similarity can be significantly simplified as calculating the cosine distance among respective filter atoms, to achieve millions of times computation reduction over popular probing-based methods. We provide both theoretical and empirical evidence that such simplified filter subspace-based similarity preserves a strong linear correlation with other popular probing-based metrics, while being significantly more efficient to obtain and robust to probing data. We further validate the effectiveness of the proposed method in various application scenarios where numerous models exist, such as federated and continual learning as well as analyzing training dynamics. We hope our findings can help further explorations of real-time large-scale representational similarity analysis in neural networks.

1 Introduction

Deep neural networks (NNs) have shown unprecedented performance in a large variety of tasks [24, 46]. In many scenarios, numerous models are learned and their relations can be beneficial to exploit. For example, as illustrated in Figure 1(a), to aggregate knowledge across space, federated learning (FL) trains models over a large number of clients while keeping data localized. To preserve knowledge across time while learning new ones, continual learning (CL) can be addressed by training a large group of models, one for each timestep. Finding the relations among models is the cornerstone to boosting performance in these scenarios, such as improving personalization for FL [53] or providing knowledge retrieval for CL [40]. Considering the large number of NNs potentially allowed in those scenarios, e.g., to model growing spatial/temporal coverage, it becomes crucial to have a highly computationally efficient way to assess NN model similarity.

We are inspired by one recent state-of-the-art CL framework in [35], where each convolutional filter is represented as a linear combination of a set of filter subspace elements, denoted as filter atoms . It is easy to notice that each convolutional layer now becomes two convolutional layers, a filter atom layer followed by an atom coefficient layer with 1 × 1 filters. Then, motivated by the literature on task subspace modeling [10, 25, 33, 45, 64] that tasks can be modeled as a set of latent basis tasks and their linear combinations, a group of tasks are sequentially modeled using NNs by learning for each task a different set of filter atoms, while sharing common atom coefficients across

…

Space

𝐶

!

𝐶

"

𝐶

#

𝐶

$%!

𝐶

$

Time

Continual Learning

…

𝑇

!

𝑇

"

𝑇

#

𝑇

&

…

𝐸

!

𝐸

"

𝐸

#

𝐸

'

N: number of FL clients, M: number of CL tasks, K: number of training epochs

(a)

…

…

…

…

…

…

…

…

…

…

…

…

…

…

…

…

…

…

…

…

×

×

×

×

𝒁

𝟏

(𝟐)

𝒁

𝟏

(𝟏)

𝒁

𝟐

(𝟐)

𝒁

𝟐

(𝟏)

Probing data

𝑿

𝒑

𝑫

𝟏

(𝟐)

𝑫

𝟏

(𝟏)

𝑫

𝟐

(𝟐)

𝑫

𝟐

(𝟏)

𝜶

(𝟐)

𝜶

(𝟏)

Model 1

Model 2

Deep

Features

Shared atom

coefficient

Filter

atom

Feature Space

Similarity

Filter Subspace

Similarity

Model 1

Model 2

Layer (2)

Layer (1)

Layer (2)

Layer (1)

Layer (2)

Layer (1)

Layer (2)

Layer (1)

𝜶

(𝟐)

𝜶

(𝟏)

Cosine Similarity

CCA

CCA

Cosine Similarity

(b)

tasks. [35] has in detail analyzed and validated this framework in the CL context. This learning framework with individually modeled filter subspaces but shared rules of linear combinations is generally applicable to many multi-model scenarios, especially CL and FL settings, where numerous NNs with the same architecture are learned. For example, FL learns a single global model to fit the data on all clients, and the majority of aggregating methods in FL require NNs to maintain the same network structure [28, 29, 34].

In the above setting, it is easy to observe that the representation variations across different NNs now become dominated by respective filter atoms. Thus, [35] adopts in experiments filter subspace distance to assess task relevancy, however, without formal justification. In this paper, we formally explore NN representational similarity using filter subspace distance, with detailed theoretical and empirical justifications. We first simplify the filter subspace distance to the cosine distance of two sets of filter atoms, to eliminate the computation of singular value decomposition in calculating principal angles. Then, we show both theoretically and empirically that the obtained filter subspace similarity preserves a strong linear correlation with other popular probing-based similarity measures such as CCA [43], which require external probing data as input stimuli. Our representational similarity is also immune to inappropriate choices of probing data, while probing-based metrics can be perturbed drastically.

Previous works [37, 43] measure representational similarity directly relying on deep representations revealed by input data. These approaches introduce heavy computation from both the forward pass of numerous probing data and the calculation of high-dimensional covariance matrices. As these similarity metrics are probing-dependent, their quality can potentially deteriorate when probing data are inappropriately chosen, scarce or unavailable. Such properties make the popular probing-based approaches less appropriate for our target scenarios where a large number of NN models are present.

The proposed filter subspace similarity shows extreme efficiency in both memory and computation. Since our similarity computation does not involve network forward pass, no GPU memory access is required, whereas other probing-based measures consume the same amount of GPU memory as regular inference. On the other hand, the proposed method involves only inner product calculations on filter atoms, which takes negligible time for similarity evaluation. The evaluation time of probingbased measures includes the time of both the forward pass of probing data and the calculation of high-dimensional covariance matrices. We report later the dramatically improved evaluation time of the proposed method against other popular probing-based methods, e.g., CKA [21]. These unique

properties make our method highly desirable for exploring NN similarity under scenarios with a large number of NN models.

We further validate our filter subspace similarity for knowledge transfer with various CL and FL tasks, as sample examples to exploit NN model relations. In both settings, we fix the atom coefficients, learn the filter atoms for each task, and finally conduct knowledge transfer among tasks by recalling the most similar models for the ensemble. Compared with probing-based similarity metrics, the proposed measure achieves competitive performance with millions of times reduction in the computational cost.

We summarize our contributions as follows,

We formally explore NN representational similarity measure using filter subspace distance.

We show both theoretically and empirically that the proposed filter subspace-based measure preserves a strong linear correlation with other popular probing-based measures, while being significantly more robust and efficient in both memory and computation.

We demonstrate the effectiveness of the proposed similarity measure using several simple examples, such as federated and continual learning as well as analyzing training dynamics.

2 Methodology

In this section, we first review probing-based representational similarities and show their limitations. Then, we provide a filter subspace formulation for NNs, and propose a NN similarity metric based on a simplified filter subspace distance. We further demonstrate that under certain assumptions, the proposed measure shows a strong linear relationship with popular probing-based measures, while exhibiting dramatic improvement in computational efficiency and data robustness. These unique characteristics of the proposed measure can potentially enable real-time large-scale NN similarity assessment, e.g., helping fast knowledge retrieval across a large number of NN models.

2.1 Revisiting Representational Similarity in Feature Space

Intuitively, the NN representational similarity can be directly assessed via features generated from different neural networks. As shown in Figure 1(b), it usually includes three steps to evaluate probing-based representational similarity between two NNs F u and F v : (1) Collect an appropriate and sufficient amount of external probing data X p ∈ R n × c ′ × h ′ × w ′ that can represent the whole data distribution. (2) Generate the feature Z u and Z v ( Z u , Z v ∈ R n × c × h × w ) by the forward pass of probing data through different neural networks, Z u = F u ( X p , θ u ) and Z v = F v ( X p , θ v ) , where θ u , θ v denote parameters of two NNs. (3) Choose a probing-based metric to assess the model similarity. Several popular probing-based methods can be adopted in step (3), and we will give a brief introduction below.

CCA. [43] proposes to analyze the NN representational similarity by conducting canonical correlation analysis on Z u , Z v , which is a recursive process of finding projection directions for two matrices that their correlation is maximized. Specifically, let Q u , Q v denote the orthonormal bases of Z u , Z v , the CCA can be denoted as,

where σ l denotes the l -th eigenvalue of Λ u,v = Q ⊺ u Q v .

CKA. [21] proposes another way to assess the NN similarity based on Centered Kernel Alignment (CKA). Let K u = Z u Z ⊺ u , K v = Z v Z ⊺ v denote the Gram matrices of two feature space, the CKA is computed by,

where HSIC is the Hilbert-Schmidt Independence Criterion [11].

However, in addition to the forward pass, all the aforementioned approaches further introduce significant computational costs while performing evaluation in the representation space. Nevertheless,

Filter Subspace Similarity

Correlation: 0.9469

(a)

CCA

Filter Subspace Similarity

Correlation: 0.9327

(b)

Correlation

CCA [43]

0.9327

CKA [21]

0.9550

Grassmann Distance [35]

0.9469

their qualities rely heavily on the mindful choice of probing data X p , which undermines their robustness.

2.2 Representational Similarity in Filter Subspace

Filter subspace. As in [41], the convolutional filter W ∈ R c ′ × c × k × k ( c ′ and c are the number of input and output channels, k is the kernel size) can be decomposed over m filter atoms (filter subspace elements) D [ i ] ∈ R k × k ( i = 1 , ..., m ) , linearly combined by atom coefficients α ∈ R m × c ′ × c as W = α × D . Note that each convolutional layer now becomes two convolutional layers, a filter atom layer followed by an atom coefficient layer with 1 × 1 filters. The filter subspace is then expressed as V = Span { D [1] , ..., D [ m ] } . With this formulation, we consider a paradigm where filter subspaces are model-specific, and subspace linear combination rules, i.e. , atom coefficients, are shared across different networks. The intuition and detailed validation of this learning paradigm can be found in [35], where state-of-the-art performance in the continual learning context is reported.

In this setting, we dive deep into the relationship between filter subspaces and representations. For simplicity, let c = c ′ = 1 , and the argument extends. Given an input image X ( b ) ( b ∈ B , B ⊂ Z 2 ), define the local input norm || X || F,N b := ( ∑ b ′ ∈ N b X ( b -b ′ ) 2 ) 1 / 2 and the convolution ⟨ X , w ⟩ N b := ∑ b ′ ∈ N b X ( b -b ′ ) w ( b ′ ) , where N b ⊂ B is a local Euclidean grid centered at b . Then the decomposed convolution can be written as Z ( b ) = ∑ m i =1 α i ⟨ X , D i ⟩ N b , where D [ i ] denotes the i -th atom, α i is the corresponded i -th coefficient.

Proposition 2.1. Suppose D u and D v are two different sets of filter atoms for a convolutional layer with the common atom coefficients α , we can upper bound the changes in the corresponding features Z u , Z v with atom changes,

The proof is provided in Appendix A.1. We further empirically validate this relationship in Section A.3.

Filter subspace similarity The above theorem suggests the possibility to measure the representational similarity of two NNs by simply measuring the distance of their filter subspaces. As proposed in [35], the representational similarity of two NNs with different filter subspaces V u , V v can be assessed by the similarity based on Grassmann distance between V u , V v as,

where θ i is the i -th principal angle between V u and V v .

However, the above metric requires costly singular value decomposition. Note that filter atoms in different NNs are intrinsically aligned under shared atom coefficients, which allows us to approximate the filter subspace similarity using the cosine similarity of the corresponding filter atoms. To this end, as shown in Figure 1(b), we propose a significantly simplified representational similarity measure with filter atom similarity.

Definition 2.2. Suppose two convolution neural networks F u , F v share atom coefficients layer-wise, and their model-specific filter atoms are D u , D v , then the filter subspace representational similarity is simplified as,

The above definition is a layer-wise similarity, allowing us to compare the similarity of different networks per layer, and we simply average layer-wise similarities for the network-wise similarity. Remark 2.3 . The filter subspace similarity measure becomes a proper metric after taking the arccosine, i.e. , arccos( S Atom ( F u , F v )) is a proper metric.

We further show that S Atom and S Gras are equivalent under certain assumption.

Proposition 2.4. Assume D u , D v ∈ R k 2 × m are orthogonal matrices, then S Gras = S Atom .

The proof is provided in Appendix A.1. We empirically show in Figure 2(a) that the above simplified filter subspace similarity has still a strong linear correlation with the Grassmann subspace similarity even without imposing the above orthogonality over atoms.

Note that our filter subspace similarity measure only involves linear operations of vectorized atoms of around hundreds of dimensions, which requires negligible computation. Additionally, the proposed method depends solely on models themselves and eliminates the reliance on external probing data, equipping our similarity with robustness to inappropriate choice of probing data.

2.3 Algorithm Complexity Analysis

Here, we provide a detailed comparison of computation complexity between the proposed filter subspace similarity and probing-based similarities. Consider one convolutional layer with filter W ∈ R c ′ × c × k × k ( W = α × D , D ∈ R m × k × k ) which transforms the input X p ∈ R n × c ′ × h ′ × w ′ to output Z ∈ R n × c × h × w . The complexity of our method is dominated by inner product of two tiny filter atoms, O ( m · k 2 ) , e.g. , m = 9 , k = 3 in a typical setting.

In contrast, probing-based similarity measure first forward feeds n probing samples with a complexity of O ( n · h ′ w ′ · k 2 · cc ′ ) , then calculates covariance matrix with the complexity of O ( n 2 · hw · c ) . In total, the time complexity of CCA is O ( n · h ′ w ′ · k 2 · cc ′ + n 2 · hw · c ) . Our method is at least n · h ′ w ′ · k 2 · cc ′ + n 2 · hw · c m · k 2 times more efficient than probing-based similarity measures. As h ≫ k , cc ′ ≫ m , the computational cost of our method is negligible. For example, with 10k probing datapoints, the CCA calculation requires 1 . 14 × 10 7 times more FLOPs than the proposed method.

2.4 Relationship with Probing-based Similarities

The proposed filter subspace similarity not only shows extreme efficiency but also exhibits a strong linear relationship with other popular probing-based similarities. Here, we analyze the proposed filter subspace similarity S Atom with CCA, S CCA [43]. Suppose forward passes of decomposed convolutional layer for F u and F v are Z u = α X p D u , Z v = α X p D v , respectively. † To start with, we show that the S CCA is upper bounded by the proposed S Atom .

Theorem 2.5. Let T = Tr ( X ⊺ p α ⊺ α X p ) , C = σ min ( X ⊺ p α ⊺ α X p ) . Assume K ( Z ⊺ u Z u ) , K ( Z ⊺ v Z v ) ≤ γ . Then S CCA ( F u , F v ) is upper bounded by S Atom ( F u , F v ) ,

where Tr ( · ) denotes trace of a matrix, σ min indicates the minimum eigenvalue, K ( A ) denotes the condition number of matrix A . We provide the proof in Appendix A.1.

Federated Learning (100 models)

Continual Learning (10 models)

# of times more efficient than CCA

13,611,052

120,650

5,031

325

∞

∞

∞

…

…

Ours

CKA

CCA

(a)

Similarity

Similarity measured by CCA/CKA is affected by the choice of probing data

In-Distribution Probing Data

Out-of-Distribution Probing Data

(b)

Since S CCA is probing-dependent, the calculated value varies depending on the choice of probing data, and the value range shows bounded by our filter subspace similarity, as in the theorem above.

With additional assumptions imposed, we can further show a near-linear relationship between CCA and our filter subspace similarity.

Assumption 2.6. Suppose the diagonal elements of Z ⊺ u Z u , Z ⊺ u Z v and Z ⊺ v Z v are larger than nondiagonal element, i.e. , ( Z ⊺ u Z u ) ii ≫ ( Z ⊺ u Z u ) ij .

The Assumption 2.6 suggests different channels of feature Z have a low correlation. Reducing channel-wise dependencies has been studied in [63] and has been shown to benefit model stability. We provide the empirical verification of the assumption in Appendix A.3.

Theorem 2.7. If Assumption 2.6 holds, S CCA ( F u , F v ) is approximately linear to filter subspace similarity, √

where γ 1 , γ 2 and γ 3 contain higher order of features, which can be found in detail with the proof in Appendix A.1. Specifically, we have γ 2 = √ 1 -∆ γ 2 1 γ 2 3 1 cos 2 ( D u , D v ) , and since ∆ are small, with Taylor expansion, γ 2 ≈ 1 -1 2 ∆ γ 2 1 γ 2 3 1 cos 2 ( D u , D v ) . The term 1 cos 2 ( D u , D v ) causes non-linearity in the relation between CCA and filter subspace similarity.

As in Figure 2, we empirically observe the linear correlation between CCA and filter subspace similarity, which agrees with our theoretical findings. In addition, we find that the proposed similarity also shows a strong correlation with CKA.

3 Experiments

In this section, we first validate our theorems with several validation experiments and then demonstrate simple example applications of the proposed filter subspace similarity in efficiently analyzing training dynamics as well as in federated and continual learning scenarios.

3.1 Validation Experiments

We conduct empirical validation to confirm the near-linear relationship between filter subspace similarity and probing-based similarity and explored the limitations of probing-based similarities.

Correlation of CCA and filter subspace similarity. The empirical verification of the correlation between CCA and filter subspace similarity is presented in Figure 2. In this experiment, 10 tasks are

36

42

43

>0.99

>0.99

>0.99

(a)

(b)

(c)

0

150

0

150

0

150

5

17

19

(d)

(e)

(f)

0

20

0

20

0

20

generated from CIFAR-100 dataset [23], each consisting of 10 classes. We employ the ResNet18 model [12], training only the filter atoms while keeping the atom coefficients fixed on each task. The CCA and filter subspace similarity are calculated among 45 pairs of models. The correlation between CCA and filter subspace similarity is 0.9327 , as depicted in Figure 2(b). Furthermore, the correlation between Centered Kernel Alignment (CKA) and filter subspace similarity is also reported in Table 2. These findings clearly indicate that the proposed filter subspace similarity exhibits a strong linear relationship with well-established probing-based similarities, supporting the claims made in Theorem 2.5 and Theorem 2.7.

Limitations of probing-based similarities. The consistency of probing-based similarities can vary depending on the probing data. Ideally, we anticipate a high similarity value when comparing models trained on the same dataset. To investigate this, we conduct an experiment where models are trained on the CIFAR-100 dataset. Figure 3(b) displays the distribution of model similarity with different probing data, where the y-axis represents the similarity and the x-axis represents the corresponding density of models. And with CIFAR-100 probing data, the CCA similarity between models yields a value over 0.8. However, when the probing data are derived from the other datasets including CIFAR-10, SVHN [38], CelebA [31], and etc., the CCA similarity drops to 0.59. A similar inconsistency in values is observed with the CKA similarity using different probing data. In contrast, the average of our proposed filter subspace similarity between models is 0.91, which aligns well with our expectation of high similarity. This finding demonstrates the effectiveness of our approach in capturing the inherent similarities between models trained on the same dataset, irrespective of the specific choice of probing data.

3.2 Learning Dynamics

The filter subspace similarity has various applications in analyzing NNs. It is capable of reflecting the data similarity and measuring the evolution of model similarity during the training time. We examine the training dynamics based on the heat map of filter subspace similarities. In this experiment, AlexNet [24] is trained on CIFAR-100 [23] for 150 epochs and VGG11 [50] is fine-tuned on ImageNet [47] for 20 epochs. For both models, we train and store atoms at each epoch. Figure 4 shows heat maps of similarities of the model among different training epochs.

Figure 4(a-c) are heat maps of the 1st, 3rd and 5th convolutional layers of Alexnet. We mark the epoch when the parameters of each layer reaches 0.99 similarity with the their states in the last

SVHN

SVHN

CIFAR100

CIFAR100

Task

20

19

18

17

16

15

14

13

(a) 10th epoch

SVHN

SVHN

CIFAR100

CIFAR100

Task

20

19

18

17

16

15

14

13

(b) 50th epoch

SVHN

SVHN

CIFAR100

CIFAR100

Task

20

19

18

17

16

15

14

13

(c) 90th epoch

epoch. The first layer reaches 0.99 similarity at epoch 36 which is earlier than final layers. In Figure 4(d-f), VGG11 shows a similar behavior. Several previous works have also indicated this bottom-up learning dynamics where layers closer to the input solidify into their final states faster than very top layers [37, 43]. Our filter subspace similarity provides a highly efficient way to examine the training dynamics while showing results in accord with previous studies. Moreover, we can apply our method to calculate the similarity of a model trained on different tasks, so we can track the process of the same model interacting with different datasets. The details are shown in Appendix A.2.

3.3 Federated Learning

Federated learning (FL) aims at learning models collaboratively by leveraging the local computational power and data of all users with the concern of privacy [34]. Personalized Federated Learning (PFL) emerges to address some challenges in FL, such as poor convergence on heterogeneous data and lack of solution personalization [53].

In this setting, our framework achieves personalization by enforcing FL models with the shared atom coefficients for all users and specific filter atoms for each user. As illustrated in Figure 6, the shared coefficients preserve common knowledge, while user-specific atoms hold personalized information about each user. Then, we can assess model relationships with our filter subspace similarity without any probing data, which meets the privacy requirement of the FL scenario.

The shared atom coefficients can be achieved in different ways. With our framework, the coefficient can be obtained from a model pre-trained on a public dataset or from a global model trained by other FL approaches. We can also get the coefficients by training the model locally and evolving the coefficients at each communication round.

Measuring user similarity. With the shared atom coefficients and user-specific filter atoms, we can simply get relations of users by calculating filter subspace similarity. To be specific, we expect that users with similar data have a higher similarity. In this experiment, we distribute data of CIFAR-100 [23] and SVHN [38] to 120 clients, containing 20 SVHN clients and 100 CIFAR clients. Specifically, the SVHN dataset is randomly distributed in 20 SVHN clients. And the CIFAR-100 dataset is split into 20 subtasks with 5 classes in each subtask, and each subtask is shared by 5 CIFAR clients. The model is AlexNet [24] with 3 convolutional layers. The models share the same random initialization and filter atoms are trained independently without communication with other clients. All models are trained for T = 100 communication rounds on datasets. At each round, the client executes 1 epoch of SGD with momentum to train the local model, the learning rate is 0.01 and the momentum is 0.9. The experimental details are described in Appendix A.2.

Figure 5 shows the filter subspace similarity among the last 40 clients of the CIFAR-100 task and 20 clients of the SVHN task. Specifically, a distinct cluster of the 20 SVHN clients is observed, indicating a higher similarity among these clients and dissimilarity with the CIFAR clients. Additionally, every group of 5 CIFAR clients, who share the same task, also exhibit a high similarity among themselves.

This clustering capability holds great potential for facilitating efficient cluster identification in federated learning scenarios [53]. Refer to Appendix Figure 7 for the results of all 120 clients.

The computational cost of three different approaches is shown in Figure 3(a). Notably, calculating the filter subspace similarity is significantly faster ( million times), requiring 0 GPU memory usage than probing-based methods. Note that the advantages in computational efficiency of filter subspace similarity become more prominent as the number of models increases.

Improving personalized model with ensemble of similar users. Once we get the relationships of users, we can further improve the accuracy of the current model by the ensemble of similar models, which is effective to mitigate the data heterogeneity problem in FL. The experiment is described in detail in Appendix A.2. The final results are shown in Table 1. With ensemble, the accuracies of all FL methods can be improved. Note that the results of model ensemble selected by our filter subspace similarity are comparable with probing-based methods while consuming much fewer resources.

3.4 Continual Learning

Continual learning is an open problem in machine learning in which data from multiple tasks arrive sequentially and the model is learned to adapt to new tasks while not forgetting the knowledge from the past [40]. Some of the tasks in continual learning are related, so models trained with these tasks can be benefited from aggregating knowledge from each other. We adopt the setting in [35], and apply filter subspace similarity to find related models. Specifically, we 10-Split CIFAR-100 dataset, where the 100 classes is broken down into 10 tasks with 10 classes per task. We train AlexNet including atoms and atom coefficients on the first task, and train only the atoms on the following tasks. Then, we calculate the task similarity with filter subspace similarity, and report the model ensemble result with most similar members. The accuracy and the similarity computation costs are shown in Table 2. Our method provides higher results and has faster speed compared with probing-based methods.

4 Related Work

Model similarity. Representational similarity analysis (RSA) [22] demonstrates the method of understanding brain activities by computing similarities between brain responses in different regions. Measuring the similarity of models is beneficial for understanding neural network (NN) architectures and learning dynamics [9, 21, 37, 43]. Model similarity can be used to understand or incorporate various machine learning paradigms across different areas, including contrastive learning [13, 15], knowledge distillation [52], meta-learning [42], and transfer learning [5, 39, 44].

Multiple approaches are proposed to estimate the representational similarity of NNs. Some early works show that individual neurons can capture meaningful information [3, 4, 61, 65]. Later, gradientbased methods emerge to provide a visual explanation of deep neural networks [49]. Current popular representational similarity methods rely on features of NN. [43] proposes SVCCA to measure similarity by calculating the covariance matrix of the features of each layer after channel alignments. [21] discusses the invariance properties of similarity indices and proposes CKA with consistent correspondences between layers. probing-based similarities are data-dependent and computationally expensive. But our method measures the representational similarity only via atoms, a portion of model parameters, which is data-agnostic and much more efficient.

Learning paradigm with numerous models. Some machine learning tasks involve numerous models. For example, in Federated learning [53], thousands of models are trained across clients. In Continual learning, there are multiple models generated across time [18]. Federated learning (FL) aims to improve the performance of the system by continuously training and aggregating models from users without collecting data [20, 34, 51]. FL requires communication efficiency while thousands or even millions of clients may be involved [28]. It also required to achieve personalization [14, 53] considering data heterogeneity of different users [6, 17, 28]. Estimating user similarity can effectively address these challenges in FL. Continual learning (CL) aims at providing long-term knowledge accumulation, and the main challenge is to avoid catastrophic forgetting by learning new tasks while remembering the old ones [1, 18, 19, 26, 62]. One promising way is to store neural networks for each task [16, 30, 32, 48, 60]. As the number of tasks increases, a large number of models are generated and stored. It is important to find a way to access their relations to reuse models.

Filter atom decomposition. The research in task subspace modeling treats tasks as compositions of latent basis tasks and their linear combinations [10, 25, 33, 45, 64]. In the context of convolutional filter decomposition, DCFNet [41] introduces the filter subspace as an expansion of convolutional filters using a predetermined set of filter atoms. With the filter subspace, a group of tasks are separately modeled using neural networks, with sets of filter atoms learned for individual tasks, while a common set of atom coefficients is shared among tasks. The applications of filter subspace span among various domains, including domain adaptation [54, 57], continual learning [35], adaptive convolution [56, 59], image generation [55, 58], video comprehension [36], and graph convolution [7].

5 Conclusion

In this paper, we proposed a new paradigm for reducing representational similarity analysis in CNNs to filter subspace distance assessment, which is targeted for application scenarios where numerous models are learned. The proposed approach is targeted for application scenarios where numerous models are learned, and a computationally efficient method to assess model similarities is critical in these scenarios. We provided both theoretical and empirical evidence that the proposed filter subspace-based similarity exhibits a strong linear correlation with popular probing-based metrics while being significantly more efficient and robust in probing data. It was evaluated on both federated learning and continual learning tasks and achieves competitive performance with millions of times reduction in computational cost.

The majority of approaches in FL or CL are applied to the models with the same architecture, the proposed similarity measure with shared atom coefficient is more advantageous to be incorporated in these tasks. Our method currently assumes respective layers among compared CNNs to have coefficients with the same dimension. For our future work, we will explore the way to share atom coefficients among layers to achieve filter subspace similarity with different dimensions.

References

Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV) , 2018.

Manoj Ghuhan Arivazhagan, Vinay Aggarwal, Aaditya Kumar Singh, and Sunav Choudhary. Federated learning with personalization layers. arXiv preprint arXiv:1912.00818 , 2019.

Anthony Bau, Yonatan Belinkov, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. Identifying and controlling important neurons in neural machine translation. In International Conference on Learning Representations , 2018.

David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In Proceedings of the IEEE conference on computer vision and pattern recognition , 2017.

Daniel Bolya, Rohit Mittapalli, and Judy Hoffman. Scalable diverse model selection for accessible transfer learning. Advances in Neural Information Processing Systems , 2021.

Wei Chen, Kartikeya Bhardwaj, and Radu Marculescu. Fedmax: mitigating activation divergence for accurate and communication-efficient federated learning. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases , 2021.

Xiuyuan Cheng, Zichen Miao, and Qiang Qiu. Graph convolution with low-rank learnable local filters. In International Conference on Learning Representations , 2020.

Liam Collins, Hamed Hassani, Aryan Mokhtari, and Sanjay Shakkottai. Exploiting shared representations for personalized federated learning. In International Conference on Machine Learning , 2021.

Kshitij Dwivedi and Gemma Roig. Representation similarity analysis for efficient task taxonomy & transfer learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , 2019.

An Evgeniou and Massimiliano Pontil. Multi-task feature learning. Advances in neural information processing systems , 19:41, 2007.

Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Schölkopf. Measuring statistical dependence with hilbert-schmidt norms. In International conference on algorithmic learning theory , 2005.

Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 770-778, 2016.

Tianyu Hua, Wenxiao Wang, Zihui Xue, Sucheng Ren, Yue Wang, and Hang Zhao. On feature decorrelation in self-supervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision , 2021.

Yutao Huang, Lingyang Chu, Zirui Zhou, Lanjun Wang, Jiangchuan Liu, Jian Pei, and Yong Zhang. Personalized cross-silo federated learning on non-iid data. In Proceedings of the AAAI Conference on Artificial Intelligence , 2021.

Ashraful Islam, Chun-Fu Richard Chen, Rameswar Panda, Leonid Karlinsky, Richard Radke, and Rogerio Feris. A broad study on the transferability of visual representations with contrastive learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision , 2021.

Ghassen Jerfel, Erin Grant, Thomas L Griffiths, and Katherine Heller. Reconciling metalearning and continual learning with online mixtures of tasks. Advances in Neural Information Processing Systems , 2019.

Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Kallista Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. Foundations and Trends® in Machine Learning , 2021.

James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences , 2017.

Soheil Kolouri, Nicholas Ketz, Xinyun Zou, Jeffrey Krichmar, and Praveen Pilly. Attentionbased structural-plasticity. arXiv preprint arXiv:1903.06070 , 2019.

Jakub Koneˇ cn` y, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, and Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492 , 2016.

Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In International Conference on Machine Learning , 2019.

Nikolaus Kriegeskorte, Marieke Mur, and Peter A Bandettini. Representational similarity analysis-connecting the branches of systems neuroscience. Frontiers in systems neuroscience , 2008.

Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images . PhD thesis, University of Toronto, 2009.

Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems , 2012.

Abhishek Kumar and Hal Daume III. Learning task grouping and overlap in multi-task learning. International Conference on Machine Learning , 2012.

Sang-Woo Lee, Jin-Hwa Kim, Jaehyun Jun, Jung-Woo Ha, and Byoung-Tak Zhang. Overcoming catastrophic forgetting by incremental moment matching. In Advances in Neural Information Processing Systems , 2017.

Tian Li, Shengyuan Hu, Ahmad Beirami, and Virginia Smith. Ditto: Fair and robust federated learning through personalization. In International Conference on Machine Learning , 2021.

Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine , 2020.

Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. Federated optimization in heterogeneous networks. Proceedings of Machine Learning and Systems , 2020.

Xilai Li, Yingbo Zhou, Tianfu Wu, Richard Socher, and Caiming Xiong. Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. In International Conference on Machine Learning , 2019.

Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV) , December 2015.

David Lopez-Paz and Marc'Aurelio Ranzato. Gradient episodic memory for continual learning. Advances in neural information processing systems , 2017.

Andreas Maurer, Massi Pontil, and Bernardino Romera-Paredes. Sparse coding for multitask and transfer learning. In International conference on machine learning , pages 343-351. PMLR, 2013.

Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial intelligence and statistics , 2017.

Zichen Miao, Ze Wang, Wei Chen, and Qiang Qiu. Continual learning with filter atom swapping. In International Conference on Learning Representations , 2021.

Zichen Miao, Ze Wang, Xiuyuan Cheng, and Qiang Qiu. Spatiotemporal joint filter decomposition in 3d convolutional neural networks. Advances in Neural Information Processing Systems , 2021.

Ari Morcos, Maithra Raghu, and Samy Bengio. Insights on representational similarity in neural networks with canonical correlation. Advances in Neural Information Processing Systems , 2018.

Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. Advances in Neural Information Processing Systems , 2011.

Behnam Neyshabur, Hanie Sedghi, and Chiyuan Zhang. What is being transferred in transfer learning? Advances in neural information processing systems , 2020.

German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks , 2019.

Qiang Qiu, Xiuyuan Cheng, Guillermo Sapiro, and Robert Calderbank. DCFNet: Deep neural network with decomposed convolutional filters. In International Conference on Machine Learning , 2018.

Aniruddh Raghu, Maithra Raghu, Samy Bengio, and Oriol Vinyals. Rapid learning or feature reuse? towards understanding the effectiveness of maml. In International Conference on Learning Representations , 2019.

Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. Advances in neural information processing systems , 2017.

Maithra Raghu, Chiyuan Zhang, Jon Kleinberg, and Samy Bengio. Transfusion: Understanding transfer learning for medical imaging. Advances in neural information processing systems , 2019.

Bernardino Romera-Paredes, Hane Aung, Nadia Bianchi-Berthouze, and Massimiliano Pontil. Multilinear multitask learning. In International Conference on Machine Learning , pages 1444-1452. PMLR, 2013.

Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention , 2015.

Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV) , 2015.

Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671 , 2016.

Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision , 2017.

Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 , 2014.

Virginia Smith, Chao-Kai Chiang, Maziar Sanjabi, and Ameet S Talwalkar. Federated multi-task learning. In Advances in Neural Information Processing Systems , 2017.

Samuel Stanton, Pavel Izmailov, Polina Kirichenko, Alexander A Alemi, and Andrew G Wilson. Does knowledge distillation really work? Advances in Neural Information Processing Systems , 2021.

Alysa Ziying Tan, Han Yu, Lizhen Cui, and Qiang Yang. Toward personalized federated learning. IEEE Transactions on Neural Networks and Learning Systems , 2022.

Ze Wang. Efficient Adaptation of Deep Vision Models . PhD thesis, Purdue University, 2023.

Ze Wang, Xiuyuan Cheng, Guillermo Sapiro, and Qiang Qiu. Stochastic conditional generative networks with basis decomposition. In International Conference on Learning Representations , 2019.

Ze Wang, Xiuyuan Cheng, Guillermo Sapiro, and Qiang Qiu. Acdc: Weight sharing in atomcoefficient decomposed convolution. arXiv preprint arXiv:2009.02386 , 2020.

Ze Wang, Xiuyuan Cheng, Guillermo Sapiro, and Qiang Qiu. A dictionary approach to domaininvariant learning in deep networks. Advances in neural information processing systems , 2020.

Ze Wang, Seunghyun Hwang, Zichen Miao, and Qiang Qiu. Image generation using continuous filter atoms. Advances in Neural Information Processing Systems , 2021.

Ze Wang, Zichen Miao, Jun Hu, and Qiang Qiu. Adaptive convolutions with per-pixel dynamic filter atom. In Proceedings of the IEEE/CVF International Conference on Computer Vision , 2021.

Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. In International Conference on Learning Representations , 2018.

Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision , 2014.

Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In International Conference on Machine Learning , 2017.

Xingxuan Zhang, Peng Cui, Renzhe Xu, Linjun Zhou, Yue He, and Zheyan Shen. Deep stable learning for out-of-distribution generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , 2021.

Yu Zhang and Qiang Yang. A survey on multi-task learning. IEEE Transactions on Knowledge and Data Engineering , 2021.

Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE conference on computer vision and pattern recognition , 2016.

A Appendix

A.1 Theoretical Proofs

Notations of Convolutional Operations. In our paper, we express convolution operation as Z u = α X p D u . More explicitly, the formulation writes as Z u = α X p ⋆ D u , where ⋆ is the convolutional operation. By converting convolutional kernel D u into a Toeplitz matrix, we can replace the convolution operation X p ⋆ D u with matrix multiplication X p D u . We also modify α by I hw ⊗ α , where ⊗ is Kronecker product, to enable the matrix multiplication α X p D u .

Proposition A.1. Suppose D u and D v are two different sets of filter atoms for a convolutional layer with the common atom coefficients α , we can upper bound the changes in the corresponding features Z u , Z v with atom changes,

Proof. Recall the decomposed convolution can be expressed as,

∀ b we have,

By Cauchy-Schwarz inequality,

we have that

and observe that

where |B| is the area of the domain of X . Then Eq. 12 becomes

which proves that || Z u -Z v || F ≤ ( || α || F λ ) √ |B| · || ( D u -D v ) || F as claimed.

Proposition A.2. Assume filter atoms D u , D v are orthogonal matrices, then S Gras = S Atom .

Proof. Since D u , D v ∈ R k 2 × m are orthogonal matrices, i.e., D T u D u = D T v D v = I , the Grassmann similarity can be represented as,

where σ i = Σ ii , U Σ V = D T u D v .

S Atom is defined as,

Analyze each part separately, we have < vec ( D u ) , vec ( D v ) > = Tr ( D T u D v ) = ∑ m i σ i , || vec ( D u ) || F = √ Tr ( D T u D u ) = √ Tr ( I ) = √ m , and also || vec ( D v ) || F = √ m . In total, the filter subspace similarity becomes,

which equals S Gras . The claimed theorem is proved.

Lemma A.3. For two positive semidefinite matrices A , B ,

where σ min denotes the minimum eigenvalue of A .

Proof. It is equivalent to prove that,

Let C , D be matrices such that A -σ min ( A ) I = C ⊺ C , B = D ⊺ D , then

Theorem A.4. Suppose the forward of decomposed convolution layer for the u -th model is Z u = α XD u . Z u , Z v nearly have zero-mean since X p is preprocessed to be normalized. CCA coefficient is defined as S ( Z u , Z v ) = √ 1 c ∑ c i =1 σ 2 i , where σ 2 i denotes the i -th eigenvalue of Λ u,v = Q u ⊺ Q v , Q u = Z u ( Z ⊺ u Z u ) -1 2 . Then S ( Z u , Z v ) is upper bounded,

where T = Tr ( X ⊺ α ⊺ α X ) , C = σ min ( X ⊺ α ⊺ α X ) .

Proof. Consider S 2 = 1 c ∑ c i =1 σ 2 i .

where

As defined above, we have

Then Equation 23 becomes,

By Cauchy-Schwartz Inequality,

Then we analyze these terms individually,

As for Tr (( Z ⊺ u Z u ) -1 ) , let λ 1 , λ 2 , ..., λ c be eigenvalues for Z ⊺ u Z u listed in descending order ( λ 1 ≥ λ 2 ≥ ... ≥ λ c ), and assume the condition number of Z ⊺ u Z u and Z ⊺ v Z v satisfy λ max /λ min ≤ γ , then,

where λ 1 = || Z ⊺ u Z u || 2 , || · || 2 denotes the operator norm induced by the vector L 2 -norm. With the norm inequalities of any positive semidefinite matrix A ,

where || · || F , || · || ∗ denote the Frobenius norm and the nuclear norm, respectively. Equation (30) then becomes,

where vec ( · ) denotes vectorization of a matrix.

Then Equation 30 is further derived as,

By Lemma A.3,

Similarly, we have

Finally, with Tr ( D ⊺ u D v ) = < vec ( D u ) , vec ( D v ) > , we have

and thus,

Then the claimed theorem is proved.

Lemma A.5. For two matrices A , B , their frobenius norm satisfies,

where ∆ 1 = ∑ ij ( ∑ k A 2 ik )( ∑ k B 2 kj ) · sin 2 ( ⟨ A i : , B : j ⟩ ) .

Proof. According to the definition of frobenius norm ∥ A ∥ F = √∑ ij | A ij | 2 we have,

Note that ( ∑ i x i y i ) 2 = ( ∑ i x 2 i )( ∑ i y 2 i ) · cos 2 ( ⟨ x, y ⟩ ) = ( ∑ i x 2 i )( ∑ i y 2 i ) -( ∑ i x 2 i )( ∑ i y 2 i ) · sin 2 ( ⟨ x, y ⟩ ) , where ⟨ x, y ⟩ is the angle of two vectors x and y . We have,

where A i : is the i -th row of A and B : j is the j -th column of B , ∆ 1 = ∑ ij ( ∑ k A 2 ik )( ∑ k B 2 kj ) · sin 2 ( ⟨ A i : , B : j ⟩ ) . As A i : and B : j are more correlated, ⟨ A i : , B : j ⟩ - → 0 , thus, ∆ 1 ≪∥ A ∥ 2 F ∥ B ∥ 2 F .

Lemma A.6.

Proof. According to Lemma A.5, we have,

where ∆ 1 A 1 / 2 = ∑ ij ( ∑ k ( A 1 / 2 ) 2 ik )( ∑ k ( A 1 / 2 ) 2 kj ) · sin 2 ( ⟨ ( A 1 / 2 ) i : , ( A 1 / 2 ) : j ⟩ ) . As ( A 1 / 2 ) i : and ( A 1 / 2 ) : j are more correlated, ⟨ ( A 1 / 2 ) i : , ( A 1 / 2 ) : j ⟩ - → 0 , thus, ∆ 1 A 1 / 2 ≪∥ A ∥ 2 F .

Lemma A.7. For three matrices A , B , and C , their frobenius norm satisfies,

where ∆ 2 = 1 2 [ ∥ A ∥ 2 F ∑ kj ( ∑ l B 2 kl )( ∑ l C 2 lj ) · sin 2 ( ⟨ B k : , C : j ⟩ ) + ∥ C ∥ 2 F ∑ il ( ∑ k A 2 ik )( ∑ k B 2 kl ) · sin 2 ( ⟨ A i : , B : l ⟩ )] and ∆ 3 = 1 2 [ ∑ ij ( ∑ k A 2 ik )( ∑ k ( BC ) 2 kj ) · sin 2 ( ⟨ A i : , ( BC ) : j ⟩ ) + ∑ ij ( ∑ l ( AB ) 2 il )( ∑ l C 2 lj ) · sin 2 ( ⟨ ( AB ) i : , C : j ⟩ )] .

Proof. Based on Lemma A.5, we have,

Symmetrically, we also have,

Thus,

Thus,

where ∆ 2 = 1 2 [ ∥ A ∥ 2 F ∑ kj ( ∑ l B 2 kl )( ∑ l C 2 lj ) · sin 2 ( ⟨ B k : , C : j ⟩ ) + ∥ C ∥ 2 F ∑ il ( ∑ k A 2 ik )( ∑ k B 2 kl ) · sin 2 ( ⟨ A i : , B : l ⟩ )] and ∆ 3 = 1 2 [ ∑ ij ( ∑ k A 2 ik )( ∑ k ( BC ) 2 kj ) · sin 2 ( ⟨ A i : , ( BC ) : j ⟩ ) + ∑ ij ( ∑ l ( AB ) 2 il )( ∑ l C 2 lj ) · sin 2 ( ⟨ ( AB ) i : , C : j ⟩ )] . Therefore,

As A i : and B : l , B k : and C : j are more correlated, ⟨ A i : , B : l ⟩ , ⟨ B k : , C : j ⟩ , ⟨ A i : , ( BC ) : j ⟩ , ⟨ ( AB ) i : , C : j ⟩ - → 0 , thus, ∆ 2 ≪∥ A ∥ 2 F ∥ B ∥ 2 F ∥ C ∥ 2 F and ∆ 3 ≪∥ A ∥ 2 F ∥ B ∥ 2 F ∥ C ∥ 2 F .

Lemma A.8.

, (47)

where κ F ( A 1 / 2 ) and κ F ( C 1 / 2 ) are the condition number of A 1 / 2 and C 1 / 2 , κ F ( A 1 / 2 ) = √ ( ∑ σ 2 i ( A 1 / 2 ))( ∑ 1 σ 2 i ( A 1 / 2 ) ) and κ F ( C 1 / 2 ) = √ ( ∑ σ 2 i ( C 1 / 2 ))( ∑ 1 σ 2 i ( C 1 / 2 ) ) ; σ 2 i ( A 1 / 2 ) are singular value of A 1 / 2 and σ 2 i ( C 1 / 2 ) are singular value of C 1 / 2 .

Proof. Based on Lemma A.7, we have,

By the definition of condition number κ F ( X ) = ∥ X ∥ F ∥ X -1 ∥ F = √ ( ∑ σ 2 i ( X ))( ∑ 1 σ 2 i ( X ) ) ,

Theorem A.9. Suppose the forward of decomposed convolution layer for the u -th model is Z u = α XD u , CCA coefficient be S ( Z u , Z v ) = √ 1 c ∑ c i =1 σ 2 i , where σ 2 i denotes the i -th eigenvalue of Λ u,v = Q u ⊺ Q v , Q u = Z u ( Z ⊺ u Z u ) -1 2 . Then S ( Z u , Z v ) is approximately linear to filter subspace similarity,

Proof. Based on S ( Z u , Z v ) = √ 1 c ∑ c i =1 σ 2 i and ∥ Λ u,v ∥ F = √∑ c i =1 σ 2 i , where σ i are the singular value of Λ u,v ,

According to Lemma. A.8, we have

where γ 1 = κ F (( Z ⊺ u Z u ) 1 2 ) · κ F (( Z ⊺ v Z v ) 1 2 ) and γ 2 = √ 1 -∆ 2 +∆ 3 ∥ ( Z ⊺ u Z u ) -1 / 2 ∥ 2 F ∥ Z ⊺ u Z v ∥ 2 F ∥ ( Z ⊺ v Z v ) -1 / 2 ∥ 2 F . As Z u = α XD u and Z v = α XD v , we have

where γ 3 = (1 + ∆ 1 ∥ ( D ⊺ u X ⊺ α ⊺ α XD u ) ∥ 2 F ) -1 4 (1 + ∆ 1 ∥ ( D ⊺ v X ⊺ α ⊺ α XD v ) ∥ 2 F ) -1 4 .

As Assumption 2.6 holds, it becomes

Thus, we have

Specifically, we have γ 2 = √ 1 -∆ γ 2 1 γ 2 3 1 cos 2 ( D u , D v ) , and since ∆ are small, with Taylor expansion, γ 2 ≈ 1 -1 2 ∆ γ 2 1 γ 2 3 1 cos 2 ( D u , D v ) . The term 1 cos 2 ( D u , D v ) causes non-linearity in the relation between CCA and filter subspace similarity.

A.2 Experiment Settings

Model training of Federated Learning. In each experiment we have 100 clients in total and sample a ratio r = 0 . 1 of all the clients on every round. All models are randomly initialized and trained for T = 100 communication rounds for the CIFAR datasets. At each round, the client executes 15 epochs of SGD with momentum to train the local model, the learning rate is 0.01 and momentum is 0.9. Accuracies are computed by taking the average local accuracies for all users at the final communication round. As shown in the Table 3, we have different settings for CIFAR-10 and CIFAR-100. For example, (100 , 2) means 100 clients with 2 classes on each client. For each method, the training takes about 12 hours on Nvidia RTX A5000.

Comparison with other FL approaches. We compare our approach by evolving shared atom coefficients with various personalized federated learning methods and federated learning methods with local finetuning. Among these methods, FedPer [2] and FedRep[8] have the similar ideas by learning shared global representation and personalized local heads. Ditto [27] and FedProx [29] induce global regularization to improve the model performance. We also compare our method with FedAvg [34]. FedRep [8] approaches the common knowledge with shared representation. The codes

are adapted from † . We evaluate the test accuracy on CIFAR-10 and CIFAR-100 with different FL setting. As shown in Table 3, our method achieves comparable performance among different methods.

Fine-tuning models for ensemble. We select 3 models with different similarity measures for ensemble. For feature-based similarity methods, we randomly select 1000 examples from CIFAR-100 dataset. The fully-connected layer of each model is fine-tuned on the user's local data with 100 epochs. The fine-tuning takes about 12 hours on Nvidia RTX A5000. After fine-tuning, the accuracy is measured on local test data, with the predictions of current model and 3 selected models.

A.3 Extra Experiments

Representation dependency on filter atoms. We first validate the dependency of deep features on filter atoms in Proposition 2.1 with a simple experiment. The model F here is a 2-layer CNN with coefficient α and atom D generated from normal distribution N (0 , 1) . The input sample X is also generated from normal distribution N (0 , 1) . Figure 8(a) shows the relation between ∥ Z u -Z v ∥ F and ∥ D u -D v ∥ F by fixing coefficient α and input sample X and randomly varying filter atoms D . All the points are below the line which is the bound provided by Proposition 2.1, reflecting that the representation variations are dominated by filter atoms.

Correlation between probing-based and filter subspace-based methods. In addition, we empirically verify that CCA and filter subspace similarity have a strong correlation with AlexNet. In this experiment, 10 tasks are generated from CIFAR100 [23] with 10 classes in each task. Only the filter atoms of each task are trained while the atom coefficients are fixed. We calculate CCA and filter subspace similarity among 45 pairs of models. The correlation between CCA and filter subspace similarity is 0.8638 which is shown in Figure 9(b). Similarly, the correlation between CKA and filter subspace similarity is also reported in Figure 9 (Table). These results clearly show that the proposed filter subspace similarity has high linear relationship with popular probing-based similarities, which agrees with Theorem 2.5 and Theorem 2.7.

0.97

0.63

0.71

𝛂

0.97

1

0.71

1

0.97

0.63

0.63

0.71

1

0.92

0.93

0.94

0.95

0.96

0.97

0.98

0.99

1.00

(a) 10th epoch

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1.00

(b) 50th epoch

0.4

0.5

0.6

0.7

0.8

0.9

1.0

(c) 90th epoch

𝐙

!

-𝐙

"

#

= (𝜆 𝛂

#

)

ℬ

𝐃

!

-𝐃

"

#

𝐃

!

-𝐃

"

#

𝐙

!

-𝐙

"

#

(a)

𝛽

Correlation

0.985

Linear Relationship

(b)

̸

Effect of channel decorrelation. We further design a regularization term β ∑ i = j ( Z ⊺ u Z u ) 2 ij to approach ( Z ⊺ u Z u ) ii ≫ ( Z ⊺ u Z u ) ij in Assumption. 2.6. As shown in Figure 8(b), the correlation between CCA and filter subspace similarity keeps increasing as β increases. The correlation reaches 0.985 when β = 3 × 10 -3 , indicating a near-linear relationship, which is aligned with Theorem. 2.7.

Similar representations across datasets. Similar to [21], we can use filter subspace similarity to compare networks trained on different datasets. In Figure 10(a), we show that pairs of models that are both trained on CIFAR-10 and CIFAR-100 have high atom-based similarities. Models learned on two datasets respectively still show high similarity. In contrast, similarities between trained and untrained models are significantly lower.

Limitation of probing-based methods. As shown in Figure 10(b), to illustrate sensitivity of probing-based similarities to probing data, we perform a simple regression task with data, { ( x i = 0 , y i , z i ) } n i =1 , where z i = f ( x i , y i ) + ϵ i and y i , ϵ i ∼ N (0 . 5 , 0 . 1) . Two NN models F 1 and F 2

Atom-based Similarity

Correlation: 0.8793

(a)

CCA

Atom-based Similarity

Correlation: 0.8638

(b)

Correlation

CCA [43]

0.8638

CKA [21]

0.7358

Grassmann Distance [35]

0.8793

Atom-based Similarity

Layer Index

(a)

x

y

z

𝑧 = 10

𝑦 - 𝑥 +𝜖

(b)

0.825

0.850

0.875

0.900

0.925

0.950

0.975

1.000

(a) 1st conv

0.825

0.850

0.875

0.900

0.925

0.950

0.975

1.000

(b) 2nd conv

0.825

0.850

0.875

0.900

0.925

0.950

0.975

1.000

(c) 3rd conv

0.825

0.850

0.875

0.900

0.925

0.950

0.975

1.000

(d) 4th conv

0.825

0.850

0.875

0.900

0.925

0.950

0.975

1.000

(e) 5th conv

with the same initialization and atom coefficients are trained for their different atoms to learn F : ( X,Y ) - → Z . It is can be simply found that the filter subspace similarity of F 1 and F 2 is 1 and the probing-based similarity is also 1 with the same { ( x i = 0 , y i ) } as the probing data. However, if we choose { ( x ′ i = y i , y ′ i = 0) } as the probing data, then the probing-based similarities directly become 0 as the data are now orthogonal to model parameters.

A.4 Training dynamics.

We investigate the training dynamics of AlexNet [24] and VGG [50] separately on CIFAR-100 [23] and ImageNet [47]. The details of training dynamics of models with atoms from different time point during the training are shown in Figure 11 and Figure 12. Moreover, we examine the similarity between the two participated models shared the same initialization trained only with atoms on two different tasks. The results is shown in Figure 13 and Figure 14. The difference is less on the first few layers, but more on the middle layers. It reflects the middle layer is more critical than other layers, which is aligned with previous work [39].

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(a) 1st conv

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(b) 2nd conv

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(c) 3rd conv

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(d) 4th conv

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(e) 5th conv

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(f) 6th conv

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(g) 7th conv

0.992

0.993

0.994

0.995

0.996

0.997

0.998

0.999

1.000

(h) 8th conv

0

20

40

60

80

100

120

140

0.6

0.7

0.8

0.9

1.0

layer_1

layer_2

layer_3

layer_4

layer_5

(a) Model 0 vs. 1

0

20

40

60

80

100

120

140

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1.00

layer_1

layer_2

layer_3

layer_4

layer_5

(b) Model 0 vs. 2

0

20

40

60

80

100

120

140

0.70

0.75

0.80

0.85

0.90

0.95

1.00

layer_1

layer_2

layer_3

layer_4

layer_5

(c) Model 0 vs. 3

0

20

40

60

80

100

120

140

0.5

0.6

0.7

0.8

0.9

1.0

layer_1

layer_2

layer_3

layer_4

layer_5

(d) Model 0 vs. 4

0

20

40

60

80

100

120

140

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1.00

layer_1

layer_2

layer_3

layer_4

layer_5

(e) Model 0 vs. 5

0

20

40

60

80

100

120

140

0.70

0.75

0.80

0.85

0.90

0.95

1.00

layer_1

layer_2

layer_3

layer_4

layer_5

(f) Model 0 vs. 6

0

20

40

60

80

100

120

140

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1.00

layer_1

layer_2

layer_3

layer_4

layer_5

(g) Model 0 vs. 7

0

20

40

60

80

100

120

140

0.65

0.70

0.75

0.80

0.85

0.90

0.95

1.00

layer_1

layer_2

layer_3

layer_4

layer_5

(h) Model 0 vs. 8

0

20

40

60

80

100

120

140

0.80

0.85

0.90

0.95

1.00

layer_1

layer_2

layer_3

layer_4

layer_5

(i) Model 0 vs. 9

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.984

0.986

0.988

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(a) Model 0 vs. 1

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.988

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(b) Model 0 vs. 2

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.988

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(c) Model 0 vs. 3

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(d) Model 0 vs. 4

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(e) Model 0 vs. 5

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.988

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(f) Model 0 vs. 6

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(g) Model 0 vs. 7

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.990

0.992

0.994

0.996

0.998

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(h) Model 0 vs. 8

0.0

2.5

5.0

7.5

10.0

12.5

15.0

17.5

0.988

0.990

0.992

0.994

0.996

0.998

1.000

layer_0

layer_3

layer_6

layer_8

layer_11

layer_13

layer_16

layer_18

(i) Model 0 vs. 9

Peer reviews:
comments: SUMMARY:
This paper studies neural network similarity which is an important problem in many areas such as federated learning and continue learning. In this paper, the authors develop a new method to reduce NN representational similarity to filter subspace distance. Moreover, they present the effectiveness and efficiency of their algorithms in theory and practice.

STRENGTHS:
1. The problem studied in this paper is fundamental.
2. The algorithm mentioned in this paper is simple and effective.
3. The experimental results show that the method developed in this paper is effective.
4. The authors present the effectiveness of algorithm in theory and practice.

WEAKNESSES:
1. The solution mentioned in this paper can be used for only CNNs.
2. The experimental section can be improved.

QUESTIONS:
1. Is it possible to extend this algorithm to other models? I am interested in why this method can be extended to transformer-based model.
2. As for the experimental section, is it possible to add experimental results over CIFAR-10, SVHN, and ImageNet?

LIMITATIONS:
If the authors can solve the issues mentioned in the Questions, I am willing to improve the rate.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-06-15

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn their paper, the authors introduce a novel approach to significantly decrease the computational cost of representational similarity analysis in CNNs by transitioning it to filter subspace distance evaluation. Their proposed filter subspace-based similarity is both theoretically and empirically demonstrated to display a robust linear correlation with prevalent probing-based metrics.\n\nSTRENGTHS:\n1.\tThe approach offers significant improvements in efficiency and robustness.\n2.\tThe paper is very clear, especially the methodology part is clearly written and easy to understand.\n3.\tThe proposed method is simple, making it easy to implement.\n\nWEAKNESSES:\n1.\tCould you elaborate on how Assumption 2.6 is applicable to complex real-world datasets? It appears to be a strong assumption. For instance, consider a simple matrix $$\\begin{pmatrix}0 & 0\\\\\\ 1 & 0.9\\end{pmatrix}$$, the assumption does not hold true.\n2.\tNo obvious weakness in my mind now.\n\nQUESTIONS:\n1.\tOn line 115, is m a hyperparameter? If yes, is the model performance sensitive to the selection of m?\n2.\tIn Figure 2b, it appears that the points located in the center are less correlated (or more distant from the diagonal blue line) than the points positioned at the ends. Could you explain why this might be?\n3.\tWith regard to Proposition 2.1, would the inequality become significantly looser if many extreme values exist in X?\n4.\tOn line 148, the proposed method suggests averaging layer-wise similarities for network-wise similarity. Is it possible that some layers might be more significant than others? For instance, should the final few layers carry more importance?\n5.\tThe paper [1] outlines certain limitations of CCA/CKA in Section 3, for example, randomly permuting the order of pixels (either at the input or in the latents) is an orthogonal transform, and thus does not affect the CKA. However, this destroys the spatial structure of the input, and intuitively should affect the “representation quality.”, does this apply to the proposed method?\n\n[1]Bansal, Yamini, Preetum Nakkiran, and Boaz Barak. \"Revisiting model stitching to compare neural representations.\" Advances in neural information processing systems 34 (2021): 225-236.\n\nLIMITATIONS:\nAuthors do not discuss the limitation of their work. Based on the information presented, it does not appear that this work has any negative societal impacts.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-08"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper presents a new approach for measuring the similarity between neural network models based on a new efficient metric defined layer-wise on filter atoms. \nIn particular, the metric is defined as the cosine similarity between this filter atoms that can be implemented as the normalised inner product of the filter atom vectors.\nIt is shown that 1) the probing-based similarity CCA is upper-bounded by the proposed metric up to a scaling factor, where both CCA and the factor are data dependant, and 2) under the assumption that the features in a layer have low correlation, there is an approximately linear relation between CCA and the proposed metric. \nExperimental results show that the proposed approach can be effectively used to study the learning dynamics of deep neural networks. The method has been further applied to Personalized Federated Learning and Continual Learning and improves the results over CCA and CKA similarity metrics.\n\nSTRENGTHS:\n- An original theoretically-grounded approach for measuring layer-wise similarity between two neural network models \n- Evaluation on different applications and good results\n\nWEAKNESSES:\n- Comparison only with CCA and CKA-based similarity metrics\n- Assumption 2.6. is quite strong. Although your empirical results seem to corroborate this assumption, in practice I believe there can be strong correlations between different features within a layer. \n- Only AlexNet and VGG are used (a part from the experiment showing the correlation between Grassmann similarity and the proposed filter subspace similarity). It would have been interesting, if the proposed method also performs well for other models, e.g. ResNet models.\n\nQUESTIONS:\n- In the experiments, the overall similarity between two neural networks is computed as the average over the layer-wise similarities. However, intuitively not all layers are equally important for a given task. Would it make sense to use different weights for different layers (i.e. a weighted average)? Would that change the overall results?\n\nLIMITATIONS:\nSee weaknesses.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-09"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes an approach for evaluating neural network similarity by decomposing convolution layer into linear combination of atom filters. The basic idea derives from [33] and the paper extend the approach for continual learning (CL), to federated learning (FL). The paper provides both empirical and theorical evidence and shows the time-efficiency of the proposed method. However, the application scenarios are relatively limited.\n\nSTRENGTHS:\nS1. The paper extends [33], which is originally oriented for continual learning (CL), to federated learning (FL), and compares with CCA and CKA.\n\nS2. In limited cases, the proposed method is more efficient than feature-based similarity evaluation (e.g., CCA [40] and CKA [19])\n\nS3. In limited cases, the proposed method can achieve more accurate similarity evaluation and can provide theoretical justifications.\n\nWEAKNESSES:\nW1. The proposed method has strong restrictions in limited cases.\nW1.1 The proposed method is restricted to only convolutional layers, and it further needs different neural networks using the same atom coefficients. That means the proposed method is hard to be used in the similarity evaluation of common neural networks.\n\nW1.2 The proposed method is restricted to cases where the model architecture must be identical and the model parameters much be similar. For example, in Fig. 2 (Correlation between filter subspace similarity and other approaches), all the three methods achieve a high estimated similarity up to 0.9. What about the cases of lower similarity? The author should present more results for the lower estimated similarity. Thus, it’s unclear whether the proposed method is as flexible as the baselines CCA and CKA, which can be used to compare neural networks with different depths or trained by different datasets. Whether the proposed method can only be used in FL and CL, where the models as well as the parameters are inherently similar? \n\nW1.3 The theoretical evidence in this paper is limited to single-layer convolution, particularly, without nonlinearity. Proposition 2.4 (line 152) is restricted to orthogonal matrices and the case of k^2 =m.  \n\nW2 In FL/CL, the proposed method is time-efficient, but that time is not a severe bottleneck in FL/CL. Furthermore, by nature, the proposed method vectorizes the model parameters and computes the similarities of vectors, which are widely used in multi-task learning. \n\nW3. The proposed method has already been proposed in [33].\n\nQUESTIONS:\nQ1. In the experiment, CKA and CCA compute which layer computation? How does the proposed method consider merging the result of different layers? By concatenation or summation? This paper only discusses the case of single-layer convolution. \n\nQ2. What’s the essential difference between the proposed method and directly computing the cosine similarity and inner product of parameters?\n\nLIMITATIONS:\nNA", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-25"}