Title: Recurrent neural networks: vanishing and exploding gradients are not the end of the story
Venue: NeurIPS 2024
Accepted: yes
Keywords: RNN

optimization

long-range dependencies

SSM

LSTM
Abstract: Recurrent neural networks (RNNs) notoriously struggle to learn long-term memories, primarily due to vanishing and exploding gradients. The recent success of state-space models (SSMs), a subclass of RNNs, to overcome such difficulties challenges our theoretical understanding. In this paper, we delve into the optimization challenges of RNNs and discover that, as the memory of a network increases, changes in its parameters result in increasingly large output variations, making gradient-based learning highly sensitive, even without exploding gradients. Our analysis further reveals the importance of the element-wise recurrence design pattern combined with careful parametrizations in mitigating this effect. This feature is present in SSMs, as well as in other architectures, such as LSTMs. Overall, our insights provide a new explanation for some of the difficulties in gradient-based learning of RNNs and why some architectures perform better than others.

Recurrent neural networks: vanishing and exploding gradients are not the end of the story

Abstract

Recurrent neural networks (RNNs) notoriously struggle to learn long-term memories, primarily due to vanishing and exploding gradients. The recent success of deep state-space models (SSMs), a subclass of RNNs, to overcome such difficulties challenges our theoretical understanding. In this paper, we delve into the optimization challenges of RNNs and discover that, as the memory of a network increases, changes in its parameters result in increasingly large output variations, making gradient-based learning highly sensitive, even without exploding gradients. Our analysis further reveals the importance of the element-wise recurrence design pattern combined with careful parametrizations in mitigating this effect. This feature is present in deep SSMs, as well as in other architectures, such as LSTMs. Overall, our insights provide a new explanation for some of the difficulties in gradient-based learning of RNNs and why some architectures perform better than others.

Recurrent neural networks [RNNs; 1, 2] have long been the canonical architecture for modeling temporal data [3, 4]. However, they are notoriously difficult to train on long sequences, as error signals flowing backward in time tend to either vanish or explode [5-8]. Attention mechanisms [9], as featured in transformers [10], address these issues by enabling direct token-to-token communication, considerably simplifying signal propagation across long time intervals. Yet, their superior performance comes with increased computational and memory costs, due to their quadratic scaling in the sequence length. This limitation has motivated significant research aimed at making transformers more efficient [11-15].

A promising line of research in this direction involves a new type of linear recurrent networks known as deep state-space models [SSMs; 16-22]. These models trade expressivity for faster training speed, and they have been shown to be particularly effective at capturing long-range dependencies. In this paper, we wonder whether this effectiveness can be solely attributed to their ability to avoid vanishing and exploding gradients. The simplicity of such models presents an opportunity for in-depth theoretical analysis. We focus on signal propagation within these models.

After reviewing classical results on recurrent neural networks in Section 1, we demonstrate that they can suffer from an understudied problem: as the recurrent network encodes longer memories, the network's activity becomes increasingly sensitive to changes in its parameters, even when its dynamics remains stable. In Section 3, we then show that SSMs, as well as other architectures such as LSTMs, are well equipped to mitigate this issue. We then analyze a simple teacher-student task (Section 4). This task already reveals the remarkable complexity underlying the learning of linear recurrent networks and enables us to verify empirically our theory. Finally, we discuss how our findings extend to more realistic scenarios (Section 5), both in terms of architectures and data. Overall, our paper provides theoretical insights into the training of recurrent neural networks, an area where such analysis is rare. While vanishing and exploding gradients are well-known challenges, our results demonstrate that this is not the end of the story - there exists an additional layer of complexity beyond them.

Antonio Orvieto

1 Vanishing and exploding gradients

Let us first introduce the notations we will be using throughout the rest of the paper. We consider a recurrent neural network with hidden state h t , update function f θ parametrized by θ , and input sequence ( x t ) . The average performance of the network is measured by a loss L . We have

The gradient of the instantaneous loss L t with respect to the parameters θ is then equal to

In the equation above, we used ∂ to denote partial derivatives and d for total derivatives. Using this notation enables us to distinguish between ∂ h t L t , which corresponds to the error backpropagated from the current loss term to the hidden state through the readout function, and d h t L , which accumulates the errors that are backpropagated through the future hidden state values. In particular, ∂ h t L = ∂ h t L t and d h t L = ∂ h t L t ( h t ) + ∑ t ′ >t d h t L t ′ ( h t ′ ) . When stacking several recurrent layers on top of each other, ∂ h t L corresponds to the current error being backpropagated to the hidden state h t through the hierarchy of the network and d h t L to future error signals backpropagated through the recurrence.

Early work [5] highlighted the difficulty for gradient descent to make recurrent neural networks remember past inputs that will later be useful to produce a desired behavior. This is due to the fact that error signals flowing backward in time tend to either explode or vanish. The key quantity is

One can remark that this quantity exponentially converges to 0 when the spectral radius of the Jacobian ∂ h f θ is upper bounded by a constant strictly smaller than 1, and can exponentially explode if there exists some component bigger than 1. The error signal at time t backpropagated to time t ′ behaves similarly, as d h t ′ L t = ∂ h t L t d h ′ t h t . Gradient-based learning of long-term memories is thus difficult: the contribution of past hidden states to the current loss becomes either negligible or predominant as the time span considered increases.

Since then, the analysis has been refined [6-8] and the development of recurrent architectures has mostly been driven by the desire to solve this pathological issue. Most famously, the LSTM [3] unit, and later on the GRU [23], solve this problem by using memory neurons that facilitate direct information storage and retrieval, and thus facilitate error backpropagation. Other approaches to solving this problem, to name a few, involve gradient clipping [24, 8], activity normalization [2527], careful weight initialization [28, 29] or enforcing architectural constraints such as hierarchical processing [30, 31], orthogonal weight matrices [32-34] and oscillations [35-37].

2 The curse of memory

According to common deep learning wisdom, it is often believed that solving the vanishing and exploding gradients problem enables recurrent neural networks to learn long-term dependencies. We challenge this view and question: is solving those issues really enough to ensure well-behaved loss landscapes? We answer negatively by showing that gradients can explode as the memories of the network are kept for longer, even when the dynamics of the network remains stable.

2.1 Intuition

Recurrent neural networks have something special: the very same update function f θ is applied over and over. Therefore, modifying the parameters θ will not only influence one update, as changing the weights of a given layer in a feedforward neural network would, but all of them. As the memory of the network gets longer, the hidden states keep a trace of the effects of more updates. Hidden states thus become increasingly sensitive to parameter changes. This is the curse of memory . We borrow

A

B

C

0

0.99

0.9999

10 3

10 7

10 11

10 15

2nd moment

variance

0.0

0.9

0.99

0.999

1.0

0.0

0.5

1.0

10  6

10  4

10  2

10 0

10 2

Loss

0

10  5

10  3

10  1

10 1

*

0.99

0.98

0.96

0.92

0.84

0.68

0.36

*

the term from [38, 39], although we use it in a different context, and note that Martens and Sutskever [40] hypothesized that such a phenomenon could arise in RNNs and hinder their optimization.

Let us formalize our intuition by considering the sensitivity of the hidden state h t on the parameters θ :

When information stays in the network's memory for longer, the number of non-negligible Jacobian d h t ′ h t terms increases. As a result, the magnitude of this sensitivity increases when the network encodes longer-term dependencies, and learning θ becomes trickier. It is crucial to observe that this phenomenon arises even when exploding gradients are removed from the picture by constraining the eigenvalues of the recurrent Jacobian to be smaller than one and ensuring that the network dynamics remains stable. The rest of this section will be dedicated to studying this behavior quantitatively.

2.2 Signal propagation in linear diagonal recurrent neural networks

We study how hidden state and gradient magnitudes evolve as the network encodes longer-term dependencies. Ideally, these quantities do not vanish or explode, as it improves the conditioning of the loss landscape [41] and eases optimization [42, 43]. We operate under the following assumptions:

Linear diagonal recurrent neural networks . We restrict ourselves to update functions of the form f θ ( h t , x t +1 ) = λ ⊙ h t + x t +1 with λ a vector of the size of h t and ⊙ the element-wise product. For ease of exposition, we present results for real-valued λ here; see Appendix B.2 for the complex-valued setting. While this assumption is strong, it allows us to identify some crucial mechanisms and models like S4 [17], S5 [19] and LRUs [20] satisfy it. We later show that our analysis can model some features of more sophisticated networks. Note that we do not consider the input and readout mappings usually featured in recurrent layers as they are feedforward layers and signal propagation within them is already well understood [e.g., 44, 45].

Infinite time horizon . We consider infinite sequences and initialize the network dynamics at t 0 = -∞ . It simplifies our calculations while being a reasonable assumption when the sequences considered are longer than the characteristic timescales of the dependencies we want to learn.

Wide-sense stationarity . We assume the different quantities that the network receives, which include the inputs x t , to be wide-sense stationary (WSS). A random process X t is said to be WSS if its auto-correlation function is independent of time, that is, for all t ∈ Z and ∆ ∈ Z , E X [ X t +∆ X t ] =: R X (∆) , where E X denotes the expectation over the data. It corresponds to assuming that the statistics of the data are invariant to time shifts. This is a standard assumption when analyzing stochastic processes [46]. It keeps our calculations concise and does not qualitatively affect our conclusions (cf. Section 5). We discuss how to relax it in Appendix B.2.4.

We are now equipped to analyze signal propagation in one recurrent layer, both in the forward and backward passes. We show that both hidden states and backpropagated errors explode as | λ |→ 1 .

Forward pass. Here, we are interested in understanding how the hidden state second moment E [ h 2 t ] evolves as a function of λ and of the input auto-correlation function R x . After a calculation that we defer to Appendix B.2, we obtain

Importantly, this quantity goes to infinity as longer-term dependencies are encoded within the network, that is | λ |→ 1 . Additionally, the divergence speed depends on the input data distribution: it increases as consecutive time steps in the input distribution become more correlated (i.e., less of the R x (∆) terms are negligible). This behavior already highlights potential difficulties of gradient-based learning of deep neural networks containing linear recurrent layers as the variance of neural activity can become arbitrarily large, hindering learning abilities of deeper layers.

Backward pass. Let us first derive the gradient of the loss with respect to λ . Using the chain rule we have d λ L = ∑ t ∂ h t L d λ h t . We thus seek to understand how d λ h t behaves. We remark that d λ h t +1 = λ d λ h t + h t so that d λ h t is a low pass filtered version of the hidden state, which is itself a low pass filter version of the inputs. It therefore comes as no surprise that the second moment of d λ h t diverges faster than the one of h t when | λ |→ 1 . More precisely, we get

We plot the exact behavior of this quantity when the auto-correlation of x satisfies R x (∆) = ρ | ∆ | on Figure 1 and refer the interested reader to Appendix B.2 for a derivation of Equation 6. More generally, the hidden state of the network, and thus its final output, becomes increasingly sensitive to changes in recurrent parameters as the network reaches the edge of dynamical stability ( | λ |→ 1 ).

The last quantity we need to consider is the error that is backpropagated to the inputs x of the recurrent layer. It can be observed that the backward pass is dual to the forward pass in the sense that it is a recurrent process that receives backpropagated errors ∂ h t L and it runs in reverse time:

in which we made use of ∂ x t h t = 1 . It follows that the analysis we did for the forward pass also holds here. Crucially, this implies that the explosion behavior will be most significant for the recurrent parameters rather than for potential input or readout weights.

2.3 Extending the analysis to the non diagonal case

We now generalize our results to fully connected linear recurrent neural networks of the form h t +1 = Ah t + x t . For the sake of the analysis, we assume that A is complex diagonalizable, that is there exists a complex-valued matrix P and a complex-valued vector λ such that A = P diag( λ ) P -1 . Note that this occurs with probability one under random initialization of A [20]. In this case,

and

From the analysis above, we know that the dominating term in the limit | λ |→ 1 among ∂ P h t , d λ h t and d -1 P h t is d λ h t , as P and P -1 act as readout and input weights. Given that all other terms do not directly depend on the magnitude of λ , we have that d A h t ≃ ∂ h diag t h t d λ h diag t ∂ A λ ; cf. Appendix B.2.3 for formal statements. This has two consequences: First, the sensitivity of h t on A will explode

as longer memories are encoded and this directly comes from the eigenvalues of A . Second, as each entry of A typically impacts all eigenvalues of the matrix, the explosion behavior will be distributed across all entries, whereas it was concentrated on the eigenvalues for the diagonal case. We will later observe that this has significant practical consequences and partly explains why fully connected linear RNNs are difficult to train. As a side note, we remark that enforcing the matrix A to be orthogonal solves vanishing and exploding gradient issues but these weights may remain sensitive to learn because of the curse of memory.

3 Mitigating the curse of memory

We have discussed the sensitivity of recurrent networks to parameter updates. Given this problem, how can it be mitigated? We show that recurrent networks with diagonal connectivity are particularly well suited for this purpose. Besides enabling control over the Jacobian and avoiding exploding gradients, they facilitate the mitigation of the curse of memory. We additionally highlight that deep state-space models and gated RNNs inherently incorporate such mechanisms.

3.1 A solution: normalization and reparametrization

Both forward and backward passes explode as the network encodes longer memories. When h t +1 = λh t + x t +1 , we argue that it is relatively straightforward to mitigate this effect. We aim to keep E [ h 2 t ] , E [(d λ h t ) 2 ] and E [(d x t h t ) 2 ] independent of λ , similar to initialization schemes that maintain the magnitude of neural activity constant in deep networks [44, 45], regardless of the layer width [42, 47, 43].

Input normalization. A simple way to enforce E [ h 2 t ] to stay constant is to introduce a scaling factor γ ( λ ) applied to the inputs a neuron receives, that satisfies γ ( λ ) 2 E [ h 2 t ] = Θ(1) . Given that the backward propagation of output errors to inputs is dual to the forward pass, the role of γ in the backward pass will be similar. The value γ needs to take therefore both depends on the input distribution to normalize the forward pass, as well as on the output error distribution to normalize the backward pass. Perfect normalization is likely unrealistic, but some normalization can help, as shown in Figure 2.A.

Eigenvalue reparametrization. We are now left with keeping the gradient of the loss with respect to λ under control. Input normalization partly reduces the memoryinduced exploding effect, but not entirely as the variance of d λ h t is much larger than the one of h t (cf. Fig.1.A). Reparametrization can close that gap. Indeed, if λ is parametrized by ω , we have that d ω h t = d λ h t d ω λ . Choosing a parameterization that is more and more granular as λ goes to 1 thus helps in keeping the magnitude of d ω h t constant. Assuming γ is independent of λ for simplicity, achieving E [(d ω h t ) 2 ] = Θ(1) requires solving the differential equation γ ( λ ) 2 λ ′ ( ω ) 2 E [(d λ h t ) 2 ] = 1 . While deriving a universal optimal parametrization is again unrealistic due to dependency on the input distribution, reparametrization definitely helps, as shown in Figure 2.B. Figure 6 illustrates how it affects the loss landscape.

0.0

0.9

0.99

0.999

1.0

A

B

0

0.99

0.9999

10 2

10 5

10 8

2nd moment

without

0

0.99

0.9999

10  1

10 2

10 5

2nd moment

without

and exp

̸

The case of complex numbers. We have not yet discussed the case λ ∈ C , relevant for SSMs such as S4 [17]. We extend our analysis to complex-valued λ in Appendix B.3.2. Briefly, it reveals that changes in the magnitude of λ have a similar impact as in the real case, but this similarity does not extend to the angle. To keep the sensitivity on the angle constant, its parametrization must depend on the magnitude of λ . However, doing so hurts learning, particularly far from optimality, as we exemplify in Appendix B.3.2. A key implication of this analysis is that the sensitivity of the hidden state on the angle of λ explodes as its magnitude approaches 1.

3.2 Several RNN architectures implicitly alleviate the curse of memory

Deep state-space models, as well as gated RNNs, feature some form of normalization and reparametrization which help keeping signal propagation under control. We discuss how below.

Deep state-space models. Deep SSMs were originally motivated as discretizations of the differential equation ˙ h = Ah + Bx [16]. Naïve discretization of the differential equation yields h t +1 = (Id + d tA ) h t +d tBx t +1 which already provides some input normalization. More elaborate discretization schemes, such as the zero-order hold, effectively reparametrize the A matrix, e.g. with exp(d tA ) . Here, diagonalization arises from computational efficiency and simplicity reasons [18]. While such models can approximate any smooth mappings [48, 49], their expressivity remains limited [50]. The next generation of these models, including Mamba [21], incorporates input-dependent gates which modulate d t depending on the input x t . The theory we developed above does not strictly apply to this setting as d t is no longer constant. However, since the recurrence Jacobian remains diagonal, we expect the qualitative behaviors we analyzed to remain.

Gated RNNs. While the original motivation behind gated RNNs such as LSTMs [3] or GRUs [23] largely differs from the one of SSMs, they share similar mechanisms. In these networks, the memories stored in hidden neurons can be erased through a forget gate, and incoming inputs can selectively be written in memory through an input gate. Mathematically, this corresponds to hidden state updates of the form h t +1 = f t +1 ⊙ h t + i t +1 ⊙ x t +1 , with the forget f t +1 and input i t +1 gates being independent non-linear functions of x t +1 and h t . The forget gate is akin to λ and usually involves a sigmoid non-linearity, which has a similar effect as reparametrizing λ in the backward pass. The input gate can act as an input normalization depending on the initialization of the network or if is coupled to the forget gate as in the GRU ( f t = 1 -i t ) [29]. Importantly, the gates here depend on the hidden states and thus make the Jacobian ∂ h t h t +1 non diagonal. Yet, we argue that these architectures still have a bias towards diagonality. Indeed, the contributions of the hidden state through the forget and input gates are indirect, and they can be ignored when the weights connecting the hidden states to the gates are small. Empirically, we find that GRUs lie in this regime at initialization, cf. Section D.2, so that our theory accurately captures signal propagation in GRUs. We additionally confirm that signal propagation is well behaved in gated RNNs in Section 5. In regimes in which this approximation does not hold, studying signal propagation requires a much more sophisticated analysis than the one we have done here [51].

4 A linear teacher-student analysis

We start our empirical analysis with a teacher-student task using linear recurrent networks [52]. This is arguably the simplest setting in which one can train recurrent networks. Yet, as we shall see, it is already remarkably complex and captures some of the differences between different architectures observed in more realistic settings [20]. It additionally makes it possible to control the characteristic time constants of the data, which is only possible with synthetic data.

Our investigation starts with the one-dimensional setting to provide an intuitive illustration of the consequences of the curse of memory on the loss landscape. We then address the general setting and observe that linear networks indeed suffer from the curse of memory, and that the remedies we studied in the last section are effective. We additionally find that diagonality greatly modifies the structure of the loss landscape and helps optimizers with adaptive learning rates to compensate for eventual increased sensitivities.

4.1 The one-dimensional case

We first consider a student and a teacher following the one-dimensional dynamics h t +1 = λh t + x t +1 , with complex-valued parameter λ for the student and λ ∗ for the teacher. For simplicity, we independently draw each x t +1 from a unit normal distribution (its autocorrelation function is R x (∆) = δ ∆=0 ) and note that other input distributions do not qualitatively change the results. The performance of the student is measured by a loss L that averages the per time-step losses L t := 1 2 | h t -h ∗ t | 2 over the entire sequence.

A

B

0.32

0.84

0.96

0.99

10  7

10  5

10  3

10  1

Loss

RNN

LRU

RNN

block

diagonal

more

neurons

complex

numbers

norm.

LRU

10  5

10  4

10  3

10  2

10  1

This simple model already captures two key difficulties of gradient-based learning of recurrent neural networks. In Figure 1, we plot the resulting loss landscape for different λ ∗ values, when λ evolves on the positive part of the real axis (Fig. 1.B) and when it evolves on the circle of radius | λ ∗ | in the complex plane (Fig. 1.C). We restrict λ s to have absolute values smaller than one: exploding gradients are out of the picture. Still, two difficulties for gradient-based learning appear here. On one side, vanishing gradients lead to flat loss regions that are hard to escape. On the other side, the loss sharpens as the student encodes longer memories because of the curse of memory. As a consequence, gradient-based optimization is extremely tedious, already in this simple example.

4.2 Diagonal connectivity simplifies optimization

We now move to the general case in which the teacher evolves according to

with h t ∈ R n , x t ∈ R drawn i.i.d. from N (0 , 1) , A ∈ R n × n , B ∈ R n × 1 , C ∈ R 1 × n and D ∈ R 1 × 1 . Here both inputs and outputs are scalars.

Given the intuition we have developed so far, we expect fully connected linear recurrent neural networks to struggle solving the task when the teacher encodes longer memories, not only because of exploding gradients but also due to the curse of memory. Conversely, diagonality facilitates the eigenvalue reparametrization needed to avoid exploding gradients and make them better behaved. We run the following experiment to verify this intuition. We draw random teachers with hidden dimension n = 10 and transform the complex eigenvalues of the recurrent matrix A to have magnitudes close to a value ν 0 that we control 1 . The larger ν 0 is, the longer the memories encoded by the teacher are. We train a linear RNN, as well as an LRU [20], with hidden dimension 64 on this task. The students are therefore largely overparametrized. We chose the LRU architecture to represent deep SSMs due to its simplicity. This architecture uses input normalization and an exponential reparametrization of the eigenvalues, similar to what we analyze in Section 3. Both networks are trained using the Adam optimizer [53] and cosine annealing schedule for 10 k steps, on batches of size 128 . To ensure that we are in the infinite sequence length regime, we take the sequences to be of length 300 , that is three times longer than the characteristic time scale of the teacher. Learning rates are tuned separately for each method and training distribution. The results, which we plot in Figure 3.A, confirm our intuition: LRUs significantly outperform linear RNNs when long memories have to be learned, despite having 10 times fewer parameters.

Next, we wonder which design choices behind the LRU architecture are crucial to this performance improvement. To this end, we interpolate between a linear RNN and an LRU in the following way: First, we restrict the weight matrix of the linear RNN to a block diagonal with blocks of size 2. Each block can represent a complex number, so the network can represent 32 complex numbers in total. We additionally double the number of hidden neurons. Second, we change those 2 × 2 blocks (and their input and output weights) to be complex numbers. Finally, we add the γ input normalization and the exponential parametrization to obtain the final LRU architecture. We report the results of this experiment in Figure 3.B. Surprisingly, we find the gap comes from making the weight matrix block diagonal ( 4 × 4 blocks are here enough, cf. Figure 11 in the Appendix). Interestingly, this change reduces the number of parameters the model has and slightly reduces the model expressivity. An explanation of this behavior is therefore likely to be related to the optimization properties of those models. We confirm this hypothesis in the next section.

A

B

C

D

A

D

B

C

D

Eigenvalue

Hessian

Top 10

eig. vect.

re

re

im

A

B

C

D

B re

Bⁱ m

C re

Cⁱ m

D

B re

Bⁱ m

C re

Cⁱ m

D

im

re

B re

Bⁱ m

C re

Cⁱ m

D

im

A

B

C

D

Effective LR

Effective LR

10  3

10  4

10  5

10  4

10  6

10  8

10  10

10  7

10 0

10 7

10 6

10 3

10 0

0

10 0

10 3

10 6

1

0

1

0

10

D

10  7

10 0

10 7

10 4

10 2

10 0

0

10 0

10 2

10 4

1

0

1

0

10

20

Index eigenvalue

Index eigenvalue

20

4.3 On the importance of adaptive learning rates

So far, our results highlight the importance of having a close to diagonal recurrent connectivity matrix. In this section, we show that this parametrization alone does not mitigate any exploding behavior but modifies the structure of the loss landscape, making it possible for optimizers with adaptive learning rates to compensate for these behaviors.

To demonstrate this, we consider the Hessian of the loss:

If the network can perfectly fit the target data, which is the case in the experiments above, the second term vanishes at optimality. We plot the Hessian at optimality in Figure 4.A and B for a standard linear recurrent network and one with complex diagonal parametrization, both with 4 hidden neurons ( ν 0 = 0 . 99 ). We observe that the eigenvalue spectra are similar for the two architectures, both exhibiting large terms that are characteristic of the curse of memory, which makes learning with stochastic gradient descent almost impossible 2 . However, their structures differ. For the fully connected linear RNN, the top eigenvectors are distributed over many coordinates, whereas they are concentrated on a few coordinates for the complex diagonal one. This feature aids adaptive optimization [e.g., 57]: adapting to large curvature is much easier for Adam when the pathological directions are aligned to the canonical basis. This is what we observe in practice.

In Figure 4.C and D, we compare the effective learning rate used by Adam, which we compute by providing a vector of ones to the optimizer. For the dense linear RNN, the adaptive learning rates cannot compensate for the intricate coupling between components, resulting in small learning rates overall. Conversely, the sensitive directions of complex diagonal RNNs are concentrated on few

lay. 1

lay. 4

cRNN

LRU

cRNN

GRU

lay. 1

lay. 4

lay. 1

lay. 4

rest

no norm

rest

layer

norm

rest

GRU

ff

GRU

A

B

C

0

0.9

0.99

10  5

10  1

10 3

10 7

2nd moment

LRU

rest

0

0.9

0.99

10 1

10 3

10 5

2nd moment

0

0.9

0.99

10  6

10  1

10 4

10 9

2nd moment

angle

magn.

parameters, which adaptive learning rates can compensate for. This leads to more targeted and overall larger learning rates, significantly speeding up learning. As a side note, the complex eigenvalues of the teacher come in conjugate pairs. However, during training, the complex values of the complex RNN are not conjugates of each other, thereby increasing Hessian diagonality. Finally, performing this analysis for the LRU, we find that the Hessian spectrum is similar to the diagonal setting and that the exploding dimensions of the Hessian are almost exclusively due to the angle parameter, consistently with our theoretical analysis; see Figure 9.A and C. The loss landscape for S4 model [17] can be qualitatively similar to the complex diagonal RNN or to the LRU, depending on which regime it is in; see Figure 9.B and D.

Before concluding this section, we investigate whether certain eigenvalue distributions can break the diagonal structure of the Hessian, thereby complicating optimization and increasing the need for eigenvalue reparametrization. In Appendix C.2, we provide a theoretical quantification of the intuitive result that more concentrated eigenvalues lead to less diagonal Hessian. Consequently, the performance gap between complex-valued diagonal networks and LRUs widens, although the former still greatly outperform their fully-connected counterpart (see Figure 10). An important corollary is that increasing the number of hidden neurons breaks the diagonal structure of the loss landscape, thus reducing the effectiveness of optimizers with adaptive learning rates in mitigating the curse of memory. This observation may explain why Orvieto et al. [20] reported a more substantial performance improvement from eigenvalue reparametrization than what we observe in our study (cf. block diagonal vs. LRU in Figure 3.B).

5 Signal propagation in deep recurrent networks at initialization

The ultimate goal of our theoretical quest is to gain insights into the training of practical recurrent network architectures. Specifically, we aim to verify whether the trends established theoretically and in controlled experiments hold in practice, by studying signal propagation at initialization on a realistic next-token prediction natural language processing task.

To that matter, we provide sentences as input to deep recurrent networks that contain four blocks and use a next-token prediction loss to measure their performance. Each block consists of a recurrent layer followed by a feedforward gated linear unit [58]. By default, there are no normalization layers in this architecture. More details can be found in Appendix D.1. We empirically study how E [ h 2 t ] and E [(d θ L ) 2 ] evolve when the characteristic time scale of the recurrent layers, controlled through ν 0 , increases. We compare three different recurrent layers: a complex-valued diagonal RNN (cRNN), a LRU and a GRU initialized with the Chrono initialization [29].

The results are consistent with our theory. Complex-valued RNNs suffer from the curse of memory and recurrent parameters grow faster to infinity than the rest as ν 0 goes to 1. Perhaps more surprisingly,

a finer grain analysis reveals that the gradient magnitude is independent of the layer; see Figure 13. LRUs almost perfectly mitigate exploding behaviors in the forward pass (Figure 5.A) as well as in the backward pass (Figure 5.B), except for the angle parameter, consistently with our previous analysis. We also wonder whether layer normalization can replace the input normalization and reparametrization of the LRU. We find that it mitigates the memory-induced gradient explosion at the macroscopic level (Figure 5.C), but it likely kills any learning signal for the smallest eigenvalues [20]. Finally, the GRU manages to keep the gradient magnitude constant over different characteristic time constants, consistently with the intuition we developed in Section 3.2. Preliminary experiments revealed that same trends also hold for LSTMs.

The results presented above for the GRU align qualitatively with the intuition developed throughout the paper. We now consider how well our theory can quantitatively explain this behavior. The primary difference between our simple model and GRUs is that the λ values, referred to as forget gates in the GRU terminology, depend on both inputs and hidden states, and are therefore not constant. Interestingly, we find that GRUs almost behave like the diagonal linear RNNs we have focused on in this paper, particularly for slowly decaying recurrent neurons with high ν 0 values (see Appendix D.2). Consequently, applying our theory as if this context-dependency does not exist only introduces minor approximation errors, which we confirm empirically in Appendix D.3. Given the similarity of the Chrono initialization to those used in modern architectures like Mamba [21] and Hawk [22], we expect our theory to also serve as a good proxy for studying signal propagation in these models at initialization.

6 Conclusion

Vanishing and exploding gradients complicate the learning of recurrent networks, but solving these problems is not enough. We uncovered yet another difficulty of training such networks, which is rooted in their iterative nature and arises at the edge of dynamical stability. Reparametrizations and adaptive learning rates can effectively mitigate this behavior in practice, and diagonalizing the recurrence simplifies both. Our analysis additionally reveals the complexity of learning the angle of complex eigenvalues, which may explain why complex numbers were not found to be useful in most recent state-space model architectures [21, 22].

A side finding of our study is the symbiosis between independent modules, which are here neurons and can be more generally small heads, with adaptive learning rate optimizers in linear recurrent networks. Such a design pattern has promising properties: it facilitates online learning [59] and compositional generalization [60], allows for high level of parallelization [22], and matches, at a high level, the modular organization of the cortex in cortical columns [61]. Understanding how to increase the expressivity of small linear modules while keeping their great optimization properties constitutes a promising avenue for future research.

Limitations

The theory we introduced, with its focus on signal propagation, only addresses the training dynamics of recurrent neural networks. Consequently, it does not provide insights into other important questions such as generalization abilities or memory capacities of these networks. The main assumption underlying this analysis is that the recurrence is both diagonal and linear. While this approach offers valuable insights, it can only approximate signal propagation in more sophisticated architectures. Given the simplicity of the analytical tools employed, there is little hope that this framework can be extended to more general settings without significant modifications.

Acknowledgments

The authors thank Robert Meier, João Sacramento, Guillaume Lajoie, Ezekiel Williams, Razvan Pascanu, Imanol Schlag and Bobby He for insightful discussions. Nicolas Zucchet was supported by an ETH Research Grant (ETH-23 21-1) and Antonio Orvieto acknowledges the financial support of the Hector Foundation.

References

David E Rumelhart, Paul Smolensky, James L McClelland, and G Hinton. Sequential thought processes in PDP models. Parallel distributed processing: explorations in the microstructures of cognition , 2, 1986.

Jeffrey L Elman. Finding structure in time. Cognitive science , 14(2), 1990.

Sepp Hochreiter and Jürgen Schmidhuber. Long Short-Term Memory. Neural Computation , 9(8), 1997.

Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems , 2014.

Sepp Hochreiter. Untersuchungen zu dynamischen neuronalen Netzen . Diploma thesis, Technische Universität München, 1991.

Yoshua Bengio, Patrice Simard, and Paolo Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE transactions on neural networks , 5(2), 1994.

Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, and Jurgen Schmidhuber. Gradient flow in recurrent nets: the difficulty of learning long-term dependencies. In A field guide to dynamical recurrent networks . IEEE, 2001.

Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In International Conference on Machine Learning , 2013.

Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations , 2015.

Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems , 2017.

Quentin Fournier, Gaétan Marceau Caron, and Daniel Aloise. A practical survey on faster and lighter transformers. ACM Computing Surveys , 55(14s), 2023.

Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are RNNs: fast autoregressive Transformers with linear attention. In International Conference on Machine Learning , 2020.

Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. FlashAttention: fast and memoryefficient exact attention with IO-awareness. arXiv preprint arXiv:2205.14135 , 2022.

William Fedus, Barret Zoph, and Noam Shazeer. Switch Transformers: scaling to trillion parameter models with simple and efficient sparsity. Journal of Machine Learning Research , 2022.

Shuming Ma, Hongyu Wang, Lingxiao Ma, Lei Wang, Wenhui Wang, Shaohan Huang, Li Dong, Ruiping Wang, Jilong Xue, and Furu Wei. The era of 1-bit LLMs: all Large Language Models are in 1.58 bits. arXiv preprint arXiv:2402.17764 , 2024.

Albert Gu, Isys Johnson, Karan Goel, Khaled Saab, Tri Dao, Atri Rudra, and Christopher Ré. Combining recurrent, convolutional, and continuous-time models with linear state-space layers. In Advances in Neural Information Processing Systems , 2021.

Albert Gu, Karan Goel, and Christopher Ré. Efficiently modeling long sequences with structured state spaces. In International Conference on Learning Representations , 2022.

Ankit Gupta, Albert Gu, and Jonathan Berant. Diagonal state spaces are as effective as structured states spaces. In Advances in Neural Information Processing Systems , volume 35, 2022.

Jimmy T.H. Smith, Andrew Warrington, and Scott W. Linderman. Simplified state space layers for sequence modeling. In International Conference on Learning Representations , 2023.

Antonio Orvieto, Samuel L Smith, Albert Gu, Anushan Fernando, Ça˘ glar Gülçehre, Razvan Pascanu, and Soham De. Resurrecting recurrent neural networks for long sequences. In International Conference on Machine Learning , 2023.

Albert Gu and Tri Dao. Mamba: linear-time sequence modeling with selective state spaces. arXiv preprint arXiv:2312.00752 , 2023.

Soham De, Samuel L. Smith, Anushan Fernando, Aleksandar Botev, George Cristian-Muraru, Albert Gu, Ruba Haroun, Leonard Berrada, Yutian Chen, Srivatsan Srinivasan, Guillaume Desjardins, Arnaud Doucet, David Budden, Yee Whye Teh, Razvan Pascanu, Nando De Freitas, and Caglar Gulcehre. Griffin: mixing gated linear recurrences with local attention for efficient language models. arXiv preprint arXiv:2402.19427 , 2024.

Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: encoder-decoder approaches. In Proceedings of SSST-8, Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation , 2014.

Tomas Mikolov. Statistical language models based on neural networks . PhD thesis, Brno University of Technology, 2012.

Sergey Ioffe and Christian Szegedy. Batch normalization: accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning , 2015.

Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. In Neural Information Processing Systems - Deep Learning Symposium , 2016.

Tim Cooijmans, Nicolas Ballas, César Laurent, Ça˘ glar Gülçehre, and Aaron Courville. Recurrent batch normalization. In International Conference on Learning Representations , 2017.

Quoc V. Le, Navdeep Jaitly, and Geoffrey E. Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941 , 2015.

Corentin Tallec and Yann Ollivier. Can recurrent neural networks warp time? In International Conference on Learning Representations , 2018.

Salah El Hihi and Yoshua Bengio. Hierarchical recurrent neural networks for long-term dependencies. In Neural Information Processing Systems , 1995.

Asier Mujika, Florian Meier, and Angelika Steger. Fast-slow recurrent neural networks. In Neural Information Processing Systems , 2017.

Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In International Conference on Machine Learning , 2016.

Eugene Vorontsov, Chiheb Trabelsi, Samuel Kadoury, and Chris Pal. On orthogonality and learning recurrent networks with long term dependencies. In International Conference on Machine Learning , 2017.

Kyle Helfrich, Devin Willmott, and Qiang Ye. Orthogonal recurrent neural networks with scaled Cayley transform. In International Conference on Machine Learning , 2018.

T. Konstantin Rusch and Siddhartha Mishra. Coupled oscillatory recurrent neural network (coRNN): an accurate and (gradient) stable architecture for learning long time dependencies. In International Conference on Learning Representations , 2021.

T Anderson Keller and Max Welling. Neural wave machines: learning spatiotemporally structured representations with locally coupled oscillatory recurrent neural networks. In International Conference on Machine Learning , 2023.

Il Memming Park, Ábel Ságodi, and Piotr Aleksander Sokół. Persistent learning signals and working memory without continuous attractors. arXiv preprint arXiv:2308.12585 , 2023.

Zhong Li, Jiequn Han, Weinan E, and Qianxiao Li. Approximation and optimization theory for linear continuous-time recurrent neural networks. Journal of Machine Learning Research , 23(42), 2022.

Shida Wang, Zhong Li, and Qianxiao Li. Inverse approximation theory for nonlinear recurrent neural networks. In International Conference on Learning Representations , 2024.

James Martens and Ilya Sutskever. Learning recurrent neural networks with hessian-free optimization. In International Conference on Machine Learning , 2011.

Lorenzo Noci, Alexandru Meterez, Thomas Hofmann, and Antonio Orvieto. Why do learning rates transfer? Reconciling optimization and scaling limits for deep learning. arXiv preprint arXiv:2402.17457 , 2024.

Greg Yang and Edward J Hu. Feature learning in infinite-width neural networks. arXiv preprint arXiv:2011.14522 , 2020.

Greg Yang, James B Simon, and Jeremy Bernstein. A spectral condition for feature learning. arXiv preprint arXiv:2310.17813 , 2023.

Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Artificial Intelligence and Statistics , 2010.

Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. In International Conference on Computer Vision , 2015.

Grigorios A. Pavliotis. Stochastic processes and applications , volume 60 of Texts in Applied Mathematics . 2014.

Greg Yang, Edward J. Hu, Igor Babuschkin, Szymon Sidor, Xiaodong Liu, David Farhi, Nick Ryder, Jakub Pachocki, Weizhu Chen, and Jianfeng Gao. Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer. arXiv preprint arXiv:2203.03466 , 2022.

S. Boyd and L. Chua. Fading memory and the problem of approximating nonlinear operators with Volterra series. IEEE Transactions on Circuits and Systems , 32(11), 1985.

Antonio Orvieto, Soham De, Ça˘ glar Gülçehre, Razvan Pascanu, and Samuel L. Smith. Universality of linear recurrences followed by non-linear projections: finite-width guarantees and benefits of complex eigenvalues. In International Conference on Machine Learning , 2024.

William Merrill, Jackson Petty, and Ashish Sabharwal. The illusion of state in state-space models. In International Conference on Machine Learning , 2024.

Minmin Chen, Jeffrey Pennington, and Samuel S. Schoenholz. Dynamical isometry and a mean field theory of RNNs: gating enables signal propagation in recurrent neural networks. 2018.

Moritz Hardt, Tengyu Ma, and Benjamin Recht. Gradient descent learns linear dynamical systems. Journal of Machine Learning Research , 19(29), 2018.

Diederik P. Kingma and Jimmy Ba. Adam: a method for stochastic optimization. In International Conference on Learning Representations , 2015.

Yurii Nesterov and others. Lectures on convex optimization , volume 137. Springer, 2018.

Jeremy Cohen, Simran Kaur, Yuanzhi Li, J Zico Kolter, and Ameet Talwalkar. Gradient descent on neural networks typically occurs at the edge of stability. In International Conference on Learning Representations , 2020.

Guy Gur-Ari, Daniel A Roberts, and Ethan Dyer. Gradient descent happens in a tiny subspace. arXiv preprint arXiv:1812.04754 , 2018.

Yan Pan and Yuanzhi Li. Toward understanding why Adam converges faster than SGD for transformers. arXiv preprint arXiv:2306.00204 , 2023.

Yann N. Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In International Conference on Machine Learning , 2017.

Nicolas Zucchet, Robert Meier, Simon Schug, Asier Mujika, and João Sacramento. Online learning of long-range dependencies. In Advances in Neural Information Processing Systems , 2023.

Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Schölkopf. Recurrent independent mechanisms. In International Conference on Learning Representations , 2021.

V B Mountcastle. The columnar organization of the neocortex. Brain , 120(4), 1997.

Christoph Boeddeker, Patrick Hanebrink, Lukas Drude, Jahn Heymann, and Reinhold Haeb-Umbach. On the computation of complex-valued gradients with application to statistically optimum beamforming. arXiv preprint arXiv:1701.00392 , 2017.

James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax .

Jonathan Heek, Anselm Levskaya, Avital Oliver, Marvin Ritter, Bertrand Rondepierre, Andreas Steiner, and Marc van Zee. Flax: A neural network library and ecosystem for JAX, 2023. URL http://github. com/google/flax .

Nicolas Zucchet, Robert Meier, and Simon Schug. Minimal LRU, 2023. URL https://github.com/ NicolasZucchet/minimal-LRU .

Wikimedia Foundation. Wikimedia Downloads. URL https://dumps.wikimedia.org .

Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) , 2019.

Appendix

Table of contents

A Definition of the recurrent networks we use

In this section, we rigorously define all the architectures we use in the main text and in the appendix, as well as precisely describe how we initialize them.

A.1 Linear recurrent neural network

Let us start by introducing the linear recurrent neural network we are using. It satisfies

with x t ∈ R d in , h t ∈ R n , y t ∈ R d out , A ∈ R n × n , B ∈ R n × d in , C ∈ R d out × n and D ∈ R d out × d in . We draw the entries of B , C and D from independent truncated normal distributions with fan_in scaling. We draw each entry of A from N (0 , 1 / √ n ) independently and then apply the following postprocessing to it: First we complex diagonalize A , which we can do almost surely. Note λ its eigenvalues. We then transform them according to

with ν 0 and θ 0 two scalars that we control. This transformation has several benefits: we are guaranteed that the magnitude of λ is within [ ν 0 , 1] (and in [ ν 0 , ν 0 +(1 -ν 0 ) tanh(1)] in the limit n →∞ as the eigenvalues of A stay within the unit circle in that limit), and conjugate pairs of eigenvalues remain conjugate. This last point ensures that the resulting matrix remains real without having to change the eigenvectors. When we split the connectivity matrix A into several independent blocks, we initialize each block separately with the scheme described above.

A.2 Complex-valued RNN and linear recurrent unit (LRU)

Both architectures have recurrence of the form

with ⊙ the element-wise product, x t ∈ R d in , h t ∈ C n , y t ∈ R d out , λ ∈ C n , B ∈ C n × d in , γ ∈ R n , C ∈ C d out × n and D ∈ R d out × d in .

For the complex-valued linear RNN, we take

so that it can be considered as parametrizing the diagonalized version of the linear RNN.

For the LRU [20], we take

For both architectures, we use the LRU initialization so that λ is uniformly distributed on the ring between the circles of radii ν 0 and 1 , with absolute angle restricted to be below θ 0 . For the LRU, we initialize γ to √ 1 -| λ | 2 .

A.3 S4

We consider a slightly modified version of S4 here:

with x t ∈ R d in , h t ∈ C n , y t ∈ R d out , ω re A + iω im A ∈ C n , B ∈ C n × d in , ω ∆ ∈ R n , C ∈ C d out × n and D ∈ R d out × d in . The main difference with the standard architecture is that we do not consider any state expansion so that there is no parameter sharing. The makes this architecture closer to the linear RNN architecture we mostly focus on in this paper, while keeping the kind of parametrization it uses. In the same spirit, we do not couple the input and the readout matrices in any way.

The initialization we use also differs from existing ones as we initialize ∆ to 1 and exp ( ∆( ω re A + iω im A ) ) in the same way as λ in the LRU.

A.4 GRU

The GRU version we use is the following:

(30)

with σ the sigmoid function, h t ∈ R n , x t ∈ R d in and all the other matrices appropriately sized. We initialize the parameters with the Chrono initialization [29]: all parameters are initialized using standard practice (orthogonal initialization for the weights taking h as input, Lecun initialization for the rest, biases initialized at 0) except for b f , which is initialized as

Here, T min and T max denote the minimum and maximal characteristic time scale. In the experiments of Section 5 we take

to enable the comparison with other architectures. Indeed, when ignoring the dependence of the forget gate f on the input x and on the hidden state h , this corresponds to having f ∈ [ ν 0 , 1+ ν 0 2 ] .

B Theory

This section introduces all the theoretical results we directly or indirectly mention in the main text, as well as provides a proof for them.

B.1 Useful lemmas

Most, if not all the calculations, that we will be doing in this section involves infinite sums. We state and prove two useful lemmas to simplify later calculations.

Lemma 1. For α, β ∈ C satisfying | α | < 1 and | β | < 1 , and ( u n ) n ∈ Z a bounded sequence satisfying u -n = u n , we have

Proof. The proof naturally comes from separating the indices n and m in three sets: one in which the two are equals, one in which n is larger and one in which m is larger. This gives

Lemma 2. In the same conditions as Lemma 1, we have

Proof. This follows from remarking that

and using Lemma 1 to get the final result.

B.2 The curse of memory: signal propagation analysis

We recall the assumptions that we stated in Section 2.2:

Linear diagonal recurrent neural networks . We restrict ourselves to networks satisfying h t +1 = λ ⊙ h t + x t +1 with λ , h t and x t complex numbers. Without loss of generality, we focus on the one dimensional setting. We additionally consider λ s with absolute values smaller than 1.

Infinite time horizon . We consider infinite sequences and initialize the network dynamics at t 0 = -∞ .

Wide-sense stationarity . We assume the different quantities that the network receives, which includes the inputs x t , to be wise-sense stationary (WSS). A random process X t is said to be WSS if its auto-correlation function is independent of time, that is, for all t ∈ R and ∆ ∈ R , E [ X t +∆ ¯ X t ] := R X (∆) .

B.2.1 Forward pass

Without loss of generality, we can take t = 0 given the wide-sense stationarity and infinite time horizon assumptions. Let us first remark that we have

We used Lemma 1 to obtain the last equality. In Section 2.2, we focused on the real case ¯ λ = λ , so this formula becomes Equation 5. If we further assume that the auto-correlation of x decreases exponentially with decay rate ρ , that is R x (∆) = ρ | ∆ | , we can further simplify the last expression:

It follows that if the inputs are i.i.d. ( ρ = 0 ), we have E [ | h 0 | 2 ] = (1 -| λ | 2 ) -1 , and if the inputs are constant equal to 1 ( ρ = 1 ), we have E [ | h 0 | 2 ] = | 1 -λ | -2 .

B.2.2 Backward pass

Differentiating the update h t +1 = λh t + x t +1 with respect to λ gives

Note that some extra technicalities are needed to justify these equations as λ and h t are complex valued: these formulas hold as they would in the real-valued case as h t is an holomorphic function of λ .

so that so that

We can now compute the variance of the sensitivity of the hidden state with respect to the parameters.

Using Lemma 2 gives

Differentiating this quantity as a product gives

which then simplifies as

Note that Equation 6 in the main text is the real-valued version of that formula.

Let us now further simplify this equation when R x (∆) = ρ | ∆ | . If we use this in the differentiated quantity before differentiating it, we get

Calculating this quantity manually is painful. Instead, we use the following trick. Its denominator is rather easy to compute, it is equal to (1 -αβ ) 3 (1 -ρα ) 2 (1 -ρβ ) 2 . We thus multiply it to the derivative of the function we want to compute in order to obtain a polynomial with unknown factors, and use polynomial regression tools to derive the resulting coefficients. Massaging the obtained expression to make it easier to compute the closed-form value of this quantity when ρ = 0 and ρ = 1 , we get

This is the quantity we plot on Figure 1.A, when λ is real-valued. When ρ = 0 , this quantity becomes

when ρ = 1 . Additionally, it will diverge whenever | λ |→ 1 when ρ < 1 , and when λ → 1 when ρ = 1 .

Regarding the backpropagation of errors to the inputs, the analysis we did in the main text also holds for complex number given that h t is an holomorphic function of x t and it thus behaves as the forward pass once replacing the input distribution with the one of output errors ∂ h t L t .

and it is equal to

B.2.3 Extension to fully-connected networks

We now turn to the non-diagonal case. For the sake of simplicity, we assume that recurrent matrix is complex diagonalizable and that its eigenvalues are all different. This will enable us to differentiate the eigenvalues and the eigenvectors. We consider dynamics of the form

As A is complex diagonalizable, there exists a complex-valued matrix P and a complex-valued vector λ such that

The linear recurrent neural network considered above is equivalent to its diagonal version

We now differentiate h t w.r.t. to A using the diagonal parametrization and obtain

d A P , d A P -1 and d A λ can be considered constant. Intuitively, the eigenvalues and eigenvectors move smoothly as we restricted ourselves to the case in which eigenvalues are singular. If this is not the case, math becomes trickier as the eigenvectors are not uniquely defined. We can study the behavior of those quantities in more detail, following Boeddeker et al. [62]:

The F introduced in the last equation is equal to

̸

Importantly, those two quantities do not grow to infinity as the absolute value of the eigenvalues goes to 1, which means that we can consider those derivatives to be independent of | λ | for the sake of our analysis. Note that the previous argument assumes that eigenvalues do not collapse.

d λ h diag t is the dominating term in d A h t . We wonder which of the three different terms that appear in d A h t (Equation 67) will be the dominating one as | λ | (or λ ) goes to 1. In the previous paragraph, we have shown that the derivative of P -1 , P and λ can be considered constant for the sake of our analysis. We thus focus on the other terms.

First, we have so the magnitude of this quantity is roughly the one of h diag t , which corresponds to the low pass filtering of the inputs with different λ values.

Second, we know that ∂ h diag t h t does not change in magnitude as λ changes, as P remains bounded. So, for the third term of the sum, we are left to study the behavior of d P -1 h diag t . We can show that it evolves according to

It follows that the third term in the sum also corresponds to a low pass filtering of the inputs.

Finally, we know that the second term, the one in d λ h diag t will grow faster to infinity as it corresponds to two consecutive low pass filters with the same λ values (c.f. calculation above). It will thus be the dominating term in the infinite memory limit.

B.2.4 On the wide-sense stationarity assumption

In our analysis, we make the assumption that the different quantities given to the network are widesense stationary, that is their statistics are invariant to a temporal shift. In practice, this assumption will likely never be satisfied, as sequences are finite and as parts of the sequence (e.g., the beginning of a text) can have different statistics than other parts (e.g., the end of a text).

It should be noted that the analysis we have done in the wide-sense stationary case can provide an upper bound on the different quantity we study. Indeed, if there exists a function U such that

minor modifications to our analysis enable to upper bound the different quantities we study, replacing R x by U .

In our experiments of Section 5, we plug the empirical covariance defined as

into our analytical expressions. It comes with an approximation as it averages the autocorrelation for all positions, which are not equal when wide-sense stationarity is not met.

B.3 Impact of input normalization and parametrization

In this section, we consider a diagonal linear recurrent neural network of the form

with γ ( λ ) the input normalization factor and λ parametrized by a vector ω . Next, we study the effect of input normalization and reparametrization, first in the real-valued setting and then in the complex-valued one.

B.3.1 Real case

Let us start with the forward pass: as

γ rescales the value the hidden state takes. To avoid any explosion behavior, we thus ideally want γ to be the inverse of value of E [( h t ) 2 ] without normalization, which we have computed in Equation 45. The same behavior holds for the backpropagation of errors to the inputs as

We now move to the impact of the parametrization. To simplify the calculation, we will ignore the dependency of γ on λ when differentiating it. This can easily be done in automatic differentiation software by removing this dependency from the computational graph with γ (stop _ gradient( λ )) . We then have

and d λ h t which is rescaled by γ compared to the calculation we did above. As a consequence, both the input normalization and the parametrization can help to mitigate the curse of memory.

B.3.2 On the difficulty of parametrizing complex numbers

We now extend the previous analysis to the complex case, and take a polar parametrization of λ : λ ( ω ) = ν ( ω ) exp( iθ ( ω )) . The effect of the input normalization does not change when moving to complex numbers. The role of the reparametrization is however a bit more subtle. As h t is an holomorphic function of λ , we have d ¯ λ h t = 0 and

It follows that

To simplify the analysis, we will further assume that E [ | d λ h t | 2 ] is only a function of ν . This asumption holds in the case of ρ = 0 and ρ = 1 , c.f. Section B.2.2, but not necessarily otherwise. To ensure that that this quantity does not depend on λ , we thus want d ω ν 2 E ( ν ) = Θ(1) and ν 2 d ω θ 2 E ( ν ) = Θ(1) . The second means that the angle parametrization must depend on the value ν takes. Let us take the ρ = 0 example to get an idea of what the ideal parametrization should be. First, we have γ ( λ ) = √ 1 -ν 2 so that

We are left with the differential equation ν ′ = Θ(1 -ν 2 ) , which is for example solved with ν = tanh( ω ν ) . Now let us look at the parametrization of θ . If we ignore the ν 2 term for simplicity, the approximate differential equation it needs to solve is d ω θ = Θ(1 -ν 2 ) , which can be solved by θ = stop _ gradient(1 -ν 2 ) ω θ . The exact detail of this calculation do not really matter as this is heavily input distribution dependent. However, the interesting part here is that the angle parameter must be rescaled by a function of ν . This makes intuitive sense when looking looking at the sharpness of the loss around optimality in Figure 1.C, but this also makes the loss even flatter further away from optimality. We will come back to this point in Section C.1.4, showing that in practice, such a parametrization complicates the learning of the θ . Learning complex numbers is thus difficulty, because of the angle.

C Linear teacher-student task

This section is dedicated to detail the theoretical results behind our analysis of the teacher-student task, present all the details necessary to reproduce our empirical experiments, and provide additional analysis.

C.1 1D setting

C.1.1 Calculation of the loss

In this toy example, we are interested in learning a simple 1-dimensional linear recurrent neural network which follows the dynamics

to reproduce the hidden state h ∗ t of a teacher with recurrent parameter λ ∗ . Note that we here allow all variables to be complex-valued. We take the loss to be

We assume x to be drawn from a wide-sense stationary distribution so that we can focus on studying the behavior of one L t ( λ, λ ∗ ) := 1 2 E x [ | h t -h ∗ t | 2 ] to understand the behavior of the full loss L , in the limit of infinitely long sequences ( T →∞ ). Moreover, to further simplify the calculations, we assume that x is real-valued and that R x (∆) = ρ | ∆ | .

Let us now proceed with the calculation:

We have shown in Section B.2 that in the limit of t →∞ ,

(89)

Similar derivations hold for the other three terms in the loss. Grouping them gives the exact value of the loss. We omit the formula as it is not particularly insightful. In the case of constant inputs ( ρ = 1 ), we have

In the case of i.i.d. inputs ( ρ = 0 ), we have

This is the loss we plot on Figure 1.B and C.

C.1.2 Optimal normalization and reparametrization with uncorrelated inputs

Having a simple closed-form solution for the value the loss takes gives us the possibility to investigate in more detail what an optimal normalization and parametrization should be. We focus on the case ρ = 0 .

For ρ = 0 , the optimal normalization is γ ( λ ) = √ 1 -| λ | 2 . Given that we now add an input normalization to the student, we must also add it to the teacher for the student to be able to fit it. The loss becomes

Next, we parametrize λ as λ = ν ( ω ν ) exp( iθ ( ω θ )) and seek to find a parametrization such that, at optimality, E [(d ω ν h t ) 2 ] = 1 and E [(d ω θ h t ) 2 ] = 1 . Given that the student perfectly fit the teachergenerated data at optimality and that the loss we use is the mean-squared error, this corresponds to having d 2 ω ν L t = 1 and d 2 ω θ L t = 1 .

Deriving the optimal ν parametrization. We now compute the Hessian of the loss w.r.t. ω ν . First, we can simplify our calculations by restricting ourselves to the case θ = θ ∗ . The loss becomes

Differentiating this function a first time, we obtain

Differentiating it a second time gives

Leveraging the fact that

we finally get, when ν = ν ∗ , which gives ν ( ω ν ) = tanh( ω ν ) .

Deriving the optimal θ parametrization. We now move to the parametrization of θ . We have

For notational convenience, we denote

We have and

At optimality ( θ = θ ∗ and ν = ν ∗ ), we have α (0) = (1 -ν 2 ) 2 , α ′ (0) = 0 and α ′′ (0) = 2 ν 2 , so that

Given that we are at optimality, we have

To keep that quantity constant, we thus have to solve the differential equation

The optimal parametrization thus has to satisfy

that is

There are two things we can remark:

-First, the parametrization that we derived for the general case in Section B.3.2, which additionally ignored the dependence of γ on λ , is relatively accurate. The only difference is the apparition of the extra ν term, which becomes insignificant in the long memory limit ν → 1 .

-Second, the optimal θ parametrization has to be a function of ν , and thus ω ν , so the differential equation ν needs to satisfy changes. Yet, this considerably simplifies the calculation and there is no simple solution to that problem. One could still argue that the initial choice we made, that is to use a polar parametrization, is the issue. It could be, but most practical models end up using that choice so highlighting the limitations of this choice has important practical consequences.

In the rest of this section, we ignore the dependency of θ on ν , and consider the optimal parametrization in this setting to be

C.1.3 Visualization of the effect of input normalization and reparametrization

We now visualize the effect of input normalization and reparametrization on the loss landscape. We focus on two such reparametrizations:

-the one used in the LRU [20, 22] with γ ( λ ) = √ 1 -λ 2 , ν = exp( -exp( ω exp ν )) and θ = exp( ω exp θ ) .

-the optimal one we derived in the previous Section (c.f. Equations 108 and 109), which is tailored to this specific setting.

C.1.4 Learning the angle is difficult in practice: an example

We use this one-dimensional teacher-student setting to test whether having a parametrization that avoids exploding behaviors at optimality, such as the one we derived in Section C.1.2, facilitates learning. Figure 6 already hints towards the fact the basin of attraction of the global minima is either extremely narrow or that their number decreases as longer memories are considered, making learning more tedious. Figure 7 confirms it. In this figure, we plot the learning dynamics obtained using the Adam optimizer with a learning rate of 10 -3 for 50 k steps, starting from λ 0 = 0 . 99 exp( iπ/ 4) . We consider three different parametrizations of the angle:

The first one does not reparametrize the angle, the second one is the one used in the LRU and the third one is the optimal one we derived above. We use ν = tanh( ω ν ) to parametrize the magnitude in the three cases. We set λ ∗ to λ ∗ = 0 . 99 exp( iπ/ 100) . The θ landscape when ν is correct therefore corresponds to the ones plotted in the last two columns of Figure 6. This example shows that efforts to reduce the sharpness of the loss at optimality, as done in the last parametrization, inevitably make the loss flatter elsewhere and optimization impossible.

0.99

0.98

0.96

0.92

0.84

0.68

0.36

0.0

0.5

1.0

10  7

10  4

10  1

Loss

0.0

0.5

1.0

10  2

10 1

10 4

10 7

Hessian

1

0

1

*

10  5

10  3

10  1

Loss

1

0

1

*

10  1

10 1

10 3

Hessian

5

0

10  7

10  4

10  1

Loss

5

0

10  3

10  2

10  1

10 0

Hessian

2

0

10  9

10  6

10  3

10 0

Loss

2

0

10  4

10  1

10 2

Hessian

0

5

10  6

10  3

10 0

Loss

0

5

10  3

10  2

10  1

10 0

Hessian

5

0

5

10  7

10  4

10  1

Loss

5

0

5

10  2

10 0

Hessian

*

|  |

C.2 Structure of the Hessian at optimality

In Section 4, we argue that the Hessian at optimality is an important object to understand the learning dynamics in the linear teacher-student task we consider. We here provide some theoretical analysis of its structure in the complex diagonal setting, that is we consider a recurrent network of the form

with λ , b and c complex vectors of size n , with n the number of hidden neurons, and d a scalar. We additionally take the loss to be the mean-square error, which is also the one we use in our numerical experiments. Note that, as in our theoretical analysis of Section 2, we consider infinitely long sequences and wide-sense stationary inputs.

Recall that the Hessian of the loss is equal to

At optimality, only the first term remains, as ∂ h t L t is 0 for all data points. Given that we have shown earlier, e.g. in Section B.2, that the most sensitive parameters to learn are the recurrent ones λ , we focus on the Hessian with respect to these parameters in the following.

1.5

2.0

2.5

3.0

0.00

0.25

0.50

0.75

1.00

1

2

3

5

4

3

2

1

0

1

1

20

0

20

40

60

80

0

20k

40k

Step

10  3

10  1

10 1

Loss

0

20k

40k

Step

10  3

10  1

10 1

0

20k

10  3

10  1

10 1

2

Step

3

40k

10  2

10  1

10 0

10 1

10 2

Loss

A

B

C

C.2.1 Hessian for complex-valued variables

Before delving into more specific calculations, we make a few remarks on how to deal the Hessian when having complex-valued parameters. We will mostly leverage the fact that the loss L is realvalued.

Before that, we recall a few facts about Wirtinger derivatives:

-For f ( z ) a complex-valued function of z , the Wirtinger derivatives are defined as:

-Leveraging the fact that L is real-valued so that ¯ L = L , we have

We have

and, similarly, d λ d ¯ λ L = d ¯ λ d λ L . Second derivatives are symmetric, so we additionally have d λ d ¯ λ L = d ¯ λ d λ L ⊤ , which means that the complex Hessian is a Hermitian matrix.

Taken all together, this shows that the full complex Hessian, which contains all cross derivatives, has a similar structure to the real case.

C.2.2 Hessian with respect to the recurrent eigenvalues

In this section, we compute the full complex Hessian with respect to the recurrent eigenvalue λ and defer the analysis of reparametrization to the next section.

First, let us remark that so that

̸

(123)

We assumed that we are at optimality so that the network perfectly fits the target trajectories and ∂ y t L t = 0 . Additionally, L t is the mean-squared error loss so that ∂ 2 y t L t = Id . It follows that

In the last equation, we made use of the fact that the parameter λ i only affects the hidden state h t,i and not the others, so d λ j h t,i = 0 if i = j .

The previous calculation applied to one sequence, we now take the expectation over the data:

Note that we introduced a slight abuse of notation in the previous equation as d λ h t is in general a matrix. However, given that the hidden neurons are independent here due to the diagonal connectivity, it is effectively a vector, and we treat it that way. Let us now compute the expectation, using similar calculation techniques to the one we used in Section B.2:

We can now remark that this quantity is very similar to the one we have encountered in Section B.2, up to the presence of b i b j , and can be simplified using Lemma 2. For conciseness, we note S ( λ i , λ j )

the right-hand side of the last equation without the b i b j factor. Putting this result back in the Hessian, we get

To gain further intuition of the behavior of this quantity, we take R x (∆) = ρ | ∆ | , ρ being a real number. A similar calculation to the one we did in Section B.2 gives

Given the complexity of this formula, we visualize the magnitude of S ( λ i , λ j ) on Figure 8. Interestingly, we observe this quantity is large when λ i and λ j are conjugate to each other and inputs are uncorrelated. However, as elements in the input sequence get more correlated ( ρ → 1 ), this effect disappears and | S | increases as one of the two eigenvalue gets closer to 1 in the complex plane. In both cases, the effect gets amplified as the magnitude of the eigenvalue increases.

)|

,

,

|  (

1

0

1

Re

1

0

1

Im

1

0

1

Re

1

0

1

1

0

1

Re

1

0

1

1

0

1

Re

1

0

1

1

0

1

Re

1

0

1

10  1

10 1

10 3

10 5

=  .

[  ]

=  .

[  ]

=  .

[  ]

=  .

[  ]

=  .

[  ]

We also need to compute d ¯ λ d λ L to get the full complex Hessian. Similarly to the previous calculation, we first have

Using the symmetry with the complex Hessian matrix, we now have all its components.

C.2.3 Hessian for different parametrizations

So far, we have computed the complex Hessian, which is not of direct use as we end up optimizing real numbers in practice. Here, we study the impact of different parametrizations of λ on the Hessian. Given that this parametrization only affects λ and not the other parameters in the network and that we only consider the Hessian at optimality here, computing the Hessian of those parameters reduces to left and right multiplying the Hessian by derivatives of λ and ¯ λ with respect to these parameters. For future reference, we introduce

with A ij := b i b j c i c j S ( λ i , λ j ) and B ij = b i ¯ b j c i ¯ c j S ( λ i , ¯ λ j ) .

[  ]

It follows that

Real-imaginary parametrization: λ = ω re + ω im . We aim at computing the matrix

which is the building block to compute the full Hessian. First, let us remark that d ω re ,i λ i = 1 / 2 , d ω re ,i ¯ λ i = 1 / 2 , d ω im ,i λ i = i/ 2 and d ω im ,i ¯ λ i = -i/ 2 . It follows that

Once again we emphasize that the first line only holds as we are at optimality. Similar calculations give the rest of the elements of H RI ij :

Given the intuition we gained on the structure of S previously, and the fact that A ij ∝ S ( λ i , λ j ) and B ij ∝ S ( λ i , ¯ λ j ) , we know that this block will have large components if the two corresponding eigenvalues are conjugate of each other or aligned to each other, or if one of them is close to 1.

One other quantity that we can calculate is the trace of the Hessian H RI , which is equal to the sum of its eigenvalues. Note that this does not correspond to the eigenvalues of the full Hessian matrix, as it additionally contains entries for other parameters. Yet it already provides some idea of how large the Hessian will be, as the value of this trace appears in the value of the full trace. We have

where we used that S ( λ i , ¯ λ i ) is real-valued in the last line. As a side note, this formula partly justifies why studying the expected squared magnitude of d λ h t in Section 2 makes general sense, as

Magnitude-angle parametrization: λ = ν ( ω ν ) exp( iθ ( ω θ )) . The calculations for this parametrization are similar to the previous one, with the following differences:

After some calculations we obtain

(155)

C.3 Experimental details

We use the linear RNN architecture defined in Appendix A.1 as teacher and implement our experiments in JAX [63], using the default Flax [64] implementation of RNNs and the LRU implementation of Zucchet et al. [65]. Code is available here.

We initialize RNNs in the same way we initialized the teacher, and initialize the eigenvalues of the LRU and other complex-valued networks with magnitude in [ ν 0 , 1] and angle within [ -θ 0 , θ 0 ] .

Given that we are interested in the optimization properties of the different architectures, we only report training losses and do not perform any cross validation.

Here are additional details related to the different figures:

-Figure 3 : see Tables 1 and 2.

-Figure 4 and 9 : for panels A and B, we use ν 0 = 0 . 99 and draw A in a slightly different manner to the one described above (we directly draw the eigenvalues and eigenvectors so that we have two pairs of complex eigenvalues). We use automatic differentiation to compute the Hessian. For panels C and D, we use the same setup as described in Table 2, but keep the learning rate constant over the course of learning. We report the effective learning rate at the end of learning.

-Figure 10 : for panels A, B and C, we draw the magnitude and angle of 10 λ values independently, uniformly in [ ν 0 , 1+ ν 0 2 ] and [ -θ 0 , θ 0 ] . Importantly, this means that there are no conjugate pairs, which leads to more diagonal Hessian matrices at optimality than in Figure 4. For panel D, see Table 3.

-Figure 11 : same setup as for Figure 3.

As a rule of thumb, each LRU (or complex-valued diagonal network) experiment takes 3 minutes on a consumer-scale GPU (NVIDIA GeForce RTX 3070) and each RNN experiment takes 10 minutes on a CPU. The scans behind the results reported in the different figures require on the order of few hundreds run each. Including our preliminary explorations, the results we report in this section required 30 days of compute, one third of it on GPUs and two thirds on CPUs.

C.4 Additional analyses

C.4.1 Structure of the loss landscape for LRUs and S4

In the main text, we only provide an analysis of the loss landscape for the fully connected linear recurrent neural network and its complex-valued diagonal counterpart. We here complete this result by performing the same analysis for the LRU and S4. Given that S4 involves some form of parameter sharing between the magnitude and the angle of the recurrence complex eigenvalues through ∆ , which is required to avoid the explosion of the angle gradients, we are particularly interested in observing whether it fully mitigates or not the gradient explosion effect. The results of Figure 9.B and D do not reveal such benefits: the loss landscape does not have high curvature on the ω im A direction, but it is moved in the ω ∆ direction. We haven't investigated whether qualitative changes arise when changing the input distribution.

Eigenvalue

Hessian

Top 10

eig. vect.

A

B

D

0

10

20

30

Index eigenvalue

10  7

10 0

10 7

10  7

10 0

10 7

10 6

10 3

10 0

0

10 0

10 3

10 6

1

0

1

B re

Bⁱ m

C re

Cⁱ m D

B re

Bⁱ m

C re

Cⁱ m

D

B re

Bⁱ m

C re

Cⁱ m D

B re

Bⁱ m

C re

Cⁱ m

D

10

10

10

Effective LR

10

10

10

Effective LR

B re

Bⁱ m

C re

Cⁱ m D

B re

Bⁱ m

C re

Cⁱ m D

C

D

0

10

20

30

Index eigenvalue

10 6

10 3

10 0

0

10 0

10 3

10 6

1

0

1

w

wy

θm

Wy

wre

W

C.4.2 Concentrating eigenvalue distributions

The goal of this experiment is to better understand how the concentration of eigenvalues λ affect the learning dynamics. For fully connected RNNs, there is no reason to expect a major change in behavior. However, it is different for diagonal RNNs. The theoretical analysis we have done in Section C.2 provides us with the following insights. When the elements in the input sequence are uncorrelated, as it is the case here, the entries in the Hessian corresponding to two different eigenvalues increase if they are aligned or conjugate to each other, and if their magnitude is large. We therefore expect that, as the interval on which the angle of the teacher's eigenvalues shrinks ( θ 0 → 0 ),

those eigenvalues will be more likely to be "similar" to each other. This results in large non-diagonal terms, as we confirm in Figure 10.A, B and C. The LRU suffers less from this problem thanks to its reparametrization, which reduces the overall magnitude of Hessian entries related to the magnitude, and partly the one of angle parameters (when it is a small positive number). As a consequence, the performance between these two architectures increases as θ 0 → 0 , as seen on Figure 10.D.

D

D

D

0

10

Index eigenvalue

10 3

10 9

Eigenvalue

0

10

Index eigenvalue

10 4

10 5

10 6

0

10

Index eigenvalue

10 3

10 4

10 8

10 4

10 0

0

10 0

10 4

10 8

1

0

1

10 6

10 3

10 0

0

10 0

10 3

10 6

1

0

1

10 4

10 2

10 0

0

10 0

10 2

10 4

1

0

1

re

im

re

im

re

im

re

im

re

im

re

im

D

Top 10

eig. vect.

Hessian

RNN

Complex RNN

LRU

10  2

10  1

10 0

10  5

10  3

10  1

Loss

A

D

B

C

=

=

/

=

/

C.4.3 Impact of the number of heads in fully connected linear recurrent networks

In Figure 3, we have shown that constraining the connectivity matrix to be block diagonal with blocks of size 2 × 2 lead to a critical boost in performance. Further analysis revealed that this arises as the Hessian becomes more diagonal and Adam can thus better compensate for gradients explosion. Here, we study this behavior in more detail by interpolating between the fully connected case and the block diagonal one. This can be achieved by increasing the number of independent heads from 1 (fully connected case) to 32 ( 2 × 2 block-diagonal connectivity matrix, as we have 64 hidden neurons). In particular, we are interested in understanding how big heads can be while keeping this performance boost. We plot the final performance, as well as the evolution of the effective learning rate for the A matrix over the course of learning on Figure 11. We find that slightly bigger heads, until 4 × 4 (which corresponds to 16 heads), yield similar benefits. Additionally, the learning rate analysis reveals that the adaptive learning rates of Adam can more selectively compensate for potential gradient explosion cases as the number of heads increases, allowing for bigger learning rates overall and better performance.

1

2

4

8

16

32

Number of heads

10  4

10  2

10 0

Loss

0

50

100

Epoch

10  6

10  4

Effective LR (A)

Heads

1

2

4

8

16

32

A

B

0

200

400

10  3

10  2

10  1

Autocorrelation

=  .

×  .

D Signal propagation in randomly initialized deep recurrent neural networks

D.1 Experimental setup

We detail the experimental setup used in Section 5. We select the first 512 tokens from 1024 random sequences in the Wikipedia dataset [66] and pass them through the BERT [67] tokenizer and embedding layer. This yields a dataset of 1024 examples with length 512 and feature dimension 724. Figure 12 shows the autocorrelation function of these inputs, revealing that the i.i.d. assumption serves ( ρ = 0 ) as a good first order approximation. This validates the relevance of our toy experiments for studying signal propagation in more realistic settings. To refine this approximation, we can include a high correlation term ( ρ close to 1 ).

We examine realistic networks comprising 4 blocks with the following structure: a recurrent layer, a non-linearity, a gated linear unit [58, GLU] and a skip connection. By default, we omit normalization layers, but when included, as in Figure 5.C, we place one normalization layer before the recurrent layer and another one before the GLU. All the layers involved contain 256 neurons. We also incorporate a linear encoder at the beginning of the network and a linear decoder at its end.

The loss that we use is a next-token mean-squared error, defined as

where ˆ x t ( x 1: t -1 ) represents the prediction of the network. Figure 5 reports the average squared value of the hidden state or the gradient. This average is computed over sequences, but also over all neurons / parameters and over all time steps. We compute gradients using batches of size 8.

In Figure 5 we vary ν 0 , which controls the magnitude of the eigenvalues of the recurrent Jacobian. Specifically, we sample those magnitudes in the interval [ ν 0 , (1 + ν 0 ) / 2] . For the complex-valued diagonal RNN and the LRU, we apply the LRU initialization. For the LSTM, we use the Chrono

0

0.9

0.99

10  6

10 0

10 6

0

0.9

0.99

2nd moment

0

0.9

0.99

2nd moment

LRU

cRNN

GRU

1

2

3

4

1

2

3

4

1

2

3

4

rest

angle

magn.

1

2

3

4

1

2

3

4

rest

1

2

3

4

1

2

3

4

rest

GRU

2nd moment

initialization proposed by Tallec and Ollivier [29]: it initializes the forget gate biases such that, when the input x and the hidden state h are equal to 0, the time constant associated to f is uniformly sampled from [ 1 1 -ν 0 , 2 1 -ν 0 ] and the input gate i is equal to 1 -f .

While Figure 5.B presents aggregated gradients over layers, Figure 13 offers a layer-wise version of this analysis. It reveals that the layer index does not significantly impact gradient magnitude. Surpisingly, given that the hidden states of the complex RNN gets larger with depth (c.f. Figure 5.A), this result might seem unexpected for cRNNs. We can attribute this to the backpropagated error signals also being amplified during the backward pass, as discussed in Section 2.2. In the first layers, hidden states are small and errors are large, while in the in last layers, errors are small and hidden states are large. Consequently, the gradient magnitude remains relatively constant accross layers. For the GRU, the gradient magnitude reported in Figure 5 for the non-GRU parameters included the linear encoder and decoder. As the encoder gradients are the dominating ones, this explains why the gradient magnitude for the non-GRU parameters is smaller in the layer-wise analysis.

D.2 Can gated RNNs be considered diagonal?

In Section 3.2, we argued that the diagonal linear setting we focused our theory on can be a decent proxy for more general gated RNNs, whose λ values can depend on both the inputs x and the hidden state h . Here, we assess whether this holds true at initialization. To that end, we study how the Jacobian d h t +∆ d h t of a GRU evolves as ∆ grows. For the linear diagonal regime to be a good proxy, two necessary conditions must be met: First, all the non-diagonal terms should be negligible compared to the diagonal ones. Second, the diagonal terms should decay similarly as if their λ values were independent of x and h .

In Figure 14, we report the evolution of all the diagonal terms of this Jacobian and a random subset of the non-diagonal ones. Our findigns indicate that the non-diagonal terms are much smaller than the diagonal ones under the standard initialization, supporting the first necessary condition. Additionally, input and hidden state-dependent gates do not qualitatively change the decay of the diagonal terms, particularly when the network is initialized with λ values close to 1 (which correspond to large time constants). Furthermore, we find that increasing the strength of all the hidden state to gate connections ( W hn , W hr , W hz ) breaks the diagonal-like behavior and eventually leads to exploding Jacobians. However, this only occurs at values that are much larger (3 times more in this case) than the default initialization of these weights (orthogonal initialization).

In conclusion, those results confirm that the theoretical setting we have considered in this paper is a good proxy for studying signal propagation in realistic recurrent networks. While we have focused our analysis on GRUs, we expect these results to hold for other architectures such as LSTMs, Mamba, or Hawk. For the last two, given that the different gates only depend on the input, we expect the matching with our theory to be even stronger (c.f. Figure 14.C σ h = 0 , which captures this regime).

0.0

0.5

1.0

Entries of

[  ,

]

[  ,

]

[  ,

]

0.0

0.5

1.0

[  ,

]

[  ,

]

[  ,

]

10 0

10 1

10 2

0.0

0.5

1.0

=

10 0

10 1

10 2

=

10 0

10 1

10 2

=

Entries of

Entries of

Diagonal terms

Non-diagonal terms

Constant gates

A

Input and hidden state dependent gates

B

Varying strength of hidden state to gates connections

C

D.3 Does our theory apply to gated RNNs?

Having established that gated RNNs behave similarly to the linear diagonal RNNs considered in our theoretical investigation, a question arises: How well can our theory describe signal propagation in gated RNNs on realistic data? To address this, we study a simplified version of the GRU network (similar to the one studied by Chen et al. [51]), which incorporates a realistic gating mechanism:

As in the rest of this section, we provide BERT embeddings of sentences from the Wikipedia dataset as inputs.

To apply our theory to this architecture, we must address two main challenges:

The gate f t +1 depends on both h t +1 and x t , making it non-constant. Based on our empirical results from the previous section, we reasonably approximate f t +1 ≈ σ ( b f ) =: λ , ignoring this dependency.

Our theoretical derivations have overlooked cases where the recurrence strength λ normalizes the input x t . When considered, we detached the normalization factor from the computational graph (as in Section B.3.2). However, we can extend our calculations from Section B.2 to accommodate this setting:

Note that we obtain E [( ∂ 2 h t ∂b f 2 ) 2 ] by multiplying E [( ∂h t ∂λ ) 2 ] by σ ′ ( b f ) 2 .

With these adjustments in place, we can now empirically test our theoretical predictions. For simplicity, we approximate the auto-correlation function R x (blue line in Figure 12) as R x (∆) ≈ 0 . 332 δ ∆=0 +0 . 044 × 0 . 997 ∆ . Figure 15 presents our results, which reveal:

An almost perfect match between theory and practice for constant gates, confirming that our sample size is large enough.

A very precise, though not perfect, match for context-dependent gates.

The variance of h t and ∂h t ∂b f shows minimal dependence on λ , indicating that the magnitude of error signals received by b f , W fh , and W fx are largely independent of the time constants encoded in the network.

10 1

10 2

10  10

10  8

10  6

10  4

10  2

10 0

2nd moment

Constant gates

10 1

10 2

Input-dependent gates

10 1

10 2

Input and hidden-dependent gates

10 1

10 2

10  10

10  8

10  6

10  4

10  2

10 0

2nd moment

10 1

10 2

10 1

10 2

Samples

Theoretical prediction

Empirical mean

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: We provide a detailed analysis of the claims we make in the abstract in the introduction in a controlled setting and show that our conclusion partly extend to reasonable setting.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: We clearly state the assumptions of our theory and our experiments are performed in a controlled setting.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: the assumptions of the theory are clearly stated in the main text and all derivations are included in the appendix.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: The appendix provides a thorough description of the experiments we perform.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: The appendix provides a thorough description of the experiments we perform.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: We include error bars for all our learning experiments.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: The nature of this work is highly theoretical, we don't foresee any negative nor positive societal impact.

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [NA] .

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper studies the vanishing and exploding gradient phenomenon in RNNs. In particular, it answer the question: \"is solving those issues really enough to ensure well-behaved loss landscapes?\" This paper reveals the importance of the element-wise recurrence design pattern combined with careful parametrizations in mitigating the scale issue of hidden states.\n\nSTRENGTHS:\n1. It is good to see people discuss the complex eigenvalue setting as previous work seems to be limited to real eigenvalues (such as HiPPO)\n2. The teacher-student analysis is well-presented and clarifies the understanding of complex systems within this context.\n\nWEAKNESSES:\n1. The assumption of inputs being wide-sense stationarity seems strong. Does it include the setting such as the Cifar10 dataset? \n2. The argument of input normalization seems hand-waving. \n\t1. When $\\lambda \\to 1$, the forward pass and backward pass are exploding with a different speed: Forward is asymptotically $1/(1-\\lambda)$ while backward is (at least) asymptotically $1/(1-\\lambda)^2$. \n\t2. It should be proper to say normalization can relax one scale issue but it cannot achieve the scaling both at the same time. \n3. The paragraph \"On the Importance of Adaptive Learning Rates\" addresses an essential topic but lacks direct training curves.\n\t1. While the local Hessian analysis provided is valuable, it doesn’t assure improved global performance.\n\t2. It would be more effective and indeed necessary to include training curves comparing results using SGD and adaptive learning rates (such as AdamW). This would clearly illustrate the advantages and need for adaptive optimizers.\n4. Related works on parameterizations and orthogonal matrix is limited:\n\t1. https://proceedings.mlr.press/v80/zhang18g.html\n\t2. https://arxiv.org/abs/1909.09501: This work proposes a parameterised approach to train orthogonal matrix. \n\t3. https://arxiv.org/abs/1901.08428\n\t4. https://openreview.net/pdf?id=ryxepo0cFX\n\t5. https://arxiv.org/abs/2311.14495: This work proposes the relationship between parameterization and gradient in RNNs/SSMs. \n\t6. https://arxiv.org/pdf/2006.12070\n5. I am willing to increase the score if the above issues are addressed.\n\nQUESTIONS:\n1. On Page 4, Equation 5 focuses on the second-order expectation of $h_t$​. It would be helpful to understand the specific reason for choosing a second-order expectation over a first-order one. Generally, implementations do not involve the second moment of hidden states. Why is the first-order expectation not considered in this case? Does first-order suffer from the same problem? \n\t1. A similar forward-pass blow-up has been proved in the LRU(Orvieto, 2023) paper, proposition 3.3. What is the difference in terms of assumption and technique between your result and the LRU result? \n2. On Page 5, in the paragraph titled \"What About Complex Numbers?\", you discuss the concept of polar parametrization. This raises an important question: do all parametrizations encounter the same issues as the polar parametrization? If they do, demonstrating this could effectively highlight the limitations of using complex numbers in a polar setting. If not, it may be worthwhile to find the good parameterization.  Currently, the exploration of polar parametrization seems quite restricted.\n3. Your title is \"vanishing and exploding gradients are not the end of the story\". A question based on the saying in Page 9 Figure 5 Panel C is: \n\t1. Does layer normalization and batch normalization resolves the all problems?\n\t2. If not, I think it's hard to claim \"Layer normalization keeps the overall gradient magnitude under control\".\n\nLIMITATIONS:\n1. This paper investigates how the hidden states of recurrent models contribute to learning long-term memory. There is very little research available to explain why the mamba model, which uses both gating and state-space models, is successful.\n\t1. The discussion on Gated RNNs in lines 205-220 lacks rigorous substantiation, relying primarily on speculative assertions to illustrate the impact of gating mechanisms.\n\t2. The paper does not clearly establish whether the proposed methodology is effective within a gated framework.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-06-16"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn this work, the authors present an analysis of Recurrent Neural Networks (RNNs), focusing on problems which impede optimization as the length of input sequences and model memory increase. The authors first focus on the well-studied problem of vanishing/exploding gradients, arguing that this problem by itself does not explain the difficulties in optimization. The authors turn to the less studied \"curse of memory\", and argue that this issue persists for RNNs even when gradients are controlled to not explode or vanish. Finally, the authors study how some of the alternative recurrent architectures such as LSTMs and SSMs mitigate the curse of memory, and provide some suggestions for how optimization can be improved.\n\nSTRENGTHS:\nI am very intrigued by the approach taken in this work. \n\nThe analysis seems novel and the arguments provided are given in a straightforward and convincing manner. The theoretical and empirical results in the main body of the work all seem sound, and are augmented by substantial additional experiments in the appendices.\n\nThe authors' analysis results in clear explanations both for how current architectures mitigate the issues studied in this work, and the analysis suggests some directions that may lead to new architectural innovations in the future.  \n\nDespite many technical issues in the writing, the argument is presented in a clear way and the flow of the paper makes sense. See below.\n\nWEAKNESSES:\nI have three major issues with the paper in its current form. If issue 1 is addressed, I am willing to increase the score of the presentation from fair to excellent, which would bring the paper to a borderline reject. Issues 2 and 3 are more relevant to the soundness of the work, and I've lowered the score to a 2. If the authors address these, I will consider raising the score; however, I can't go above a 3 without a more substantial discussion of limitations, which I think might not be feasible within the rebuttal period; however, I am still open to adjusting this score depending on the discussion.\n\n1. One of the more glaring issues with this work is with the writing. The authors need to take some time to carefully check for typos, incomplete sentences, and correct grammar. I have listed a few particular issues here:\n  * line 30: remains -> remain\n  * line 69: You say here that you are showing the gradients can explode, but in the next section say you are controlling the gradients so that they do not explode (lines 83-86). Am I missing something conceptually here that makes this not an inconsistency?\n   * line 70: remains -> remain\n   * Figure 1: the last sentence of the caption is unclear and seems to be missing some words.\n   * line 86: should be \"studying this behavior quantitatively\", not the other way around\n   * line 192: alleviates -> alleviate\n   * line 283: characteristic -> are characteristic\n\nif these issues are all fixed and the authors will take some time to carefully edit, I will update my score to reflect this effort. Overall the typos only affect clarity in a few spots.\n\n2. In section 2.2 - you justify assumptions A) and B), but I couldn't find any justification of assumption C). Unless I am missing something, this needs to be provided, as assuming Wide-sense stationarity is not necessarily standard. At the very least, this assumption could be acknowledged as a limitation and room for future work. \n\n3. There is no real discussion section at all, and there is particularly no discussion of limitations.\n\nQUESTIONS:\nSee above - why is the assumption of Wide sense stationarity needed, and how is your analysis affected by not adopting the assumption?\n\nLIMITATIONS:\nNo limitations are presented or discussed in the paper as far as I could find. \n\nI see no ethical issues with this work.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-10"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper explores challenges RNNs face in learning long-term dependencies. While generally attributed to the exploding and vanishing gradients problem (EVGP), the authors reveal that as a network's memory increases, parameter changes cause an explosion of the second moment of hidden states and their gradients, making gradient-based learning highly ill-posed. They study different design choices in recurrent architectures such as element-wise recurrence, gating mechanisms and careful parameterization with respect to the curse of memory. They apply their theoretical findings to successful architectures such as state-space models (SSMs) and LSTMs, offering new insights into why some RNN architectures perform better in gradient-based learning.\n\nSTRENGTHS:\n- The paper addresses a fundamental problem, the curse of memory, and connects it through theoretical analysis and experimental validation to the success of recent architectures, which makes the insights incredibly valuable to the machine learning community\n- I like how the authors connect the dots between multiple facets of model training, e.g. investigating the implications of RNN recurrence parametrization on adaptive LR optimizers, which are actually used in practice\n- The paper is also well structured and generally well written.\n\nWEAKNESSES:\n- To add to EVGP mitigation techniques (l. 61 - 64): There also exist regularization techniques based on dynamical systems theory, see especially [1]\n- There are quite some typos across the document, see the list below. I recommend running the paper through some sort of language checker to improve the manuscript from a readability and presentation side.\n- The authors repeatedly call $\\mathbb{E}[X^2]$ a variance (where $X$ here is a placeholder for any RV, i.e.  $h_t$ and $d_\\theta h_t$ in the paper), which is technically not correct. It is the second moment. I’d consider fixing this or explaining why the missing term for the variance, $\\mathbb{E}[X]^2$ (first moment squared), can be neglected.\n\nTypos / text-bugs:\n- l. 119: “[...] a low a pass filtered [...]\n- l. 191: “[...] does not hurts [...]”\n- l. 192 “Several RNN architectures implicitly alleviates [...]”\n- l. 200 “While such models can can approximate any smooth mappings [...]” \n- l. 219 “anaylsis”\n- l. 257 “Both network are trained [...]”\n- word missing in l. 283 “[...] that characteristic of the curse of memory, [...]”?\n- l. 298 consistently -> consistent\n\n[1] Schmidt et al., Identifying nonlinear dynamical systems with multiple time scales and long-range dependencies (ICML 2021)\n\nQUESTIONS:\n- in l. 180 you assume $\\gamma$ is independent of $\\lambda$ yet in the Diff. eq. in l. 182 you introduce the dependency again ($\\gamma(\\lambda)$)? Is this connected to what you write in the caption of Fig. 2 where you decouple $\\gamma$ from $\\lambda$ when differentiating? Can you explain the reason for this in more detail?\n- in l. 289 you mention that you probe ADAM’s effective learning rate by providing a vector of ones to the optimizer - does that mean you simply read out ADAM’s (corrected) second-moment estimates and report $\\frac{\\eta}{\\sqrt{v_n} + \\epsilon}$, where $\\eta$ is the global learning rate and $v_n$ the second moment estimates at iteration $n$? If so, at which iteration/epoch do you query the effective learning rate?\n\nLIMITATIONS:\nWhile an explicit section on limitations is missing, the authors mention their limitations and specific assumptions throughout the manuscript.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-11"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper discusses \"the curse of memory\" which is the hypersensitivity of hidden states to parameters as the memory increases. This can lead to optimization issues, even if the exploding/vanishing gradient issue is addressed. The authors discuss solutions to this problem: complex diagonalization, normalization, and reparametrization. To this end, the authors derive closed-form solutions for the variance of the hidden state and its sensitivity to the parameters and discuss how the solutions can prevent the variances from diverging. This can give insights into why certain families of RNNs are performant. In particular, they show that both the variance of the hidden state and its derivative wrt to the parameters diverges as the memory goes to infinity (although at different rates). Therefore, normalizing the hidden state and reparametrizing the variable representing the memory's temporal scale can avoid the divergence issue.\n\nSTRENGTHS:\n- The paper puts forward closed-form solutions for the variance of hidden state and the sensitivity of hidden state to parameters. This is interesting and can provide insights into RNN dynamics and possibly network design.\n- The results and the discussion on adaptive learning rate and how it relates to the Hessian of fully connected and complex diagonal RNNs are interesting and, to my knowledge, novel.\n\nWEAKNESSES:\n- The main weakness of the paper is the presentation. It is unclear what the contribution of papers is. At many points in the manuscript, it is unclear if the authors are discussing previous results on LRUs or putting forward new results. It would be good if the authors explicitly spell out their contributions.\n- Although the paper is presented as discussing the curse of memory and the solutions to it, it reads more like \"why LRUs are performant\" The solution discussed: exponential reparametrization, normalization, and diagonalization, are all introduced and employed in LRU architecture [20]. However, the authors only discuss SSMs and gated RNNs as networks that implicitly address \"the curse of memory\". Meanwhile, LRUs employ the same solution discussed in the paper explicitly. Although LRUs can be thought of as a subclass of SSMs, vanilla SSMs [17] do not use the normalization, diagonalization, and exponential reparametrization discussed in the paper. Therefore, discussing LRUs only in experiments \"to represent SSMs due to its simplicity\" is not justified. \n- If the solution to the curse of memory is not the contribution of the paper, then the novelty and contribution become limited. As I mentioned earlier, LRUs employ the same solution and sometimes with the same justification, for example, exponential parametrization is used for higher granularity around 1 [20]. \n- To motivate their results, the authors mention that \"We answer negatively by showing that gradients can explode as the memory of the network increases, even when the dynamics of the network remains stable.\" but it is unclear where this is shown. \n\n- minor comments:\nL117: the paragraph on backward pass is confusing and hard to understand.\nL139: check wording. Could not understand it.\n\nQUESTIONS:\n- What are the main contributions of the paper? Which results and which sections?\n- What are other types of normalization and reparametrization, other than the ones employed by LRUs, that can address the curse of memory?\n\nLIMITATIONS:\nNA", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper provides a theoretical and practical analysis on the difficulties of training recurrent neural networks. In particular, given the current rise of interest in leveraging recurrent mechanisms for long sequence processing -- due to novel architectural components and solutions (deep state-space models, linear/diagonal recurrences, exponential parametrizations), identifying the crucial components allowing to preserve long range information is a very important research avenue.\n\nSTRENGTHS:\nThe paper provides an interesting theoretical analysis that highlights which are the key components allowing modern solutions (Deep SSMs) and gated models (LSTMs/GRU) to achieve good performances. Moreover, it provides some proof-of-concept practical results that help to confirm the analysis. The paper is well written (apart from few typos, I suggest a proofreading).\n\nWEAKNESSES:\nI have some concerns with some of the paper initial framing and setting (see the Questions section) and the experimental analysis, which has been carried on very synthetic tasks which I am not sure are capable to represent real learning scenarios, thus possibly hindering the analysis validity.\n\nQUESTIONS:\n1) (Minor) While I understand that recent literature has completely overriden this notion, the term \"state-space model\" refers [1,2,3] to a very general broad concept which is common in control theory and dynamical systems -- which simply refers to a model equipped with state variables controlled by first-order differential equations or difference equations. Such definition  covers the typical feedback connection of Recurrent Models. Thus, stating in the abstract  and in the main text \"state-space models, a subclass of RNNs\" seem a bit too strong to me -- even if several recent works highlighted the connections. I would be completely fine with specifying \"Deep\" SSMs (just to highlight that the authors are referring to modern models) or \"Structured\" SSMs and to mention the suggested references, to better frame the paper to the readers. \n\n2) In Eq. 1, the authors consider a model not equipped with an output mapping (that was instead considered in Eq. 10, i.e. y_t = Ch_t + Dx_t) -- the hidden state h_t is directly provided to the loss function.  Why is that the case, and do the considered analysis still hold when considering such mapping (that is common in RNNs and SSMs)?\n\n3) The authors refers to an Infinite time horizon/infinite sequences (lines 98/100) as the basis for their analysis. Practically, how long the learning process necessitates to be to the considered issue to emerge/is this something that also the experimental analysis considers? In such case, does this have relation with recent literature highlighting the difficulties of sequential models when dealing with Infinite length sequences [3, 4]? I would like a comment by the authors on this.\n \n4) Line (40): the notation (x_t)_t is not very clear to me.\n\n5) Could the authors give an intuition on lines (113/116)?  Why an higher correlation in the input data should imply an higher variance in the model state (in my understanding, similar inputs imply similar loss function, thus smaller gradients)\n\n6) In line 135, the authors use yet another form for the state update that do not consider the B linear mapping. Why is that the case?\n\n7) The teacher-student task should be better described and justified. Why did the authors chose to tackle such task instead of other synthetic tasks (such as selective copy, induction heads etc. see recent surveys [3] for references on synthetic datasets ). And do the authors believe that the teacher-student task is general enough (i.e., points sampled from a normal distribution) to represent a setting where the state has to learn meaningful long range dependencies? Do the conclusions still hold when dealing with tasks  requiring to store more informative data? I believe that  experiments could benefit from experimentations on more \"difficult\" settings (selective copy, Long Range Arena) to confirm the theoretical considerations with real learning scenarios. \n \n[1]  Genshiro Kitagawa. A self-organizing state-space model. Journal of the American Statistical Association, pages 1203–1215, 1998. 4\n\n[2]  Anton Schafer and Hans Georg Zimmermann. Recurrent neural networks are universal approximators. In Proceedings of ICANN,  pages 632–640. Springer, 2006.\n\n[3] Tiezzi, Matteo, et al. \"State-Space Modeling in Long Sequence Processing: A Survey on Recurrence in the Transformer Era.\" arXiv preprint arXiv:2406.09062 (2024).\n\n[4] Tiezzi, Matteo, et al. \"On the resurgence of recurrent models for long sequences: Survey and research opportunities in the transformer era.\" arXiv preprint arXiv:2402.08132 (2024).\n\nLIMITATIONS:\nThe paper does not discuss limitations.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-12"}