Quantifying the Variability Collapse of Neural Networks
Recent studies empirically demonstrate the positive relationship between the
transferability of neural networks and the within-class variation of the last
layer features. The recently discovered Neural Collapse (NC) phenomenon
provides a new perspective of understanding such last layer geometry of neural
networks. In this paper, we propose a novel metric, named Variability Collapse
Index (VCI), to quantify the variability collapse phenomenon in the NC
paradigm. The VCI metric is well-motivated and intrinsically related to the
linear probing loss on the last layer features. Moreover, it enjoys desired
theoretical and empirical properties, including invariance under invertible
linear transformations and numerical stability, that distinguishes it from
previous metrics. Our experiments verify that VCI is indicative of the
variability collapse and the transferability of pretrained neural networks.
Jing Xu, Haoxiong Liu
# Quantifying the Variability Collapse of Neural Networks

###### Abstract

Recent studies empirically demonstrate the positive relationship between the transferability of neural networks and the within-class variation of the last layer features. The recently discovered Neural Collapse (NC) phenomenon provides a new perspective of understanding such last layer geometry of neural networks. In this paper, we propose a novel metric, named Variability Collapse Index (VCI), to quantify the variability collapse phenomenon in the NC paradigm. The VCI metric is well-motivated and intrinsically related to the linear probing loss on the last layer features. Moreover, it enjoys desired theoretical and empirical properties, including invariance under invertible linear transformations and numerical stability, that distinguishes it from previous metrics. Our experiments verify that VCI is indicative of the variability collapse and the transferability of pretrained neural networks.

Machine Learning, Variability Collapse, Neural Networks

## 1 Introduction

The pursuit of powerful models capable of extracting features from raw data and performing well on downstream tasks has been a constant endeavor in the machine learning community (Bommasani et al., 2021). In the past few years, researchers have developed various pretraining methods (Chen et al., 2020; Khosla et al., 2020; Grill et al., 2020; He et al., 2022; Baevski et al., 2022) that enable models to learn from massive real world datasets. However, there is still a lack of systematic understanding regarding the transferability of deep neural networks, _i.e_., whether they can leverage the information in the pretraining datasets to achieve high performance in downstream tasks (Abnar et al., 2021; Fang et al., 2023).

The performance of a pretrained model is closely related to the quality of the features it produces. The recently proposed concept of _neural collapse (NC)_(Papyan et al., 2020) provides a paradigmatic way to study the representation of neural networks. According to neural collapse, the last layer features of neural networks adhere to the following rule of _variability collapse (NC1)_: As the training proceeds, the representation of a data point converges to its corresponding class mean. Consequently, the within-class variation of the features converges to zero.

The deep connection between transferability and neural collapse is rooted in the variability collapse criterion. Previous works (Feng et al., 2021; Kornblith et al., 2021; Sariyildiz et al., 2022) empirically find that although models with collapsed last-layer feature representations exhibit better pretraining accuracy, they tend to yield worse performance for downstream tasks. These works give an intuitive explanation that pushing the feature to their class means results in the loss of the diverse structures useful for downstream tasks. Building upon this understanding, researchers design various algorithms (Jing et al., 2021; Kini et al., 2021; Chen et al., 2022; Dubois et al., 2022; Sariyildiz et al., 2023) that either explicitly or implicitly leverage the variability collapse criterion to retain the feature diversity in the pretraining phase, and thereby improve the transferability of the models.

Straightforward as it is stated, the variability criterion is still not thoroughly understood. One fundamental question is how to mathematically quantify variability collapse. Previous works propose variability collapse metrics that are meaningful in specific settings (Papyan et al., 2020; Zhu et al., 2021; Kornblith et al., 2021; Hui et al., 2022). However, a more principled characterization is required when we want to use variability collapse to analyze transferability. For example, in the linear probing setting, the loss function is invariant to invertible linear transformations on the last layer features. Consequently, it is reasonable to expect that the collapse metric of the features would also be invariant under such transformations, in order to properly reflect the models performance on downstream tasks. However, as we will point out in Section 4.2, no previous metric can achieve this high level of invariance, to the best of the authors' knowledge.
To obtain a well-motivated and well-defined variability collapse metric, we tackle the problem from a loss minimization perspective. Our analysis reveals that the minimum mean squared error (MSE) loss in linear probing on a set of pretrained features can be expressed concisely, with a major component being \(\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]\). Here, \(\Sigma_{B}\) is the between-class feature covariance matrix and \(\Sigma_{T}\) is the overall feature covariance matrix, as defined in Section 3.1. This term serves as an indicator of variability collapse, since it achieves its maximum \(\operatorname{rank}(\Sigma_{B})\) for fully collapse configurations where the feature of each data point coincides with the feature class mean. Furthermore, an important implication of its connection with MSE loss is that the invertible linear transformation invariance of the loss function directly transfers to the quantity \(\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]\).

Motivated by the above investigations, we propose the following collapse metric, which we name **Variability Collapse Index (VCI)**:

\[\text{VCI}=1-\frac{\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]}{ \operatorname{rank}(\Sigma_{B})}.\]

The VCI metric possesses the desirable property of invariance under invertible linear transformation, making it a proper indicator of last layer representation collapse. Furthermore, VCI enjoys a higher level of numerical stability compared previous collapse metrics. We conduct extensive experiments to validate the effectiveness of the proposed VCI metric. The results show that VCI is a valid index for variability collapse across different architectures. We also show that VCI has a strong correlation with accuracy of various downstream tasks, and serves as a better index for transferability compared with existing metrics.

## 2 Related Works

Neural Collapse.The seminal paper Papyan et al. (2020) proposes the concept of neural collapse, which consists of four paradigmatic criteria that govern the terminal phase of training of neural networks.

One research direction regarding neural collapse focuses on rigorously proving neural collapse for specific learning models. A large portion of them adopt the layer peeled model (Mixon et al., 2020; Fang et al., 2021), which treats the last layer feature vector as unconstrained optimization variables. In this setting, both cross entropy loss (Lu and Steinerberger, 2020; Zhu et al., 2021; Ji et al., 2021) and mean square loss (Tirer and Bruna, 2022; Zhou et al., 2022) exhibit neural collapse configurations as the only global minimizers and have benign optimization landscapes. Additionally, other theoretical investigations explore neural collapse from the perspective of optimization dynamics (Han et al., 2021), max margin (Zhou et al., 2022) and more generalized setting (Nguyen et al., 2022; Tirer et al., 2022; Zhou et al., 2022; Yaras et al., 2022)

Another research direction draws inspiration from the neural collapse phenomenon to devise training algorithms. For instance, some studies empirically demonstrate that fixing the last-layer weights of neural networks to an Equiangular Tight Frame (ETF) reduces memory usage (Zhu et al., 2021), and improves the performance on imbalanced dataset (Yang et al., 2022; Thrampoulidis et al., 2022; Zhu et al., 2022) and few shot learning tasks (Yang et al., 2023).

Representation Collapse and Transferability.Understanding and improving the transferability of neural networks to unknown tasks have attracted significant attention in recent years (Tan et al., 2018; Ruder et al., 2019; Zhuang et al., 2020). Previous works (Feng et al., 2021; Sariyildiz et al., 2022; Cui et al., 2022) empirically demonstrate that the diversity of last layer features is positively correlated with the transferability of neural networks, highlighting a tradeoff between pretraining accuracy and transfer accuracy. To address this challenge, various methods (Schilling et al., 2021; Touvron et al., 2021; Xie et al., 2022) have been proposed to quantify and mitigate representation collapse. For example, Kornblith et al. (2021) show that using a low temperature for softmax activation in training reduces class separation and improves transferability. Neural collapse provides a novel perspective for understanding this fundamental tradeoff (Galanti et al., 2021; Li et al.). Notably, Hui et al. (2022) reveal that neural collapse can be at odds with transferability by causing a loss of crucial information necessary for downstream tasks.

## 3 Preliminaries

### Notations and Problem Setup

Throughout this paper, we adopt the following notation conventions. We use \(\|v\|\) to denote Euclidean norm of vector \(v\in\mathbb{R}^{d}\). We use \(\|A\|_{F}\) to denote Frobenious norm and \(A^{\dagger}\) to denote the pseudo-inverse of matrix \(A\in\mathbb{R}^{d\times d}\), \(d\in\mathbb{N}_{+}\). We use \([n]\) as a short hand for \(\{1,\cdots n\}\). We use \(e_{k}\in\mathbb{R}^{K}\) to denote the vector whose \(k\)-th entry is \(1\) and the other entries are \(0\). We use \(\mathbf{1}_{d}\) and \(\mathbf{0}_{d}\) to denote the all-one and the zero vector in \(\mathbb{R}^{d}\), and use \(\mathbf{I}_{d\times d}\) and \(\mathbf{0}_{d\times d}\) to denote the identity matrix and the zero matrix in \(\mathbb{R}^{d\times d}\). We omit the subscripts of dimension when the context is clear.

Consider a \(K\)-class classification problem on a balanced dataset \(\mathcal{D}=\{(x_{k,i},e_{k})\}_{k\in[K],i\in[N]}\), where \(N\) is the number of samples from each class. It is worth noting that the results presented in this paper can be readily extended to imbalanced datasets. Each sample consists of a data point \(x_{k,i}\in\mathbb{R}^{d}\) and an one-hot label \(e_{k}\in\mathbb{R}^{K}\). The classifier \(W\phi(\cdot)+b\) is composed of a feature extractor \(\phi:\mathbb{R}^{d}\to\mathbb{R}^{p}\) and a linear layer with \(W\in\mathbb{R}^{K\times p}\) and
\(b\in\mathbb{R}^{K}\). Let \(h_{k,i}=\phi(x_{k,i})\) denote the feature vector of \(x_{k,i}\), and \(H=(h_{k,i})_{k\in[K],i\in[N]}\in\mathbb{R}^{p\times KN}\) denote the feature matrix. The feature extractor can be any pretrained neural network, till its penultimate layer.

For a given feature matrix, we denote \(\mu_{k}(H)=(1/N)\sum_{i\in[N]}h_{k,i}\) as the \(k\)-th class mean, and \(\mu_{G}(H)=(1/KN)\sum_{k\in[K],i\in[N]}h_{k,i}\) as the global mean. Throughout this paper, we will frequently refer to the following notions of feature covariance. Specifically, we denote the within-class covariance matrix by

\[\Sigma_{W}(H)=\frac{1}{KN}\sum_{k\in[K]}\sum_{i\in[N]}(h_{k,i}-\mu_{k})(h_{k, i}-\mu_{k})^{\top}, \tag{1}\]

and the between-class covariance matrix by

\[\Sigma_{B}(H)=\frac{1}{K}\sum_{k\in[K]}(\mu_{k}-\mu_{G})(\mu_{k}-\mu_{G})^{ \top}. \tag{2}\]

The overall covariance matrix is defined as

\[\Sigma_{T}(H)=\frac{1}{KN}\sum_{k\in[K]}\sum_{i\in[N]}(h_{k,i}-\mu_{G})(h_{k, i}-\mu_{G})^{\top}. \tag{3}\]

A bias-variance decomposition argument gives \(\Sigma_{T}(H)=\Sigma_{B}(H)+\Sigma_{W}(H)\), whose proof is provided in Equation 7 for completeness. We omit the feature matrix \(H\) in the above notations, when the context is clear.

We define \(V_{B}=\text{span}\{\mu_{1}-\mu_{G},\cdots\mu_{k}-\mu_{G}\}\) as the column space of \(\Sigma_{B}\). In the same way, we can define \(V_{W},V_{T}\) as the column space of \(\Sigma_{W}\) and \(\Sigma_{T}\), respectively.

### Previous Collapse Metrics

The first item in the Neural collapse paradigm is referred to as the variability collapse criterion (NC1), which states that as the training proceeds, the within-class variation of the last layer features will diminish and the features will concentrate to the corresponding class means. Use the quantities defined above, NC1 happens if \(\Sigma_{W}\rightarrow\mathbf{0}\). In the related literature, researchers propose various ways to non-asymptotically characterize NC1.

Fuzziness.One of the commonly adopted metrics for NC1 is the normalized within-class covariance \(\mathrm{Tr}[\Sigma_{B}^{!}\Sigma_{W}]\)(Papyan et al., 2020; Zhu et al., 2021; Tirer and Bruna, 2022). The term is commonly referred to as _Separation Fuzziness_ or simply _Fuzziness_ in the related literature (He and Su, 2022), and is inherently related to the fisher discriminant ratio (Zarka et al., 2020).

Squared Distance.Hui et al. (2022) uses the quantity

\[\frac{\sum_{k\in[K]}\sum_{i\in[N]}\|h_{k,i}-\mu_{k}\|^{2}}{N\sum_{k\in[K]}\| \mu_{k}-\mu_{G}\|^{2}} \tag{4}\]

to characterize NC1. In this paper, we refer to it as _Squared Distance_ for convenience. Unlike fuzziness, square distance disregards the structure of the covariance matrix and uses the ratio of the square norm between the within-class variation and the between-class variation as a measure of collapse metric.

Cosine Similarity.Kornblith et al. (2021) uses the ratio of the average within-class cosine similarity to the overall cosine similarity to measure the dispersion of feature vectors. Define \(\mathrm{sim}(x,y)=x^{\top}y/\left(\|x\|\|y\|\right)\) as the cosine similarity between vectors. Denote the within-class cosine distance and overall cosine distance as

\[\bar{d}_{\text{within}} =\sum_{k=1}^{K}\sum_{i=1}^{N}\sum_{j=1}^{N}\frac{1-\mathrm{sim} \left(h_{k,i},h_{k,j}\right)}{KN^{2}},\] \[\bar{d}_{\text{total}} =\sum_{k=1}^{K}\sum_{l=1}^{K}\sum_{i=1}^{N}\sum_{j=1}^{N}\frac{1 -\mathrm{sim}\left(h_{k,i},h_{l,j}\right)}{K^{2}N^{2}}.\]

They refer to the term \(1-\bar{d}_{\text{within}}/\bar{d}_{\text{total}}\) as _class separation_. They also propose a simplified quantity \(1-\bar{d}_{\text{within}}\), and empirically show that both of them have a negative correlation with linear probing transfer performance across different settings. In this paper, we adopt \(\bar{d}_{\text{within}}\) as the baseline metric in Kornblith et al. (2021), and call it _Cosine Similarity_ for brevity.

## 4 What is an Appropriate Variability Collapse Metric?

In this section, we explore the essential properties that a valid variability collapse metric should and should not have.

### Do Last Layer Features Fully Collapse?

The original NC1 argument states that the within class covariance converges to zero, _i.e._, \(\Sigma_{W}\to 0\), as the training proceeds. This implies that a collapse metric should achieve minimum or maximum at these _fully collapsed_ configurations with \(\Sigma_{W}=0\).

However, the following proposition shows that the opposite is not true, _i.e._, full collapse is not necessary for loss minimization.

**Proposition 4.1**.: _Consider a loss function \(\ell:\mathbb{R}^{k}\times\mathbb{R}^{k}\rightarrow\mathbb{R}\). Define the training loss as_

\[L(W,b,H) =\frac{1}{KN}\sum_{k\in[K]}\sum_{i\in[N]}\ell(Wh_{k,i}+b,e_{k})\] \[\quad+\frac{\lambda_{W}}{2}\|W\|_{F}^{2}+\frac{\lambda_{b}}{2}\| b\|^{2}, \tag{5}\]

_where \(\lambda_{W},\lambda_{b}\geq 0\) are regularization parameters. Suppose that \(p>K\), \(N\geq 2\). Then for any constant \(C>0\),
there exists an \(H^{\prime}\), such that \(L(W,b,H^{\prime})=L(W,b,H)\), \(\Sigma_{B}(H^{\prime})=\Sigma_{B}(H)\), but \(\|\Sigma_{W}(H^{\prime})\|_{F}>C\)._

The proof of the proposition is provided in Appendix A.1. It is worth noting that the above proposition does not contradict previous conclusions that ETF configurations are the only minimizers (Zhu et al., 2021; Tirer and Bruna, 2022), since they require feature regularization \((\lambda_{H}/2)\|H\|_{F}^{2}\) in the loss function.

Our experiments show that Proposition 4.1 truly reflects the trend of neural network training. We train a ResNet50 model on ImageNet-1K dataset, and decompose \(\Sigma_{W}\) into the \(V_{B}\) part and the \(V_{B}^{\perp}\) part by computing \((1/KN)\sum_{k\in[K],i\in[N]}\|\text{Proj}_{V_{B}}(h_{k,i}-\mu_{k})\|^{2}\) and \((1/KN)\sum_{k\in[K],i\in[N]}\|\text{Proj}_{V_{B}^{\perp}}(h_{k,i}-\mu_{k})\|^{2}\). The results are shown in Figure 1. We observe that although the \(V_{B}\) part steadily decreases, the \(V_{B}^{\perp}\) part keeps increasing in the training process. Therefore, \(\Sigma_{W}\rightarrow\mathbf{0}\) may not occur for real world neural network training.

Proposition 4.1 and Figure 1 show that the last layer of neural networks exhibits high flexibility due to overparameterization. Consequently, it is unrealistic to expect standard empirical risk minimization training to achieve fully collapsed last layer representation, unless additional inductive bias are introduced. Therefore, requiring that the collapse metric reaches its minima _only_ at fully collapsed configurations, such as Squared Distance, will be too stringent for practical use.

### Invariance to Invertible Linear Transformations Matters

Symmetry and invariance is a core concept in deep learning (Gens and Domingos, 2014; Tan et al., 2018; Chen et al., 2019). The collapse metric discussed in Section 3.2 enjoy certain level of invariance properties.

**Observation 4.2**.: _The Fuzziness metric \(\operatorname{Tr}[\Sigma_{B}^{\dagger}\Sigma_{W}]\) is invariant to invertible linear transformation \(U\in\mathbb{R}^{p\times p}\) that can be decomposed into two separate transformations in \(V_{B}\) and \(V_{B}^{\perp}\). The claim comes from the fact that_

\[\operatorname{Tr}\left[\left(U\Sigma_{B}U^{\top}\right)^{\dagger} U\Sigma_{W}U^{\top}\right]\] \[=\operatorname{Tr}\left[U^{-1,\top}\Sigma_{B}^{\dagger}U^{-1}U \Sigma_{W}U^{\top}\right]\] \[=\operatorname{Tr}\left[\Sigma_{B}^{\dagger}\Sigma_{W}\right].\]

_However, Fuzziness is not invariant to all invertible linear transformations in \(\mathbb{R}^{p}\). A simple counter example is \(\Sigma_{B}=\left[\begin{array}{cc}1&0\\ 0&0\end{array}\right]\), \(\Sigma_{W}=\left[\begin{array}{cc}1&0\\ 0&1\end{array}\right]\), and the linear transformation \(U=\left[\begin{array}{cc}1&1\\ 0&1\end{array}\right]\). It can be calculated that \(\operatorname{Tr}\left[\left(U\Sigma_{B}U^{\top}\right)^{\dagger}U\Sigma_{W}U^ {\top}\right]=2\neq 1=\operatorname{Tr}\left[\Sigma_{B}^{\dagger}\Sigma_{W}\right]\)._

**Observation 4.3**.: _The Squared Distance metric in Equation 4 is invariant to isotropic scaling and orthogonal transformation on the feature vectors, i.e., since such transformations preserve the pairwise distance between the feature vectors. However, it is not invariant to invertible linear transformations in \(\mathbb{R}^{p}\)._

**Observation 4.4**.: _The Cosine Similarity metric is invariant to independent scaling of each \(h_{k,i}\). It is also invariant to orthogonal transformation in \(\mathbb{R}^{p}\), as such transformations preserves the cosine similarity between feature vectors. But it is easy to see that Cosine Similarity is not invariant to invertible linear transformation in \(\mathbb{R}^{p}\)._

However, the next proposition shows that the linear probing loss of the last layer feature is invariant under a much more general class of transformations.

**Observation 4.5**.: _The minimum value of loss function in Equation 5 is invariant to invertible linear transformations on the feature vector, i.e._

\[\min_{W,b}L(W,b,H)=\min_{W,b}L(W,b,VH),\]

_for any invertible \(V\in\mathbb{R}^{p\times p}\)._

In other words, if we have two pretrained models \(\phi_{1}(\cdot)\) and \(\phi_{2}(\cdot)\), and there exists an invertible linear transformation \(V\in\mathbb{R}^{p\times p}\) such that \(\phi_{1}(x)=V\phi_{2}(x)\) for any \(x\in\mathbb{R}^{d}\), then \(\phi_{1}(\cdot)\) and \(\phi_{2}(\cdot)\) will have exactly the same linear probing loss on any downstream data distribution. Therefore, when considering a collapse metric that may serve as an indicator of transfer accuracy, it is desirable for the metric to exhibit invariance to invertible linear transformations. However, as discussed previously, the metrics listed in Section 3.2 do not possess this level of invariance.

Figure 1: **Projections of Squared Distance onto \(V_{B}\) and \(V_{B}^{\perp}\) show opposite trends as the training proceeds. The model is a ResNet50 trained on ImageNet-1K, using the setting specified in Section 6.1.**
### Numerical Stability Issues

Numerical stability is an essential property for the collapse metric to ensure its practical usability. Unfortunately, the Fuzziness metric is prone to numerical instability, primarily due to the pseudoinverse operation applied to \(\Sigma_{B}\).

Firstly, the between-class covariance matrix \(\Sigma_{B}\) is singular when \(K\leq p\), and its rank is unknown. Due to computational imprecision, its zero eigenvalues are always occupied with small nonzero values. In the default PyTorch (Paszke et al., 2019) implementation, the pseudoinverse operation includes a thresholding step to eliminate the spurious nonzero eigenvalues. However, selecting the appropriate threshold is a manual task, as it may vary depending on the architecture, dataset, or training algorithms.

To tackle this issue, one possible solution is to retain only the top \(\min\{p,K-1\}\) eigenvalues, which is the maximum rank of \(\Sigma_{B}\). Nevertheless, \(\Sigma_{B}\) can still possess small trailing nonzero eigenvalues. For example, in the experiments illustrated in Figure 2, the \(999\)-th eigenvalue is about \(2\times 10^{-3}\), significantly smaller than the typical scale of nonzero eigenvalues. Including such small eigenvalues in the computation would yield a substantially large fuzziness value.

To address the numerical stability issue, an alternative approach is to discard the \(\Sigma_{B}\) and instead employ the more well-behaved overall covariance matrix \(\Sigma_{T}\). As shown in Figure 2, the eigenvalues of \(\Sigma_{T}\) exhibit a larger scale and a more uniform distribution compared with eigenvalues of \(\Sigma_{B}\), making it a numerically stable choice for pseudoinverse operation. Interestingly, the quantity \(\Sigma_{T}^{\dagger}\) naturally emerges in the solution of a loss minimization problem, which we will explore in the next section.

## 5 The Proposed Metric

As we have discussed, the existing collapse metrics discussed in Section 3.2 do not have the desired properties to fully measure the quality of the representation in downstream tasks. In this section, we introduce a novel and well-motivated collapse metric, which we call Variability Collapse Index (VCI), that satisfy all the aforementioned properties.

Previous studies (Zhu et al., 2021; Tirer and Bruna, 2022) indicate that fully collapsed last layer features minimizes the linear probing loss. Therefore, it is natural to explore the inverse direction, namely, using the linear probing loss to quantify the collapse level of last layer features.

Suppose we have a labeled dataset with corresponding last layer feature \(H=(h_{k,i})_{k\in[K],i\in[N]}\). We perform linear regression on the last layer to find the optimal parameter \(W\) that minimizes the following MSE loss:

\[L(W,b,H)=\frac{1}{2KN}\sum_{k\in[K],i\in[N]}\|Wh_{k,i}+b-e_{k}\|^{2}.\]

The following theorem gives the optimal linear probing loss.

**Theorem 5.1**.: _The optimal linear probing loss has the following form._

\[\min_{W,b}L(W,b,H)=-\frac{1}{2K}\operatorname{Tr}\left[\Sigma_{T}^{\dagger} \Sigma_{B}\right]+\frac{1}{2}-\frac{1}{2K},\]

_where \(\Sigma_{B}\) and \(\Sigma_{T}\) are the between-class and overall covariance matrix defined in Equation 2 and 3._

Theorem 5.1 shows that the information of the minimum MSE loss can be fully captured by the simple quantity \(\operatorname{Tr}\left[\Sigma_{T}^{\dagger}\Sigma_{B}\right]\). It is easy to see that the minimum of \(\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]\) is \(0\). The following theorem gives an upper bound of \(\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]\).

**Theorem 5.2**.: \(\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]\leq\operatorname{rank}( \Sigma_{B})\)_. The equality holds for fully collapsed configuration \(\Sigma_{W}=\mathbf{0}\)._

The term \(\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]\) has a positive correlation with the level of collapse in the representation. Theorem 5.1 implies that for MSE loss, a more collapsed representation leads to a smaller loss. Therefore, this term is a natural candidate for collapse metric.

**Definition 5.3**.: Define the **Variability Collapse Index (VCI)** of a set of features \(H=(h_{k,i})_{k\in[K],i\in[N]}\) as

\[\text{VCI}=1-\frac{\operatorname{Tr}[\Sigma_{T}^{\dagger}\Sigma_{B}]}{ \operatorname{rank}(\Sigma_{B})},\]

where \(\Sigma_{B}\) and \(\Sigma_{T}\) are the between-class and overall covariance matrix defined in Equation 2 and 3.

One of the advantages of VCI is its invariance to invertible linear transformations, which is inherited from the invariance of the MSE loss.

Figure 2: **The Eigenvalue spectra of \(\Sigma_{B}\) and \(\Sigma_{T}\).** The spectrum of \(\Sigma_{T}\) has a substantially larger scale. The model is a ResNet50 trained on ImageNet-1K, using the setting specified in Section 6.1.
**Corollary 5.4**.: _VCI is invariant to invertible linear transformation of the feature vector, i.e., multiplying each \(h_{k,i}\) with an invertible matrix \(U\in\mathbb{R}^{p\times p}\)._

Proof.: From Observation 4.5, we know that the minimum of the loss function \(L(W,b,H)\) is invariant to invertible linear transformations on \(H\). This implies the same invariance property of the term \(\operatorname{Tr}[\Sigma_{T}^{\top}\Sigma_{B}]\). The proof is complete by noting that invertible linear transformation will also preserve the rank of \(\Sigma_{B}\). 

Another advantage of VCI lies in its numerical stability. This advantage primarily stems from the well-behaved nature of the spectrum of \(\Sigma_{T}\) compared to that of \(\Sigma_{B}\), as discussed in Section 4.3. Therefore, the pseudo-inverse operation does not lead to an explosive increase in VCI. Furthermore, one can safely takes \(\operatorname{rank}(\Sigma_{B})=\min\{p,K-1\}\), since the unknown rank is not the cause of numerically instability as in Fuziness.

## 6 Experiment Results

In this section, we present experiments that reflect the differences between the previous variability collapse metrics and our proposed VCI metric.

### Setups

We conduct experiments to analyze the behavior of four variability collapse metrics, namely Fuzziness, Squared Distance, Cosine Similarity. We evaluate the metrics on the feature layer of ResNet18 (He et al., 2016) trained on CIFAR10 (Krizhevsky et al., 2009) and ResNet50 / variants of ViT (Dosovitskiy et al., 2020) trained on ImageNet-1K with AutoAugment (Cubuk et al., 2018) for 300 epochs. ResNet18s are trained on one NVIDIA GeForce RTX 3090 GPU, ResNet50s and ViT variants are trained on four GPUs. The batchsize for each GPU is set to 256. The metric values are recorded every 20 epochs, where \(\operatorname{rank}(\Sigma_{B})\) in the expression of VCI is taken to be \(\min\{p,K-1\}\) as stated in the previous section.

For all experiments on ResNet models, We use the implementation of ResNet from the torchvision library, called 'ResNet v1.5'. We use SGD with Nesterov Momentum as the optimizer. The maximum learning rate is set to \(0.1\times\text{batch size}/256\). We try both the cosine annealing and step-wise learning rate decay scheduler. When using a step-wise learning rate decay schedule, the learning rate is decayed by a factor of 0.975 every epoch. We also use a linear warmpup procedure of 10 epochs, starting from an initial \(10^{-5}\) learning rate. The weight-decay factor is set to \(8\times 10^{-5}\). For training on CIFAR10, we replace the random resized crop with random crop after padding 4 pixels on

Figure 4: **Variability Collapse metrics of training ResNet50 on ImageNet-1k dataset. From left to right: Fuzziness, Squared Distance, Cosine Similarity and our proposed VCI. The three curves are obtained with different training settings, all achieving \(\geq\) 77.8\(\%\) test accuracy. green: CE loss. orange: MSE loss. blue: MSE loss + cosine annealing schedule.**

Figure 3: **Variability Collapse metrics of training ResNet18 on CIFAR-10 dataset. From left to right: Fuzziness, Squared Distance, Cosine Similarity and our proposed VCI. The three curves are obtained with different training settings specified below, all achieving \(\geq\) 92.1\(\%\) test accuracy. Green: step-wise lerning rate decay schedule. Orange: cosine annealing schedule. Blue: cosine annealing schedule without weight decay and warmup.**
each side as in He et al. (2016). Cross-Entropy loss is used if not specified otherwise.

For DeiT-T and DeiT-S (Touvron et al., 2021), the two ViT variants used in our experiments, we use AdamW (Loshchilov and Hutter, 2017) with a cosine annealing scheduler as the optimizer. We incorporate a linear warm-up phase of 5 epochs, starting from a learning rate of \(10^{-6}\) and gradually increasing to the maximum learning rate of \(10^{-3}\). For other modules of training, such as weight initialization, mixup/cutmix, stochastic depth and random erasing, we keep the same with those of Touvron et al. (2021).

At test time for ImageNet-1K, we resize the short side of image to a length of 256 pixels and perform a center crop. When evaluating the variability collapse metrics, we use the same data transformation as at test time. All transformed images are finally normalized with ImageNet mean and standard deviation during training, testing, and metric evaluation.

### How do Variability Collapse Metrics Evolve as the Training Proceedts

Figure 3 demonstrates the trend of four different variability collapse metrics when training ResNet18 on CIFAR-10. It is observed that Squared Distance and Cosine Similarity fail to exhibit a consistent trend of collapse, as explained in Section 4.1. On the other hand, Fuzziness and VCI show a decreasing trend across these settings.

The results for ResNet50s trained on ImageNet are provided in Figure 4. In contrast to the case of ResNet18 on CIFAR10, all evaluated metrics consistently demonstrate a decreasing curve since the ratio of the \(V_{B}^{\perp}\) part becomes smaller with a smaller \(p/K\) value, as shown in Figure 1. Additionally, it is observed that neural networks trained with MSE loss exhibit a higher level of collapse compared to those trained with CE loss, which aligns with the findings of Kornblith et al. (2021).

The results for ViT variants trained on ImageNet are given in Figure 5. For DeiT-T and DeiT-S with embedding dimensions of 192 and 384, \(V_{B}\) becomes the whole feature space due to \(p<K\), leading to a clearer trend of variability collapse since \(V_{B}^{\perp}\) becomes \(0\).

Finally, we show that test collapse also happens for VCI in Figure 6. This indicates that variability collapse is a phenomenon that reflects the properties of underlying data distributions, rather than being solely caused by overfitting the training datasets. We refer to Appendix B for comparisons between train collapse and test collapse for other variability metrics.

Figure 5: **Variability Collapse metrics of training ViT on ImageNet-1k dataset. From left to right: Fuzziness, Squared Distance, Cosine Similarity and our proposed VCI. Blue: DeiT-S. Orange: DeiT-T. All of the four metrics indicate variability collapse happens for this setting.**

Figure 6: **Train Collapse and Test Collapse both happen for VCI. Train collapse is evaluated on a 50000 subset of ImageNet-1K training dataset. Test collapse is evaluated on the full ImageNet-1K test dataset. Left: ResNet18 on CIFAR-10. Middle: ResNet50 on ImageNet-1K. Right: DeiT-S on ImageNet-1K.**
### Only VCI consistently Indicates Transferability

In this section, we investigate the correlation between variability metrics and transferability through two sets of experiments. We pretrain ResNet50 on ImageNet-1K with a single varying hyperparameter specified within each group. We evaluate the pretrained neural representations using linear probing (Kornblith et al., 2019; Chen et al., 2020) on 10 downstream datasets, including Oxford-IIIT Pets (Parkhi et al., 2012), Oxford 102 Flowers (Nilsback and Zisserman, 2008), FGVC Aircraft (Maji et al., 2013), Stanford Cars (Krause et al., 2013), the Describable Textures Dataset (DTD) (Cimpoi et al., 2014), Food-101 dataset (Bossard et al., 2014), CIFAR-10 and CIFAR-100 (Krizhevsky et al., 2009), Caltech-101 (L. Fei-Fei et al., 2004), the SUN397 scene dataset (Xiao et al., 2010). We use L-BFGS to train the linear classifier, with the optimal \(L_{2}\)-penalty strength determined by searching through 97 logarithmically spaced values between \(10^{-6}\) and \(10^{6}\) on a validation set. We provide the raw experiment results in Appendix C.

We use the following **mean log odds gain**

\[\mathrm{MLOG}=\frac{1}{10}\sum_{i=1}^{10}\log\frac{p_{i}}{1-p_{i}}-\log\frac{ p_{\text{pretrain}}}{1-p_{\text{pretrain}}} \tag{6}\]

to measure the transferability of a neural representation, where \(p_{\text{pretrain}}\) is the final test accuracy in pretraining. Compared with Kornblith et al. (2019), we subtract the log odds of the pretrain accuracy from the mean log odds of linear classification accuracy over the downstream tasks, to isolate the impact of variability collapse on transfer performance.

In the first group, we change the temperature \(\tau\) in the softmax function

\[\mathrm{Softmax}_{\tau}(z)=\left(\frac{\exp(\frac{1}{\tau}z_{1})}{\sum_{k=1}^ {K}\exp(\frac{1}{\tau}z_{k})},\cdots,\frac{\exp(\frac{1}{\tau}z_{K})}{\sum_{k= 1}^{K}\exp(\frac{1}{\tau}z_{k})}\right).\]

The results of the first group of experiments are shown in the top row of Figure 7. The results are consistent with the findings in (Kornblith et al., 2021), as all considered metrics show a negative relation between variability collapse and transfer performance.

In the second group of experiments, we introduce regularization to control the collapse behavior of neural networks (Kornblith et al., 2021). The regularization term we used is the average within-class cosine similarity divided by the number of data points of each class in the batch. By varying the value of \(\lambda\) multiplied to the regularization term, we investigate whether the observed correlation in the first group still holds true. The bottom row of Figure 7 shows that for the three previous metrics, the correlation changes from positive to negative, or vice versa. However, a strong positive correlation consistently holds between VCI and transferability. Therefore, VCI serves as an effective indicator of transfer performance, compared to other variability collapse metrics.

## 7 Conclusions and Future Directions

In this paper, we study the variability collapse phenomenon of neural networks, and propose the VCI metric as a quan

Figure 7: **Only VCI consistently indicates transferability in both groups of our experiments:** In each graph, x-axis represents the metric value evaluated on a 50000 subset of ImageNet train set, y-axis shows the mean log odds gain defined as in Equation (6), and the Pearson correlation coefficient is shown in the legend. **Top Row**: A negative relation between all variability metrics and transferability can be observed when changing the temperature \(\tau\) of softmax in pretraining. **Bottom Row**: Nearly opposite trends emerge on previous variability metrics when we adjust the coefficient \(\lambda\) of the Cosine Similarity regularization term. In contrast, VCI maintains a positive correlation with the mean log odds gain.
titative characterization. We demonstrate that VCI enjoys many desired properties, including invariance and numerical stability, and verify its usefulness via extensive experiments.

Moving forward, there are several promising directions for future research. Firstly, it would be beneficial to explore the applicability of VCI to a broader range of training recipes and architectures, by analyzing its performance using alternative network architectures, training methodologies, and datasets. Secondly, it would be valuable to conduct theoretical investigations into the relationship between variability collapse and transfer accuracy. Understanding the mechanisms and principles behind this could provide insights to designing better transfer learning algorithms.

## Acknowledgements

The authors would like to acknowledge the support from the 2030 Innovation Megaprojects of China (Programme on New Generation Artificial Intelligence) under Grant No. 2021AAA0150000.
