Learning Continually by Spectral Regularization

## Abstract

Abstract † † footnotetext: Correspondence to: Alex Lewandowski <lewandowski@ualberta.ca>. Loss of plasticity is a phenomenon where neural networks can become more difficult to train over the course of learning.
Continual learning algorithms seek to mitigate this effect by sustaining good performance while maintaining network trainability.
We develop a new technique for improving continual learning inspired by the observation that the singular values of the neural network parameters at initialization are an important factor for trainability during early phases of learning.
From this perspective, we derive a new spectral regularizer for continual learning that better sustains these beneficial initialization properties throughout training.
In particular, the regularizer keeps the maximum singular value of each layer close to one.
Spectral regularization directly ensures that gradient diversity is maintained throughout training, which promotes continual trainability, while minimally interfering with performance in a single task.
We present an experimental analysis that shows how the proposed spectral regularizer can sustain trainability and performance across a range of model architectures in continual supervised and reinforcement learning settings.
Spectral regularization is less sensitive to hyperparameters while demonstrating better training in individual tasks, sustaining trainability as new tasks arrive, and achieving better generalization performance.

## 1 Introduction

A longstanding goal of machine learning research is to develop algorithms that can learn continually and cope with unforeseen changes in the data distribution (Ring, , Thrun, ).
Current learning algorithms, however, struggle to learn from dynamically changing targets and are unable to adapt gracefully to unforeseen changes in the distribution during the learning process (Zilly et al., , Abbas et al., , Lyle et al., , Dohare et al., ).
Such limitations can be seen as a byproduct of assuming, one way or another, that the problem is stationary.
Recently, there has been growing recognition of the fact
that there are limitations to what can be learned from a fixed and
unchanging dataset (Hoffmann et al., ), that there are implicit non-stationarities in many problems of interest (Igl et al., ), and that some real-world problems benefit from learning continually (Han et al., , Janjua et al., ).

The concept of plasticity has been receiving growing attention in the continual learning literature, where the loss of plasticity—either a reduction in a neural network’s ability to train (Dohare et al., , Lyle et al., , Elsayed and
Mahmood, ), or ability to generalize (Ash and Adams, , Zilly et al., )—has been noted as a critical shortcoming in current learning algorithms.
Learning algorithms, and more specifically neural networks, that are performant in the non-continual learning setting, often struggle when applied to continual learning problems.
Settings where a neural network must continue to learn after changes occur in the data distribution
exhibit a striking loss of plasticity such that learning slows down (Lyle et al., ) or even halts after successive changes (Abbas et al., , Nikishin et al., , Dohare et al., ).

Several aspects of a learning algorithm have been found to contribute to or mitigate loss of plasticity. Examples include the type of optimizer (Dohare et al., , Lyle et al., ), the step-size (Ash and Adams, , Berariu et al., ), the number of optimiser iterations (Lyle et al., ), and the use of specific regularizers (Dohare et al., , Lyle et al., , Kumar et al., , Lewandowski et al., ).
Such factors hint that there might be simpler underlying optimisation principles that govern the loss of plasticity.
For example, the success of several methods that regularize neural networks towards properties of the initialization suggests that some of those properties mitigate loss of plasticity (Dohare et al., , Kumar et al., , Lyle et al., ).

The properties of neural network weights at initialization are associated with trainability in the early phases of learning.
Previous analyses have demonstrated that the trainability of deep neural networks can be improved by ensuring that the initialization variance of hidden activations and gradients remains uniform across the different layers of the neural network
(Glorot and Bengio, ),
which has the effect of keeping the average singular value of the layerwise Jacobians close to one.
A stronger condition is dynamical isometry, where all singular values are close to one, or exactly one in the case of an orthogonal initialization (Saxe et al., , Pennington et al., , Xiao et al., ).
Over the course of learning, the singular values deviate from their initialization and tend to grow over time (Martin and Mahoney, ), which can reduce trainability and impede continual learning.

Given the effectiveness of initialization
in ensuring the trainability of a neural network,
continual learning algorithms may benefit from sustaining the relevant
properties of the weights. This is the motivation of several methods
that use the initialization either through regularization
(Kumar et al., ) or weight reinitialization
(Dohare et al., , Sokar et al., , Dohare et al., ).
Such methods leverage the initialization explicitly, either by regularizing
parameters towards their initial values or by resetting
parameters by resampling them from the initialization distribution.
In this paper, we seek to more directly address the loss of trainability by sustaining the key *properties* present at initialization, thereby striking a better balance between trainability and performance compared to approaches that replicate the initialization explicitly.

We investigate the key properties of the initialization that ensure trainability, how
these properties are lost over the course of learning, and the effects this has
on continual learning.
We identify that deviations from the initial singular value distribution can result in low gradient diversity, thereby impeding continual learning.
Based on this analysis, we then introduce a spectral regularizer to control the deviation of the singular values by keeping the maximum singular value of each layer close to one to directly address the deviation of the singular values from initialization over the course of learning.
Our experiments show that spectral
regularization is more performant and less sensitive to hyperparameters than
other regularizers across datasets, nonstationarities, and architectures. While
well-tuned regularizers are often able to mitigate loss of plasticity to a varying
degree, learning continually with spectral regularization is robust, achieving high initial and sustained performance.
In particular, we show that spectral regularization is also capable of improving generalization with both Vision Transformer (Dosovitskiy et al., ) and ResNet-18
(He et al., ) on continual versions of tiny-ImageNet (Le and Yang, ),
CIFAR10, CIFAR100 (Krizhevsky, ), and SVHN2 (Netzer et al., ).
Note that these datasets and architectures encompass *all* continual supervised learning experimental settings considered in the loss of plasticity literature.
We also show that spectral regularization can improve the performance of soft-actor critic (Haarnoja et al., ) in reinforcement learning settings where loss of plasticity occurs due to primacy bias (Nikishin et al., ).

## 2 Problem Setting

We investigate the trainability of neural network learning algorithms in the task-agnostic setting.
We denote a neural network with $L$ layers, defined recursively as $f_{\theta}(x):=h_{L}(x)$, where $h_{0}(x)=x$ is the input vector, $h_{l+1}(x)=\phi(\mathbf{W}_{l}h_{l}(x)+\mathbf{b}_{l})$ with an element-wise activation function, $\phi$,
and parameters $\theta=\{\theta_{L},\dots,\theta_{1}\}$ where $\theta_{l}=\{\mathbf{W}_{l},\mathbf{b}_{l}\}$ is the weight and bias parameter for layer $l$.(^1^11In this notation we suppressed the presence of biases, which can effectively be included in the parameters.) We assume that $f_{\theta}$ is trained over a sequence of tasks: the $\tau$th task is specified by a distribution $p_{\tau}$ over the observation-target pairs, denoted by $(x,y)$.
For simplicity we assume that the task (data distribution) changes periodically after every $T$ iterations. In addition, we consider the task-agnostic setting, where the learning
algorithm does not have access to information about the task except through the data that it samples.
For each iteration in the task, $t\in\left((\tau-1)T,\tau T\right]$, the learning algorithm optimises the neural network’s parameters to minimize the objective

$$ $J_{\tau}(\theta)=\mathbb{E}_{(x,y)\sim p_{\tau}}\big{[}\ell(f_{\theta}(x),y) \big{]},$ $$

for some loss function $\ell$. In this paper, we consider gradient-based methods to learn the weight parameters; the basic version of gradient descent would update the parameters at iteration $t$ as $\theta^{(t+1)}=\theta^{(t)}-\alpha\nabla_{\theta}J_{\tau(t)}(\theta)\big{|}_{
\theta=\theta^{(t)}}$, where $\tau(t)=\lfloor t/T\rfloor$ denotes the current task number. In practice this is done by considering the empirical error instead of $J_{\tau(t)}$ using samples from the task distribution, $(x_{t},y_{t})\sim p_{\tau}$, and usually some more involved optimization algorithm.

The evaluation of the continual learning algorithm is performed at the end of a task
(Lyle et al., ).
Specifically, the learning algorithm is evaluated at times $t=\tau T$, after being given $T$ iterations to learn on task $\tau$.
A useful assumption in some problems is that each task is sampled independently and identically, and that each task is equally difficult, meaning that a
neural network which is randomly initialized on each task is able to reach a similar objective value for any particular task (Lyle et al., , Elsayed and
Mahmood, , Dohare et al., ).
While this assumption is useful, it is not always applicable.
In class-incremental learning (Van de Ven et al., ), the addition of more classes increases the difficulty of subsequent tasks.
Another example is the transient tasks induced over the course of reinforcement learning (Igl et al., ), which can have varying task difficulty and lead to loss of plasticity due to primacy bias (Nikishin et al., ). We also consider such settings here.

Loss of plasticity in the continual learning literature can refer to either loss of trainability (Dohare et al., , Lyle et al., ) or to loss of generalization (Ash and Adams, ).
Because trainability is a requirement for learning and generalization, we focus primarily on loss of trainability.
Specifically, we use loss of trainability to refer to the phenomenon that the objective
value, $J_{\tau}(\theta^{(\tau T)})$, increases as a function of the task $\tau$.
Equivalently, the performance measures, such as accuracy, decrease with new tasks.
Under the assumption that the tasks are sampled independently and identically, this would suggest that the neural network’s trainability diminishes on new tasks.

## 3 Spectral Properties and Continual Trainability

At a high level, the reason behind loss of plasticity is simple: the solution of one task becomes the initialization for learning on the next task, and if this initialization is not sufficiently good to enable learning in the new task, we face the aforementioned problem.
To avoid this issue, we need to keep the network parameters within a region that can serve as good initialization at the start of a task.
This approach comes with two challenges:
(i) determining a suitable region for parameter initialization on any given task;
(ii) ensuring that training within the initialization region does not prevent effective learning on the current task.

It is easy to satisfy (i) and (ii) in isolation: using a standard initialization algorithm, such as those by Hinton and Salakhutdinov (), He et al. (), and then keeping the parameters fixed at this value satisfies (i) but clearly does not satisfy (ii).
Conversely, not restricting the parameter space while using a standard learning algorithm addresses (ii) but not (i).
We seek a balance of the two requirements. Note that (i) and (ii) are not binary properties; hence there can be a trade-off (e.g.,
the parameter that allows for better optimization on the current task may be less favourable as a parameter initialization for the next task).
It is worth noting that such an approach has been successfully applied in the context of online convex optimization in changing environments, where several algorithms can be recognized as running a standard learning algorithm (such as mirror descent) on a carefully selected subset of the parameter space (e.g., Zinkevich, , Herbster and Warmuth, , György and Szepesvári, ).

In this paper, to address problem (i), we first identify key properties that initialization algorithms (Hinton and Salakhutdinov, , He et al., ) impose on the starting parameters of a neural network. Then, we propose *spectral regularization* to sustain these properties while striking a good balance between (i) and (ii).

### 3.1 Spectral properties at initialization

Neural network initialization is key to trainability (Hinton and Salakhutdinov, , He et al., ).
One property of the initialization thought to be important is that the layerwise mapping, $h_{l+1}=\texttt{ReLU}(\theta_{l}h_{l})$, has a Jacobian with singular values that are close to or exactly one (Glorot and Bengio, , Saxe et al., , Pennington et al., , Xiao et al., ).
Writing this Jacobian explicitly, we have that $\mathbf{J}_{l}=\frac{\partial h_{l+1}}{\partial h_{l}}=\mathbf{D}_{l}\theta_{l}$ where $\mathbf{D}_{l}=\text{Diag}(\texttt{ReLU}^{\prime}([\theta_{l}h_{l}]_{1}),
\ldots,\texttt{ReLU}^{\prime}([\theta_{l}h_{l}]_{d}))$.
(^2^22$\texttt{ReLU}^{\prime}(x)$ denotes the derivative of the ReLU function, and it equals to 1 for $x>0$ and 0 for $x<0$ (we define it to be 1 for $x=0$).)
We can obtain upper and lower bounds on the singular values of the layerwise Jacobian in terms of the singular values of the weight matrix. Denoting the ordered singular values of $\theta_{l}$ and $\mathbf{D}_{l}$ by $\sigma_{d}(\theta_{l})\leq\cdots\leq\sigma_{1}(\theta_{l})$ and $\sigma_{d}(\mathbf{D}_{l})\leq\cdots\leq\sigma_{1}(\mathbf{D}_{l})$, respectively, we have $\sigma_{d}(\mathbf{D}_{l})\sigma_{i}(\theta_{l})<\sigma_{i}(\mathbf{J}_{l})<
\sigma_{1}(\mathbf{D}_{l})\sigma_{i}(\theta_{l})$ for all $i\in\{1,\dotso,d\}$ (Zhang, , Theorem 8.13).
In particular, if the spectral norm (largest singular value) of the weight matrix $\theta_{l}$ increases, then the spectral norm of the Jacobian $\mathbf{D}_{l}$ increases as well, potentially impacting trainability. Furthermore, the condition number $\kappa(\mathbf{J}_{l})=\nicefrac{{\sigma_{1}(\mathbf{J}_{l})}}{{\sigma_{d}(
\mathbf{J}_{l})}}$ can be bounded with the product of the condition numbers of $\theta_{l}$ and $\mathbf{D}_{l}$, $\kappa(\theta_{l})$ and $\kappa(\mathbf{D}_{l})$ as
$\kappa(\theta_{l})/\kappa(\mathbf{D}_{l})\leq\kappa(\mathbf{J}_{l})\leq\kappa(
\theta_{l})\kappa(\mathbf{D}_{l})$.
Thus, if our goal is to keep the singular values of the Jacobian close to one by controlling the singular values of the weight matrix, we should ensure that the condition number of the latter is not too large.

### 3.2 An illustrative example

To make these points more concrete,
consider a single-layer neural network
$f_{\theta}(x)=\theta_{2}\texttt{ReLU}(\theta_{1}x)$ mapping $x\in\mathbb{R}^{2}$ to $\mathbb{R}$.
Suppose that the first task is to fit $x=(1,0)^{\top}$ and $y=0$ in mean-squared error. An optimal solution with $f_{\theta}(x)=y$ is $\theta_{1}=\begin{bmatrix}1&0\\
0&a\end{bmatrix}$ and $\theta_{2}=(0,a)$ for an arbitrarily small value of $a\geq 0$.
Now consider that the next task is to fit $x=(0,1)^{\top}$ and $y=1$. The gradients of the loss $\ell(f_{\theta}(x),y)=\frac{1}{2}(y-\ell(f_{\theta}(x))^{2}$ are, for the given new $(x,y)$ pair,
$\nabla_{\theta_{2}}\ell(f_{\theta}(x),y)=(f_{\theta}(x)-y)\texttt{ReLU}(\theta
_{1}x)=(a^{2}-1)(0,a)^{\top}$ and
$\nabla_{\theta_{1}}\ell(f_{\theta}(x),y)=(f_{\theta}(x)-y)x\texttt{ReLU}^{
\prime}(\theta_{1}x)^{\top}=(a^{2}-1)\begin{bmatrix}0&0\\
0&a\end{bmatrix}$.
Performing updates with these gradients keeps the $\Theta(a)$ parameters at the same order while maintaining a loss of approximately 1. The condition number of the weight matrix $\theta_{1}$ is $\kappa=1/a$, which requires $\Theta(1/a)=\Theta(\kappa)$ update steps to make significant progress during learning. (Another example showing this empirically is given in Appendix A.1.)

### 3.3 Trainability and Effective Gradient Diversity

We can generalize the above observation to a problem of reduced *gradient diversity*.
By gradient
diversity, we mean the spread of singular vectors
in the matrix of per-example stochastic gradients, $\mathbf{G}=[\mathbf{g}_{1},\ldots,\mathbf{g}_{m}]$.
If this matrix contains a few large singular values and many small singular values, then the gradients will be largely in the span of the singular vectors corresponding to the large singular values.
For this analysis, we focus on the rank, which is one particular summary statistic for the set of singular values that counts the number of non-zero singular values, $\text{rank}(\mathbf{G})=|\{i:\sigma_{i}(\mathbf{G})>0\}|$.
However, for practical purposes, the rank is problematic because it is unstable to perturbations (Feng et al., , Theorem 1).
In our experiments below we will consider the condition number, $\nicefrac{{\sigma_{1}(\mathbf{G})}}{{\sigma_{m}(\mathbf{G})}}$ and effective rank, $\text{erank}(\mathbf{G})=\sum\bar{\sigma}_{i}(\mathbf{G})\log\bar{\sigma}_{i}(
\mathbf{G})$, where $\bar{\sigma}_{i}(\mathbf{G})=\nicefrac{{\sigma_{i}(\mathbf{G})}}{{\sum_{i}
\sigma_{i}(\mathbf{G})}}$ (Roy and Vetterli, ).
These measures make explicit the issues that arise if
the largest singular value grows faster than the smallest singular values (our experiments show this to be the case in Section 3).
In this case, the condition number increases and the effective rank decreases.
We refer to this as a reduction in the *effective gradient diversity*.

A reduction in the rank, or erank, of the gradient matrix results in collinear gradients on different datapoints, limiting the diversity of gradient directions used in the parameter update.
This can have an adverse effect on learning.
In the extreme case, where the gradient matrix is rank one, every datapoint provides a gradient in the same direction, even if the datapoints correspond to different classes.
Consider the gradient of the loss on a particular datapoint
$(x_{i},y_{i})$ with respect to the weight matrix of a hidden layer, $\theta_{l}\in\mathbb{R}^{d\times d}$, which can be written recursively for the parameters of layer $l$ as $\mathbf{G}_{l,i}=\nabla_{\theta_{l}}\ell(f_{\theta}(x_{i}),y_{i})=\delta_{l,i}
h_{l-1,i}^{\top}$, where
$\delta_{l,i}=\theta_{l+1}^{\top}\delta_{l+1,i}\mathbf{D}_{l,i}$ is the error gradient from the next layer
with $\delta_{L,i}=\nicefrac{{\partial\ell(f_{\theta}(x_{i}),y_{i})}}{{\partial f_{
\theta}}}$ and $\mathbf{D}_{l,i}=\text{Diag}(\phi^{\prime}([\theta_{l}h_{l,i}]_{1}),\dotso,
\phi^{\prime}([\theta_{l}h_{l,i}]_{d}))$. We can rewrite the gradient in terms of its vectorization $\mathbf{g}_{l,i}=\text{vec}(\mathbf{G}_{l,i})=(\mathbf{I}_{d}\otimes\theta_{l+
1}^{\top})\mathbf{v}_{l,i}$ where $\mathbf{I}_{d}$ is the $d\times d$ identity matrix and
${\mathbf{v}_{1,i}=\text{vec}(\delta_{l+1,i}\mathbf{D}_{l,i}h_{l-1,i}^{\top})
\in\mathbb{R}^{d^{2}}}$ is the vectorization of data-dependent terms.
The matrix of gradients for different datapoints is the concatenation of the per-example gradients,
$\mathbf{G}_{l}=[\mathbf{g}_{l,1},\mathbf{g}_{l,2},\dotso,\mathbf{g}_{l,m}]=(
\mathbf{I}_{d}\otimes\theta_{l+1}^{\top})\mathbf{V}_{l}$
where $\mathbf{V}_{l}=[\mathbf{v}_{l,1},\mathbf{v}_{l,2},\dotso,\mathbf{v}_{l,m}]$.
The rank of $\mathbf{G}_{l}$ is upper bounded as

$$ $\text{rank}(\mathbf{G}_{l})<\min\{\text{rank}(\mathbf{I}_{d}\otimes\theta_{l+1 }^{\top}),\text{rank}(\mathbf{V}_{l})\}=\min\{d\,\text{rank}(\theta_{l+1}^{ \top}),\text{rank}(\mathbf{V}_{l})\}.$ $$

Thus, if the (effective) rank of $\theta_{l+1}$ decreases, then the (effective) rank of the gradient matrix may decrease as well.
The rank of the gradient matrix can even decrease due to rank reduction in parameters at other layers, or through the rank of the representation, which others have noted to occasionally correlate with loss of trainability (Lyle et al., , Kumar et al., , Dohare et al., ).

#### Why Do Spectral Properties Deviate From Initialization?

In large-scale self-supervised learning, it has been observed empirically that the parameter norm grows at a rate of $\sqrt{t}$, where $t$ is the number of iterations (Merrill et al., ).
Similar observations have been made in continual learning, provided that the neural network does not stop learning due to loss of trainability
(Nikishin et al., , Lyle et al., , Dohare et al., ).
A growing parameter norm is problematic from an optimization perspective.
Specifically, the parameter norm that these works consider is the Frobenius norm, which is equal to the sum of squared singular values,
$\|\mathbf{\theta}\|_{F}^{2}=\sum_{i}\sum_{j}[\theta]_{ij}^{2}=\sum_{i}\sigma_{
i}(\theta)^{2}$.
Thus, a growing parameter norm is equivalent to an increasing sum of the squared singular values.
In particular, note that $\|\theta_{l}\|_{F}\leq\sqrt{\text{rank}(\theta_{l})}\sigma_{1}(\theta_{l})$ where
$\sigma_{1}(\theta_{l})$ denotes the largest singular value, or the spectral norm (Golub and Van Loan, ).
If the parameter norm of layer $l$ grows at a rate of $\sqrt{t}$, then the spectral norm of the
parameter matrix $\theta_{l}$ also increases at the same rate.
This leads to an increase in the spectral norm of the layerwise Jacobian,
$\sigma_{d}(\mathbf{D}_{l})\sigma_{1}(\theta_{l})\leq\sigma_{1}(\mathbf{J}_{l})$, which can reduce effective gradient diversity and may harm trainability.

## 4 Spectral Regularization for Continual Learning

If important properties of the initialization are lost during the course of learning, it is natural to regularize the neural network toward the initialization.
This is the motivation for
regularization
(Kumar et al., ) and weight reinitialization
(Sokar et al., , Dohare et al., ) as loss of plasticity mitigators.
However, our motivation is to more directly target key properties of initialization, using the insights from Section 3.

We denote a regularizer by $\mathcal{R}_{\tau(t)}(\theta,s)$, which is
a
function of (i) the parameters of the neural network, $\theta$, (ii) the
data, through the current task $\tau(t)$, and of (iii) auxiliary information, such as the
parameters at initialization, through the state variable $s$.
Naturally, not every regularizer takes all of these elements into account.
The regularizer is
optimized alongside the base objective, $J_{\tau(t)}(\theta)$. We write the
composite objective as
$J^{\lambda}_{\tau(t)}(\theta)=J_{\tau(t)}(\theta)+\lambda\mathcal{R}_{\tau(t)}
(\theta,s)$,
where $\lambda$ is a tunable hyperparameter governing the regularization
strength.

In Section 3, we argued that a growing spectral norm and condition number can harm trainability by reducing effective gradient diversity and that this growth occurs at a rate of $\sqrt{t}$.
Now we
investigate regularization as a means of controlling the spectral norm to
maintain the trainability of the neural network.

One commonly used regularizer in both continual and non-continual learning is L2 regularization, $\mathcal{R}_{\tau(t)}(\theta,\varnothing)=\|\theta\|^{2}$, which regularizes the parameters towards zero.
A recent alternative, L2 regularization towards the initialization,
$\mathcal{R}_{\tau(t)}(\theta,\theta^{(0)})=\|\theta-\theta^{(0)}\|^{2}$,
was proposed to deal with sensitivity to parameters near zero
(Kumar et al., ).
Regularizing towards the particular parameters present at initialization allows the neural network to regenerate
parameters, providing a soft reset to parameters if the gradient on the base objective is zero (see Appendix A.2 for an example and Appendix A.4 for more details).
One potential problem with L2 regularization towards the initialization is that it may prevent the parameters from deviating from the particular sampled value from the initialization distribution.

Our proposed spectral regularizer explicitly regularizes each layer’s spectral norm (the maximum singular value) and addresses the reduced effective gradient diversity described in Section 3.3.
We only minimize the maximum singular value because the smallest singular value remains relatively constant across all the architectures we consider (see Appendix C.6).
The parameter matrix $\theta_{l}$ in layer $l$ is a concatenation of the weight matrix $\mathbf{W}_{l}$ and the bias $\mathbf{b}_{l}$, giving the augmented parameter matrix $\theta_{l}=[\mathbf{W}_{l}|\mathbf{b}_{l}]$ and augmented input $\tilde{h}_{l}=[h_{l},\mathbf{1}]$.
With this notation, the equation defining the neural network $f_{\theta}$ can be rewritten as $h_{l+1}(x)=\phi(\mathbf{W}_{l}h_{l}(x)+\mathbf{b}_{l})=\phi(\theta_{l}\tilde{h
}_{l})$.
As discussed in Section 3, our goal is to control the largest singular value of $\theta_{l}$.
Using the fact that the concatenated parameters can be upper-bounded by the sum, $\sigma_{1}(\theta_{l})=\sigma_{1}([\mathbf{W}_{l}|\mathbf{b}_{l}])\leq\sigma_{
1}(\mathbf{W}_{l})+\sigma_{1}(\mathbf{b}_{l})$, we achieve this by regularizing the spectral norm of each parameter in the layer separately: the spectral norm of the multiplicative weight parameter $\mathbf{W}_{l}$ is regularized towards one and the spectral norm of the additive bias parameter $\mathbf{b}_{l}$ is regularized towards zero:

$$ $\mathcal{R}_{\tau(t)}(\theta_{l})=\sum_{l\in\text{layers}}\left((\sigma_{1}( \mathbf{W}_{l})^{k}-1)^{2}+\left(\sigma_{1}(\mathbf{b}_{l})^{k}\right)^{2} \right)=\sum_{l\in\text{layers}}\left((\sigma_{1}(\mathbf{W}_{l})^{k}-1)^{2}+ \|\mathbf{b}_{l}\|_{2}^{2k}\right).$ $$

We add the exponent $k$ to the spectral norm to penalize large spectral norms deviating from one. We set $k=2$ in our experiments and provide an ablation study in Appendix C.1.
For implementation details for other layers, such as normalization and convolutional layers, see Appendix A.7.
The largest singular value can be computed efficiently using power iteration
(Golub and Van der Vorst, , Householder, ).
Similar to previous work using spectral regularization
for generalization in supervised learning, we find that a single iteration is
sufficient for effective regularization
(Yoshida and
Miyato, ).

In addition to the exponent $k$, our approach to spectral regularization is different in two important ways compared to previous work, such as spectral-norm regularization (Yoshida and
Miyato, ). First, we regularize the spectral norm of every parameter, including bias terms and normalization parameters (see Appendix A.7).
This is required because every parameter experiences norm growth.
Second, we regularize the spectral norm of the multiplicative parameters to one rather than zero.
Aggressive regularization of the spectral norm towards zero can lead to collapse issues similar to L2 regularization towards zero.
These two differences are crucial to improving trainability in continual learning.
Lastly, spectral regularization is preferable over spectral normalization, which explicitly normalizes the weights in the forward pass to be exactly one, for two reasons:
(i) spectral normalization is data-dependent (see Section 2.1 and Equation 12 by Miyato et al. (), and Appendix A.6), which can be problematic in continual learning due to the changing data distribution, and,
(ii) other forms of normalization are already used to train deep neural networks, such as
LayerNorm (Ba et al., ), and it has been shown that spectral normalization does not improve trainability (Lyle et al., ).
See Appendix A.5 for more details.

## 5 Experiments

The goal of our experiments is to investigate the effect of spectral regularization on trainability in continual supervised learning, as well as reinforcement learning.
We cover several different datasets, types of nonstationarity, and architectures.
We compare our proposed regularizers against baselines that have been shown to improve trainability in previous work, which we detail below.
Overall, our experiments demonstrate that spectral regularization (i) consistently mitigates loss of trainability on a wide variety of continual supervised learning problems, including training large neural networks for thousands of epochs across a hundred tasks, (ii) is highly robust to the regularization strength, type of non-stationarity and the number of training epochs per task, (iii) achieves better generalization performance over the course of continual learning, and (iv) is generally applicable, which we demonstrate by applying spectral regularization to reinforcement learning with continuous actions.

#### Datasets, Nonstationarities, and Architectures

Our main results uses *all* commonly used image classification datasets for continual supervised learning: tiny-ImageNet (Le and Yang, ), CIFAR10, and CIFAR100 (Krizhevsky, ).
Experiments in the appendix also use smaller-scale datasets, like
MNIST (LeCun et al., ), Fashion MNIST (Xiao et al., ), EMNIST (Cohen et al., ), and SVHN2 (Netzer et al., ). In addition to the dataset, we consider different types of non-stationarity: (i) random label assignments, (ii) pixel permutation, (iii) label flipping, and (iv) class-incremental learning. Random label assignments are commonly used to evaluate trainability (Lyle et al., ) due to the large distribution shift between tasks in memorizing completely new and random labels. Pixel permutations, on the other hand, require only learning the permutation mask applied to the image; it induces loss of trainability more slowly but is useful for evaluating generalization (Kumar et al., ). Label flipping is a re-assignment of all the observations from one label to another label. Unlike the other two non-stationarities, a label flip distribution shift does not require learning a new representation. This is because only the output layer of a neural network needs to be permuted to learn the label re-assignment, but gradients can still unnecessarily change the representation leading to loss of trainability (Elsayed and
Mahmood, ).
We also consider the class-incremental setting in which the network is trained on a growing subset of the classes from a dataset, starting with only five classes on the first task and introducing five new classes on new tasks.
We use both a ResNet-18 (He et al., ) and Vision Transformer (Dosovitskiy et al., ).

#### Loss of Trainability Mitigators

In our main results, we compare spectral regularization against
L2 regularization towards zero,
shrink and perturb (Ash and Adams, ),
L2 regularization towards the initialization (Kumar et al., ),
recycling dormant neurons (ReDO, Sokar et al., ), concatenated ReLU (Abbas et al., , Shang et al., ), and Wasserstein regularization (Lewandowski et al., ).
Several regularizers in the continual learning without forgetting literature rely on privileged task information, which is not applicable to the task-agnostic setting that we consider.
We use the streaming conversion (Elsayed and
Mahmood, ) to transform elastic weight consolidation (Kirkpatrick et al., , Zenke et al., ), so that it no longer requires task boundary information, and include it as a baseline. Additional experiment details can be found in Appendix B.

### 5.1 Comparative Evaluation

Figure: Figure 1: Generalization across different types of non-stationarity on tiny-ImageNet using a ResNet (top) or a Vision Transformer (bottom). Compared to the baselines, spectral regularization is consistently among the best-performing methods across class incremental, label flip, and pixel permutation non-stationarities. Note that the Vision Transformer often achieves better generalization performance than the ResNet architecture.
Refer to caption: x1.png

In Figure 1, we plot the results of training a ResNet-18 and a Vision Transformer on tiny-ImageNet with different non-stationarities.
Across networks, non-stationarities, and methods considered, we see that spectral regularization
is among the methods best capable of sustaining plasticity.
The advantage of our approach, spectral regularization, is particularly high in class-incremental learning, but the performance of spectral regularization with a Vision Transformer was also the best on label flipping and pixel permutation.
In contrast, the performance of other baselines was highly variable with respect to the specific type of non-stationarity.
For example, shrink and perturb is not robust to the settings considered. Sometimes, it is among the best-performing or worst-performing methods.
Similar results on other datasets and the pixel permutation non-stationarity can be seen in Figure 2.

Figure: Figure 2: Continual learning with pixel permutation tasks on SVHN2, CIFAR10, CIFAR100 using a ResNet-18 (top) or a Vision Transformer (bottom). Across different datasets, spectral regularization is effective at maintaining test accuracy on new tasks. Without any mitigators, both ResNet-18 and Vision Transformer have diminishing test accuracy, suggesting loss of plasticity.
Refer to caption: x7.png

### 5.2 Looking Inside the Network

Figure: Figure 3: Trainability and neural network properties across ImageNet, CIFAR10, and CIFAR100. Baselines that suffer from a loss of trainability (*top*) also have an increasing average spectral norm (*middle-top*), and a decrease in their average representation change (*middle-bottom*).
Refer to caption: x13.png

We now explore how the structural properties of a neural network evolve over the course of continual learning, how these properties are affected by spectral regularization, and the different baselines considered.
For this, we consider the continual learning problem in which a ResNet-18 must memorize a set of random labels which changes from task to task using the tiny-ImageNet, CIFAR10, and CIFAR100 datasets.
We consider the average representation change to measure the distance between the neural network’s hidden activations from the beginning of one task, to the beginning of the next task.
The average representation change is a proxy for plasticity, allowing us to see how much the behavior of the neural network has changed.
In Figure 3, we see that the unregularized ReLU networks suffers from loss of trainability in all problems considered, and this coincides with an increasing spectral norm (middle-top) and a decrease in the average representation change (bottom).
Although only spectral regularization directly regularizes the spectral norm of the network, other regularizers do so indirectly by controlling other norms, like L2.
However, these other regularizers also regularize other parameters, preventing them from deviating from initialization and potentially leading to suboptimal use of capacity, which can be observed in the bottom row in Figure 3.
In Appendix C.3, we show that the Vision Transformer was not able to memorize random labels, suggesting that its capabilities for generalization are offset by its relatively lower trainabilty.

### 5.3 Sensitivity Analysis

Figure: Figure 4: Sensitivity analysis on regularization strength. Compared to other regularizers, spectral regularization is insensitive to regularization strength while sustaining higher trainability for any given regularization strength.
Refer to caption: x25.png

The effectiveness of a regularizer depends on the regularization strength.
Too much regularization can slow down training, leading to suboptimal performance on any given task. However, too little regularization can lead to loss of trainability and suboptimal performance on future tasks.
In a continual learning problem, hyperparameter tuning is particularly costly (or infeasible), especially if the distribution over tasks is not known in advance (Mesbahi et al., ).
Thus, we should favour regularizers that are less sensitive to hyperparameters.
Our results in Figure 10 show that the sensitivity of spectral regularization to its hyperparameter is much lower than other regularizers.
In Appendix C.4, we also present additional results showing the robustness of spectral regularization when varying (i) the regularization strength using other network architectures, (ii) the type of non-stationarity, and (iii) the number of training epochs per task.

Figure: Figure 5: Spectral regularization enhances plasticity in reinforcement learning in the DMC suite. Spectral regularization is competitive with the network reset + layernorm (Reset) even when the replay buffer is unbounded (*Top Left*). When the replay buffer size is bounded to 250k steps, spectral regularization improves over the Reset baseline (*Bottom Left*). In both cases, Spectral regularization significantly outperforms layernorm (Baseline), Compared to the hyperparameter governing the reset frequency, spectral regularization is less sensitive to its regularization strength. Spectral regularization also prevents both parameter and gradients from exploding, and reduces value overestimation (*Right*).
Refer to caption: extracted/5957847/figs/RL/aggregates/return_eval.png

### 5.4 From Supervised Learning to Reinforcement Learning

In addition to supervised learning, we evaluate spectral regularization in reinforcement learning.
Specifically, we investigate the control tasks from the DMC benchmark (Tassa et al., ), with soft actor-critic  (SAC, Haarnoja et al., ), in the high replay-ratio (RR) regime (D’Oro et al., ) with 16 gradient updates for every environment step.
The high replay-ratio regime leads to primacy bias (Nikishin et al., ), a phenomenon related to loss of plasticity.
Recent work has demonstrated that only full network resets with layer normalization (Ba et al., ) serve as an effective mitigation strategy in this setting (Ball et al., , Nauman et al., ).

As shown in Figure 5, spectral regularization yields substantially higher returns compared to the baseline that uses layer normalization with either an unbounded replay buffer size or a limited replay buffer size.
In aggregate, spectral regularization is competitive with the final performance of the strongest baseline, full network resets in combination with layer normalization.
However, in five out of seven environments, spectral regularization substantially improves over the reset baseline in terms of sample efficiency (see Appendix C.8).
Spectral regularization is also less sensitive to its regularization strength than resets are for their reset frequency (Figure 5, middle-top and middle-bottom). Moreover, we used a single regularization strength for every network. Better performance may be achieved by individually tuning each regularization strength for the value and policy networks.
In addition, a combination of spectral normalization and layer norm aggressively reduces Q-value overestimation
(Figure 5, top-left),
which is one of the well-established proxies for RL training destabilization (Hasselt, , Nauman et al., ).
Lastly, spectral normalization prevents exploding gradients and keeps weights’ norms small during training, which is a key component for learning continually and preserving the plasticity of neural networks (Lyle et al., ; ).

## 6 Conclusion

In this paper, we investigated the connection between initialization,
trainability, and regularization.
We identified that deviations of the maximum singular value of each layer can lead to low gradient diversity, preventing neural networks from training on new tasks.
To directly preserve trainability properties present at initialization,
we proposed spectral regularization as a way of controlling the maximum singular value of each layer so that it does not deviate significantly from $1$.
Our experiments show that spectral regularization is more performant and less sensitive to hyperparameters than other methods across datasets, nonstationarities, and architectures.
While several methods mitigate loss of trainability to a varying degree, learning continually with spectral regularization is robust, achieving high initial and sustained performance.
We also showed that spectral regularization is capable of improving generalization with both Vision Transformer
and ResNet-18 on continual versions of tiny-ImageNet, CIFAR10, CIFAR100, amongst others.
Lastly, we showed that spectral regularization learned a more effective policy in reinforcement learning by avoiding early loss of plasticity due to primacy bias.

## Appendix A Additional Details

### A.1 Illustrative Example: Large Spectral Norm Can Impede Trainability

We show that, given a family of solutions on the first task, preference should be given to solutions that have a spectral norm that is closer to one.
We consider 2 dimensional binary and
orthogonal inputs, $x_{1}=[0,1]^{\top}$ and $x_{2}=[1,0]^{\top}$,
with corresponding binary targets, $y_{1}=y_{2}=1$.
We consider the squared loss, and use a mutli-layer perceptron with one hidden layer and two units,
$f_{w_{2},w_{1}}(x)=w_{2}\texttt{ReLU}(w_{1}x)$.
A common observation regarding solutions found for deep neural networks is that they are low rank (Arora et al., , Jacot, , Timor et al., , Galanti et al., ). In addition, it has been observed that large outliers in the spectrum of a deep network emerge during training, meaning that the largest singular values of the weight matrices tend to be much larger than their smallest singular values (Pennington et al., , Martin and Mahoney, ).
Consider one such solution where
$w_{1}=\begin{bmatrix}-1&c\\
\nicefrac{{1}}{{c}}&-1\end{bmatrix}$,
and $w_{2}=[\nicefrac{{1}}{{c}},c]\in\mathbb{R}^{1\times 2}$.
The input-output function
is invariant under different values of $c$, achieving zero error for any particular choice.
However, the parameter matrix for the hidden activations, $w_{1}$, is low rank because it only has a single non-zero singular value that is not invariant. That is, the largest singular value of $w_{1}$ depends on the choice of $c$, $\|w_{1}\|_{2}:=\sigma_{max}(w_{1})=c+\nicefrac{{1}}{{c}}$. In addition, the gradients and parameter updates depend on $c$.
Thus, if the targets were to change, $y_{1}^{\prime}=0$, the imbalance of singular values due to very large or small values of $c$ can impede trainability:

$$ $\displaystyle w_{1}^{\prime}(x_{1})=\begin{bmatrix}-1&c\\ \nicefrac{{1}}{{c}}&-1\end{bmatrix}-\alpha\left(\underbrace{\begin{bmatrix}0& \nicefrac{{1}}{{c}}\\ 0&0\end{bmatrix}}_{\nabla_{w_{1}}\ell_{1}}\right),\hskip 28.45274ptw_{2}^{ \prime}(x_{1})=[\nicefrac{{1}}{{c}},c]-\alpha\left(\underbrace{[c,0]}_{\nabla_ {w_{2}}\ell_{1}}\right),$ (1) $$

where $\ell_{1}=\ell(f_{w_{2},w_{1}}(x_{1}),y^{\prime}_{1})$,
and $\alpha$ is a step-size.
One of the consequences of the imbalanced singular values is that the
per-example gradients are poorly conditioned (Wu et al., ).
That is, when we sample $x_{1}$, there will be a large gradient for $w_{2}$,
$\|\nabla_{w_{2}}\ell(f_{w_{2},w_{1}}(x_{1}),y_{1}^{\prime})\|^{2}=c$ but a small gradient for $w_{1}$,
$\|\nabla_{w_{1}}\ell(f_{w_{2},w_{1}}(x_{1}),y_{1}^{\prime})\|^{2}=\nicefrac{{1
}}{{c}}$.
Thus, a sufficiently small step-size that stabilizes the update to $w_{2}$ leads to slow learning on $w_{1}$.
A similar result holds if the target $y_{2}$ were to change
In Figure 6, we demonstrate that learning is more stable with a smaller spectral norm in this example.
For higher dimensional weight matrices, we may expect that the imbalance of the singular values leads to low gradient diversity where particular per-example gradients give rise to outliers with a large gradient magnitudes.
Thus, all else being equal, a solution with a
smaller spectral norm ($c\approx 1$) is preferable for the purposes of
continual learning.

Figure: Figure 6: Illustrative Example. A lower spectral norm is more trainable across different step sizes in the simple illustrative example.
Refer to caption: x28.png

### A.2 Differences Between Continual and Non-continual Learning

One critical difference between continual and non-continual learning is that, in
continual learning, convergence towards a fixed point is not the objective. Due
to continual changes in the data distribution, there is no fixed point that is
optimal for every distribution in general. Thus, convergence to a fixed point is
necessarily suboptimal.
If convergence to a fixed point does occur, then the norm of the gradients will
be zero. The gradients converging to zero is a condition for loss of plasticity,
and can be satisfied on every distribution depending on the choice of activation
function. Focusing on the case when the activation function is $\texttt{ReLU}(x)=\max(x,0)$, the
gradients can become zero if 1) the weights converge to zero or, 2) the
activations converge to zero. As a running example, we will consider the
two-layer neural network without biases denoted by
$f_{\theta}(x)=\theta_{2}\phi(\theta_{1}x)$, where
$\theta_{1}\in\mathbb{R}^{d\times d_{in}}$ and
$\theta_{2}\in\mathbb{R}^{d_{out}\times d}$ are weight matrices, and $\phi$
is an elementwise activation function. We will consider the squared loss,
$J(\theta)=\frac{1}{2}\mathbb{E}_{(x,y)\sim p}\left[(y-f_{\theta}(x))^{2}\right]$,
but a similar result holds for classification losses, such as cross-entropy. The gradient for
each of the parameters is given by,
$\nabla_{\theta_{2}}J(\theta)=(y-f)\phi(\theta_{1}x)^{\intercal}$ and
$\nabla_{\theta_{1}}J(\theta)=\theta_{2}^{\intercal}(f-y)\phi^{\prime}(\theta_{
1}x)x^{\intercal}$.
The neural network will reach a fixed point in continual learning, meaning that the
gradients are zero for every datapoint, if either 1) both $\theta_{1}$ and
$\theta_{2}$ are zero, or 2) the activations are zero for every input $x$,
$\phi(\theta_{1}x)=0$,

### A.3 Spectral Norm and Lipschitz Constant

One other potential reason for why a growing spectral norm is problematic is
from the theory convex optimisation. For the ReLU activation function,
the Lipschitz constant of the layer map, $h_{l+1}=\phi(\theta_{l}h_{l})$, is
equal to the spectral norm of the weight matrix. We can thus bound the Lipschitz
constant of the entire neural network above by the product of the layer-wise
Lipschitz constants (Szegedy et al., ). Putting these results together, we
conclude that during continual learning, the Lipschitz constant of each layer is
increasing and thus the Lipschitz constant of the entire network is also
increasing. This is problematic from the standpoint of optimisation because
gradient descent only converges on convex optimisation problems when the
step-size is smaller than $\frac{2}{L}$, where $L$ is the Lipschitz constant.
Thus, if the Lipschitz constant grows then, eventually, the chosen step-size
will be too large and gradient descent will not converge locally on the task.

### A.4 More Details on Regularization and Trainability

One other important advantage of regularization is that it has well understood effects for ensuring trainability in approaches outside of deep learning, such as degenerate linear regression and inverse problems
(Benning and Burger, ).

Each regularizer biases the parameter dynamics in their own way, such as keeping
the parameters close to zero or close to initialization. But, the regularizer term is
independent of the base objective, and potentially the data and/or architecture.
Even if the base objective provides a zero gradient, explicit regularization can provide a gradient to all weights, and reset
weights if the hidden unit associated with the weight becomes saturated. For
example, if the nonlinearity is ReLU, then a hidden unit ($i$) is
inactive if for all inputs in the dataset ($k$),
$h^{l}_{i}=\phi\left(\sum_{j=1}^{d_{l-1}}\theta^{l}_{ij}h^{l-1}_{j,k}\right)=0$. Then
the hidden representation has collapsed for that unit, and none of the weights
contributing to that unit will be updated, keeping the unit inactive. But, with
regularization, the weights will be updated and the unit may become active again
for some inputs.

### A.5 Details Regarding Spectral Regularization

#### Spectral Regularization vs L2 Regularization

L2 regularization is not as effective as spectral regularization because it constrains the magnitude of the parameters, and can even cause rank collapse (Kumar et al., ). Spectral
regularization constrains only the spectral norm of the weight matrix close to 1,
$\sigma^{(1)}(\theta_{l})\approx 1$. This has the effect of controlling the
magnitude of the maximal column of the weight matrix. That is, if
$\theta\in\mathbb{R}^{d_{l}\times d_{l-1}}$, then
$\nicefrac{{1}}{{\sqrt{d_{l}}}}\|\theta_{l}\|_{1}<\|\theta_{l}\|_{2}$ where
$\|\theta_{l}\|_{1}=\max_{1\leq j\leq d_{l}}\sum_{i=1}^{d_{l}}|[\theta_{l}]_{ij}|$.
This implies that $\sum_{i=1}^{d_{l}}|[\theta_{l}]_{ij}|<\sqrt{d_{l}}$ for
every column $j$. This differs in two ways from L2 regularization: (i) the
regularizer does not regularize all the columns of the weight matrix, only the
parameters in the column with a maximal sum, and (ii) the regularizer does not
regularize the individual weights of the column, but their sum. This means that
the parameters can potentially be larger, and move further from the
initialization, potentially enabling more effective use of the neural network’s
capacity. Lastly, we note that L2 regularization can also be viewed in terms of a matrix norm, specifically the Frobenius norm.

#### Spectral Regularization vs Spectral Normalization:

The spectral norm can also be controlled via spectral normalization
(Miyato et al., ).
For continual learning, spectral regularization is preferable over spectral normalization for two reasons: (i) spectral normalization is data-dependent (see Section 2.1 and Equation 12 in Miyato et al. (), and Appendix A.6 for more details), which can be problematic in continual learning due to the changing data distribution, and, (ii) other forms of normalization are often already used to train deep neural networks, such as
LayerNorm (Ba et al., ). LayerNorm, in particular, regularizes the magnitude of the
layerwise map by dividing by the norm of the features in the layer. However, because the spectral norm of the underlying parameters still grows at a rate of $\sqrt{t}$, the normalization layer itself will suffer from loss of
gradient diversity. For the purposes of ensuring continual
trainability, regularization explicitly controls the spectral norm of all parameters and is thus preferable over normalization in isolation. That
being said, normalization can still improve performance and optimal performance may be
achieved by a combination of regularization and normalization, which we show in
Section 5.3.

### A.6 Categorizing Regularizers for Continual Learning

We can categorize regularizers broadly into data-dependent and data-indepedent regularizers. Data-dependent regularizers use the data in some way, which can be probelmatic for continual learning when the data distribution changes. Regularizing on one distribution of data does not necessarily maintain useful properties for learning on the next distribution of data. Examples of data-dependent regularizers include feature rank regularization (Kumar et al., ), auxiliary tasks and other feature-space regularizers (Lyle et al., ). Other non-standard approaches that have a data-dependent regularization effect include gradient regularizers such as gradient-clipping and weight reinitialization based on dormant neurons (Sokar et al., ). These data-dependent regularizers regularizers control some property on data from the current task but may not control the property on data from a new task, which is needed to maintain plasticity.

Data-Independent Regularization, on the other hand, does not depend on any data.
This category regularizes the parameters directly, which is particularly useful
in continual learning when the data distribution is changing. Examples of
data-independent regularization include L2 regularization towards zero, weight
decay (for adaptive gradient methods), and regenerative regularization
(Kumar et al., ). Our proposed approach of spectral
regularization is data-independent and, moreover, explicitly targets a
trainability condition for continual learning. Thus, we expect that it is
particularly effective on maintaining trainability in continual learning
compared to other data-independent regularizers.

### A.7 Spectral Regularization of Other Layers

#### Normalization Layers

Other layers using per-unit scaling, such as normalization layers (Ioffe and Szegedy, , Ba et al., ), are also spectrally regularized. For example, denote $\gamma\in\mathbb{R}^{d}$ as the trainable scaling parameters for LayerNorm (Ba et al., ), then the element-wise product of the weights can be written as a diagonal weight matrix, $f(z)=\gamma\circ z=\text{Diag}(\gamma)z$. The maximum singular value of a diagonal matrix is the maximum entry, $\sigma_{max}(\text{Diag}(\gamma))=\max_{i}|\gamma_{i}|$. However, optimisation with a maximum is problematic because the max is not differentiable.
Furthermore, differentiable surrogates, such as log-sum-exp ($\left(\log\left(\sum_{i}\exp(|\gamma_{i}|)\right)-1\right)^{2}$), only give a loose upper bound on the maximum which is problematic because we want to regularize the maximum towards one. Thus, we regularize each weight towards 1.

#### Convolutional Layers

Similar to other work, we reshape the convolutional weight tensor (with kernel size ($k\times k$, $d_{in}$ filters and $d_{out}$ filters) into a matrix of size $d_{out}\times(k\cdot k\cdot d_{in})$ (Yoshida and
Miyato, ).
The spectral norm of this reshaped matrix provides an efficient upper bound on the spectral norm of the Toeplitz matrix defining the convolution (Tsuzuku et al., , Corollary 1).

## Appendix B Experiment Details

All of our experiments used Adam (Kingma and Ba, ) where the default step size of $0.001$ was selected after an initial sweep over $[0.005,0.001,0.0005]$.
For all of our results, we use 10 random seeds and provided a shaded region corresponding to the standard error of the mean.
For experiments on tiny-ImageNet SVHN2, CIFAR10 and CIFAR100, we used 4 seeds to sweep over the regularization strengths of $[0.01,0.001,0.0001]$, and found that $0.0001$ worked well on tiny-ImageNet, CIFAR10 and CIFAR100 for all regularizers, whereas $0.001$ worked best on SVHN2 for all regularizers.

Datasets and non-stationarities:

- •
MNIST: Only the first 12800 datapoints were used for training, with a batch size of 512 and [40, 80, 120] epochs, and a total of 50 tasks.
- •
Fashion MNIST: Only the first 12800 images, with a batch size of 512 and [40, 80, 120] epochs per task, and a total of 50 tasks.
- •
EMNIST: We use the balanced version of the dataset, using the first 100000 datapoints. For random label non-stationarity, we used a batch size of 500 and 100 epochs per task, with a total of 50 tasks. For both label flipping and pixel permutation non-stationarities, we used a batch size of 500 and 20 epochs per task, with a total of 200 tasks.
- •
SVHN2: The first 50000 images were used for training, 5000 images from the test set were used for validation and the rest were used for testing. The batch size used was 500, we found 250 to be unreliable for learning due to high variance. For random label non-stationarity, 20 epochs per task and 25 tasks was enough to lose trainability for an unregularized network. For pixel permutation non-stationarity, 10 epochs and 100 tasks was enough to lose trainability for an unregularized network.
- •
CIFAR10: All of the 50000 images were used for training, 1000 images from the test set were used for validation and the rest were used for testing. We used a batch size of 250 and found this to be effective. For random label non-stationarity, 20 epochs per task and 30 tasks was enough to lose trainability for an unregularized network. For pixel permutation non-stationarity, 10 epochs and 100 tasks was enough to lose trainability for an unregularized network.
- •
CIFAR100: All of the 50000 images were used for training, 1000 images from the test set were used for validation and the rest were used for testing. We used a batch size of 250 and found this to be effective. For random label non-stationarity, 20 epochs per task and 30 tasks was enough to lose trainability for an unregularized network. For pixel permutation non-stationarity, 10 epochs and 100 tasks was enough to lose trainability for an unregularized network.
- •
tiny-ImageNet: All of the 100000 images were used for training, 10000 images were used for validation, and 10000 images were used for testing according to the predetermined split. We used a batch size of 250 and found this to be effective. For random label non-stationarity, 20 epochs per task and 30 tasks was enough to lose trainability for an unregularized network. For pixel permutation non-stationarity, 20 epochs and 100 tasks was enough to lose trainability for an unregularized network.
- •
Reinforcement Learning:
We evaluate spectral regularization in RL control tasks from DMC benchmark (Tassa et al., ), with SAC method (Haarnoja et al., ) in demanding replay ratio (RR) regime (D’Oro et al., ) with 16 gradient updates per every new environments step. We choose this setup because a high RR regime leads to significant primacy bias (Nikishin et al., ) defined as a tendency to overfit initial experiences that damages the rest of the learning process.

Neural Network Architectures:

- •
MNIST, EMNIST, and Fashion MNIST: 4-layer MLP with 256 neurons per layer and relu activations. For experiments that use it, LayerNorm was applied after the linear weight matrix and before the non-linearity.
- •
tiny-ImageNet CIFAR10, CIFAR100, and SVHN2: An off-the-shelf ResNet-18 with batch norm, as well as an off-the-shelf Vision Transformer (tiny).
- •
Reinforcement Learning: Recent studies (Nauman et al., , Ball et al., ) have demonstrated that, in this setup, only resets with layer normalization (Ba et al., ) serve as an effective mitigation strategy.
We compare the performance of the SAC agent with both spectral regularization and layer normalization to two baseline agents: SAC with only layer normalization, and SAC with layer normalization plus resets. We use spectral regularization with a coefficient $1e-4$ for both the actor and critic. For every method, we use a single critic and architecture size of $2$ layers and $256$ neurons per layer for both actor and critic. Using a random policy, we prefill a replay buffer with $10,000$ transitions before starting the training. Replay buffer maximum size is $1$ million transitions.

## Appendix C Additional Experiments

### C.1 Ablating Hyperparameter k 𝑘 k italic_k for Spectral Regularization

Figure: Figure 7: Evaluating the choice of $k$ for spectral regularization for $k=1,2,4,8$ on MNIST (Right) and Fashion MNIST (left). We found that $k=2$ balance stability with effectiveness, and use this value throughout our experiments.
Refer to caption: x31.png

### C.2 Results on Fashion MNIST

Figure: Figure 8: Loss of Plasticity in Fashion MNIST. Although the all the newtorks in this experiment use LayerNorm, loss of plasticity occurs without regularization: the performance decreases as a function of tasks, even with an increasing number of iterations.
Refer to caption: x33.png

### C.3 Vision Transformer Cannot Memorize Random Labels

Figure: Figure 9: ResNet and Vision Transformer on the random label memorization task using tiny-ImageNet. The Vision Transformer architecture is particularly well-suited to tasks with structure from which generalization is possible. However, we found that its trainability on random labels is lacking. We were unable to get the Vision Transformer to memorize random labels even on a single task in ImageNet.
Refer to caption: x36.png

### C.4 Additional Sensitivity Results

Figure: Figure 10: Sensitivity analysis on regularization strength Compared to other regularizers, spectral regularization is insensitive to regularization strength while sustaining higher trainability for any given regularization strength.
Refer to caption: x37.png

#### Robustness to Non-stationarity in Fashion MNIST

Next, we explore whether our proposed regularizers are effective across
different types of non-stationarity. To this end, we use EMNIST because the
number of classes is large enough that label flipping induces loss of
trainability (Elsayed and
Mahmood, ). In
Figure 11, we found that spectral
regularization best maintained trainability across different non-stationarities.

Figure: Figure 11: Sensitivity to type of non-stationarity on EMNIST. Spectral regularization is able to consistently maintain high trainability across random label assignment, pixel permutations, and label flipping. When applying random label assignment, L2 (init) and L2 (zero) are unable to attain high trainability as compared to spectral regularization.
Refer to caption: x41.png

#### Varying the Number of Epochs Per Task

Given that the continual learning problem outlined in Section 2
depends on the number of iterations, it may be the case that a higher number of
epochs per task can mitigate loss of trainability. In
Figure 12, we found that the number of epochs only delays
loss of trainability (see Appendix C.2 for results on Fashion
MNIST). Even when the number of epochs per task is high enough to reach 100%
accuracy on the first task, loss of trainability eventually occurred without
regularization. In contrast, when using spectral regularization, loss of trainabililty was consistently mitigated. We additionally found that spectral regularization is particularly effective
at maintaining trainability when the number of epochs per tasks is low. The
evidence for this is most striking without Layer Norm, in the top row, where
spectral regularization was the only method capable of maintaining its
trainability.
Even though Layer Norm controls the spectral norm through the activations (Kim et al., ),
adding Layer Norm alone was not enough to mitigate loss of trainability.
However, Layer Norm is synergistic with various forms of regularization, with accuracy being improved regardless of the number of epochs per task.

Figure: Figure 12: Sensitivity to number of epochs per task on MNIST with random label assignment. Without Layer Norm, spectral regularization is able to maintain trainability over other regularizers even when the number of epochs is low. Spectral regularization also synergizes with Layer Norm, improving initial performance on the first task, and improving over tasks.
Refer to caption: x44.png

### C.5 Effect of Regularization on Capacity in a Single Task

The regularization strength for preventing loss of trainability must be
sufficiently high, and this regularization strength may limit the capacity of
the neural network. We now show the extended training of each regularizer using the same regularization strength used to prevent loss of trainability in Figure 13. Spectral regularization was not only best in preventing loss of trainability, it also achieved the highest accuracy when training to convergence on a single task. This means that spectral regularization constrains the capacity of the neural network the least, while still preventing loss of trainability.

Figure: Figure 13: Single task performance with ResNet-18. Spectral regularization is least restrictive of the neural network capacity, evidenced by its ability to better fit the randomly assigned labels compared to other regularizers. The unregularized baseline is able to use its capacity fully, but at the cost of reduced trainability in later tasks.
Refer to caption: x48.png

### C.6 Investigating Effects of Regularization on Neural Network Properties

Figure: Figure 14: Singular values, weight norms, stable ranks and effective gradient diversity: Left: SVHN2, Middle: CIFAR10, Right: CIFAR100.
Refer to caption: x51.png

### C.7 Investigating Generalization on Continual Imagenet

We investigate the generalization performance of spectral regularization on Continual ImageNet. In Continual ImageNet, each task is to distinguish between two ImageNet classes. We use the network architecture and training protocol used in Kumar et al. (). We find that all regularization approaches tested achieve high generalization performance across tasks. The methods we compare are spectral regularization (SpectralRegAgent), L2 towards zero (L2Agent), L2 towards initialization (L2InitAgent), recycling dormant neurons (ReDOAgent), and no regularization (BaseAgent).

Figure: Figure 15: Generalization performance on Continual ImageNet.
Refer to caption: x69.png

### C.8 Results on Individual DMC Environments

We report mean returns for DMC environments in Figure 16.

Figure: Figure 16: Mean and standard error of return for 7 DMC environments.
Refer to caption: extracted/5957847/figs/RL/env/dog-run_return_eval.png

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: How different the propose approach is from L2 regularization on the same set of parameters?
soundness: 3
strengths: - The continual learning topic is important area and loss of plasticity is fundamental challenge.
 - The approach is interesting and the idea to regularize the maximum singular value of each layer close to one seems novel.
 - The presentation of the work is nice, while the motivation is appropriate.
 - The authors present results for several experiments, evaluating different properties.
summary: The authors derive a new spectral regularizer for continual learning inspired by the observation that the singular values of the neural network parameters at initialization are an important factor for trainability during early phases of learning. Under such regularization they keep the maximum singular value of each layer close to one. 

Under such spectral regularization they claim that they can directly ensure gradient diversity throughout training, which promotes continual trainability, while minimally interfering with performance in a single task. 

To validate the utility of the proposed regularization and the claims they present empirical evaluation. The experimental results shows how the proposed spectral regularizer can sustain trainability and performance across a range of model architectures in continual supervised and reinforcement learning settings. They try to demonstrate better training in individual tasks, trainability as new tasks arrive, and better generalization performance.
weaknesses: - It appears like a marginal improvement and novelty with respect to L2 regularization.
- It seems that there is a connection to L2 regularization, or L2 regularization towards initialization of parameters which is a sort of spectral regularization.
- Deeper understanding/analysis of the proposed and the one above seems important and might be beneficial, but I was not able to find it in the paper L2 norm vs spectral norm in this context.  
- In the experimental section, looking at the graph and the results it seems that the improvements are marginal, or not highlighted significantly.
- In the same experimental section, I was able to see only graphs and plots, was not able to see actual table or values, to be able to apricate the achieved results more.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: 1 through the initialization is the key to the trainability, singular values of Jacobian and the condition numbers would induce the new selected parameters, e.g., rank
2 how to effectively deal with computation of the spectral norm, i.e. spectral regularization,
3 the performance of the spectral is not always better than that of vision transformer and resents
4 what’s more, the datasets are not enough, please refer to the latest approach,
5 for the figure 5, what’s the phenomenon of suddenly decrease for the y-axis.
soundness: 2
strengths: This paper provide the spectral regularize to the objective function for improving the stability of the problem.
summary: The paper considers the continual learning problem. In order to keep the stability of problem, the spectral regularizer is added to the objective function. Experimental results demonstrate the effective of the approach method.
weaknesses: However, the added spectral regularize would bring in the cost of computation for the continual learning if facing large model and large data.

---

confidence: 4
contribution: 3
initial_rating: 8
presentation: 3
questions: - Is there any particular reason why Continual Backprop was not evaluated in the experiments?
soundness: 3
strengths: - Section 1 Introduction and Section 2 Problem Setting are well written with clarity and detail, effectively introducing the problem, the spectral regularization algorithm, and some intuition behind its formulation.
- The spectral analysis of continual learning well motivates the algorithm. 
- The experiments consider a wide swathe of existing continual learning algorithms, both ResNet-18 and Vision Transformer architectures, and a variety of datasets and non-stationarities. Over this set of experiments, spectral regularization attains competitive performance and is robust to its choice of hyperparameter.
summary: The paper addresses plasticity loss in continual learning by proposing a spectral regularization technique. The proposed regularization technique regularizes the network’s weights at each layer towards a spectral norm of 1. This method is motivated by a spectral analysis of (continual) learning and the observation that standard neural network weight initializations exhibit good trainability and generalization. The paper’s proposed method is validated on a series of continual learning benchmark problems where it is shown to be performant and robust to the choice of regularization strength.
weaknesses: - Although spectral regularization is well motivated and the paper includes positive empirical results, one way to improve the paper would be to derive some theory illustrating the benefit of spectral regularization, and drawbacks of other regularization schemes, in continual learning.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: In addition to the points noted in weakness section, I wonder if the following statement is too strong
```
Note that these datasets and architectures encompass all continual supervised learning experimental settings considered in the loss of plasticity literature.
```
soundness: 2
strengths: - The paper solves the problem of loss of plasticity in continual learning by addressing trainability. 

- Section 3 and Section 4 in the paper are nicely written and is valuable to a general audience. Also, the paper provides at least two illustrative examples as well as some analysis to make the observation that the top singular value growth may cause training issues.

- The development of proposed solution via spectral regularization  is intuitive
summary: The paper introduces a new regularization to encourage neural networks to combat loss of plasticity phenomenon in a continual learning setting. The new approach is based on the observation that the maximum singular value of neural network layers grow over the course of training and avoiding this growth can help improve trainability of models in a continual learning setting. The proposed regularizer attempts to steer the maximum singular value of a layer to 1 (and 0 for the bias terms). The paper uses accepted datasets and tasks in continual learning literature to study the effectiveness of the proposed method over several baselines.
weaknesses: * The proposed method to keep top singular value small bears some similarities to the following paper:
  - https://arxiv.org/abs/2303.06296

* The experimental setup used in the paper is incomplete and not very convincing in order to judge the empirical results:
  - The models used are on the smaller side (ResNet-18 and ViT)
  - ViT model size is not specified in the paper 
  - The dataset used in Tiny-Imagenet which is not fully described. I believe the inputs are 64x64 based on my search but this detail is missing in the paper
While I am not an expert in continual learning area, there are recent papers that suggest that larger datasets (resolution and size) are available and used in continual learning studies

* The presentation of the experimental results and discussion section could be improved:
  - Figure 1 has legend only on the top left figure which makes it hard for the reader to follow how each method works across different continual learning scenarios
  - Figure 2 has a similar issue with legend
  - he paper does not define all the quantities plotted in Figure 3.
  - Since the paper focuses on trainability, additional graphs that show how trainability improves in CL setting might be useful in the presentation. Figure 3 provides a hint but in this case the shrink and perturb baseline shows better trainability as defined by singular value.

I'm unable to support acceptance at this point due questions on setup used in empirical analysis. The paper could benefit from an update that includes missing information that can give the reader an idea on exact metrics tracked, setup used, dataset details and other information.

Meta-review: The paper proposes spectral regularization scheme for continual learning tasks. Instead of simple L2 regularization, the proposed scheme aims to regularize the largest singular value of the weight matrices close to 1. While spectral regularization has been widely used for improving generalization capability of neural networks, directly applying it to continual learning seems to be new. A downside of it is its additional requirement of computation complexity to compute the regularization term. Empirical evaluation shows the proposed method is effective compared to other baselines for task-agnostic continual learning settings. Although the improvement is not a groundbreaking of a kind, the idea seems to be worth publishing in ICLR. So the decision is Accept. 

Additionally, https://www.sciencedirect.com/science/article/pii/S0167865524001909 seems to be a relevant work, so it would be good to include it in the final version and address the difference between their method.

Decision: Accept (Poster)