Title: State-space models with layer-wise nonlinearity are universal approximators with exponential decaying memory
Venue: NeurIPS 2023
Accepted: yes
Keywords: state space

approximation theory

sequence modelling
Abstract: State-space models have gained popularity in sequence modelling due to their simple and efficient network structures. However, the absence of nonlinear activation along the temporal direction limits the model's capacity. In this paper, we prove that stacking state-space models with layer-wise nonlinear activation is sufficient to approximate any continuous sequence-to-sequence relationship. Our findings demonstrate that the addition of layer-wise nonlinear activation enhances the model's capacity to learn complex sequence patterns. Meanwhile, it can be seen both theoretically and empirically that the state-space models do not fundamentally resolve the issue of exponential decaying memory. Theoretical results are justified by numerical verifications.

State-space Models with Layer-wise Nonlinearity are Universal Approximators with Exponential Decaying Memory

Abstract

State-space models have gained popularity in sequence modelling due to their simple and efficient network structures. However, the absence of nonlinear activation along the temporal direction limits the model's capacity. In this paper, we prove that stacking state-space models with layer-wise nonlinear activation is sufficient to approximate any continuous sequence-to-sequence relationship. Our findings demonstrate that the addition of layer-wise nonlinear activation enhances the model's capacity to learn complex sequence patterns. Meanwhile, it can be seen both theoretically and empirically that the state-space models do not fundamentally resolve the issue of exponential decaying memory. Theoretical results are justified by numerical verifications.

1 Introduction

State-space model [1-5] is an emerging family of neural networks specialized in learning long sequence relationships. It achieves significantly better performance compared with attention-based transformers in the long range arena (LRA) dataset [6, 7]. Despite its effectiveness, the statespace model is built on a relatively simple foundation of linear-RNN-like layers. One of the key advantages of state-space models is their simple recurrence, which enables efficient acceleration. In fact, this recurrence allows for an asymptotic computational complexity of only O ( T log T ) , which is significantly better than the O ( T 2 ) complexity of traditional full-attention approaches [8]. A natural question would be whether SSM achieves this speedup with certain sacrifices in model capacity or memory property. It is currently unclear whether the state-space model's linear architecture with layerwise nonlinearity possesses sufficient expressive capacity to approximate any target sequence-tosequence relationship. This knowledge would be important to answer pertinent questions regarding the model's ability to handle the complexity of real-world datasets characterized by diverse and intricate sequence relationships. In particular, considering the speed advantage of SSM over attentionbased transformers, the universal approximation property impacts whether a state-space model could be a suitable replacement for a transformer.

In this paper, we study the universality of state-space model. Furthermore, the memory property is investigated and we show that state-space models also have an asymptotically exponential decaying memory.

The main contributions can be summarized as follow

We give a constructive proof for the universal approximation property for multi-layer statespace models. The width dependency on sequence length is analyzed.

...

...

Temporal direction

Depth

direction

Layer-wise nonlinearity

recurrent

activation

The state-space models are shown to have an exponentially decaying memory, which coincides with usual recurrent neural networks.

Numerical verifications for the memory property are given on synthetic datasets.

2 Background

In this section, we introduce the general form of the state-space models. The classical results on universal approximation for recurrent neural networks are summarized. Based on the approximation result, the well-documented challenge of learning long-term memory via recurrent networks is summarized. In particular, we give the definition of memory function which we shall use in the derivation of memory decay.

2.1 State-space models

Single-layer state-space model can be viewed as a recurrent neural network without nonlinear recurrent activation. As is shown in Figure 1, the discrete time version of SSM [9] is

where x ∈ R d in , y ∈ R d out , h ∈ R m , W ∈ R m × m , U ∈ R m × d in , C ∈ R d out × m , D ∈ R d out × d in . Notice that we drop the bias term for simplicity. For multi-layer state-space model, the nonlinear activation is added layer-wise.

The continuous time version of a single layer is

It can be seen in Equation (4) that the first component of output y is the convolution between kernel function ρ ( t ) = Ce W ( t -s ) U and x . In discrete case, the convolution operator ∗ is represented by

Compared with temporal convolution network (TCN) [10], which has a finite kernel size, state-space models can be regarded as implementing global convolution ( ρ ( t ) = Ce W ( t -s ) U, t ≥ 0 ) over the

temporal axis. Numerically, since the kernel size is the same as the sequence length, the convolution implemented via fast Fourier transform can lead to significant accelerations [11]. Compared with attention-based transformer, it is shown that SSM can speed up the training 100x in learning sequences with length 64K [12]. The state-space model's temporal efficiency is achieved by eliminating the nonlinear activation function in its recurrent layers h k +1 = Wh k + Ux k + b , resulting in faster processing of sequential data via parallel scan [11].

2.2 Universal approximation in RNN

It is long-known that recurrent neural networks with nonlinear sigmoidal activations (such as tanh and sigmoid) are universal approximators.

Theorem 2.1 (Simplified universality statement) . For any sequence to sequence map: H : x → y and tolerance ϵ , there exists a hidden dimension m and weights c, W, U, b such that the RNN with weights ( c, W, U, b ) can approximate the target sequence to sequence map:

where prediction sequence ˆ y is given by

Universal approximation establishes the feasibility of learning sequence to sequence relationships via recurrent neural networks. However, typical approximation rate results depend on the sequence length [13]. Sequence length dependent approximation rate does not generalize to the case of sequence of infinite length. In learning sequences with infinite length, Li et al. [14] shows that linear RNNs have difficulty in learning non-exponential decaying memory. Various numerical experiments [15] confirm that adding nonlinear recurrent activation does not fundamentally change the decay. In state-space models, the nonlinearity is included in a layer-wise approach. It is unknown whether such layer-wise nonlinearity alone is sufficient to approximate any sequence to sequence relationships.

2.3 Memory function and curse of memory

In this paper we study the memory property of state-space model. Before we introduce the main results, we present a simple memory function definition in sequence modelling. Li et al. [14] proves that a bounded causal continuous regular time-homogeneous linear functional has the following Riesz representation:

Here ρ : R + → R is an L 1 -integrable function. If ρ t rapidly decreases with t , then the target sequence relationship has a short-term memory.

Since ρ t fully captures the memory property of a linear functional [14], we call it the memory function (of the linear functional). In particular, when approximating the linear functional with linear RNNs, the model's memory function is ˆ ρ ( t -s ) = C ⊤ e W ( t -s ) U .

The curse of memory refers to the phenomenon that if a target linear functional can be approximated by a sequence of linear RNNs, the memory function ρ t decays exponentially.

Take the test input to be x test = { 1 t ≥ 0 , 0 t < 0 . Notice that the derivative of the linear functional at test input extracts the memory function ∣ ∣ d dt H t ( x test ) ∣ ∣ = | ρ ( t ) | 2 . Therefore a natural extension of the memory function [16] to the bounded causal continuous regular time-homogeneous nonlinear functionals will be:

It can be seen this definition is compatible with the memory function definition of linear functional. Also, this memory function can be evaluated by computing the models' derivative at the test input using finite difference method.

...

...

3 Main results

In this section, we first give a simple constructive proof to show that any element-wise function on input sequence can be approximated by a two-layer state-space model. Next, we show any temporal convolution can be approximated by a state-space model. The constructive proof for general nonlinear sequence to sequence functional is given based on the above propositions. Moreover, as the Kolmogorov-Arnold-representation-based construction has a weight number dependent on sequence length, it can be highly inefficient to construct a shallow wide network to learn long sequences. To reduce the widths dependency on the sequence length, a Volterra-series-based construction is demonstrated.

3.1 Two-layer SSM approximates element-wise function

By element-wise function, we mean learning sequence relationship with form ( x 1 , . . . , x T ) → ( f ( x 1 ) , . . . , f ( x T )) .

Proposition 3.1. For any given continuous function f over a compact set K , let the activation σ be sigmoidal function.

There exists a sequence of two-layer state-space model with weights { W 1 , W 2 , U 1 , U 2 , b 1 , b 2 } that can approximate sequence relationship H : ( x 1 , . . . , x T ) → ( y 1 , . . . , y T ) .

Here the two-layer state-space model is constructed by

The proof is included in Appendix B.2. The main idea is to approximate element-wise function f ( x ) with U 2 σ ( U 1 x + b 1 ) . A graphical demonstration is given in Figure 2. It can be seen the two-layer state-space model can approximate any element-wise function by setting W 1 = W 2 = b 2 = 0 .

3.2 SSM approximates temporal convolution

In this part we show that state-space models can approximate temporal convolution: y k = ∑ k i =1 ρ k -i x i , 1 ≤ k ≤ T. According to Equation (3), the hidden state of SSM is the convolution between input sequence and exponentially decaying function ˆ ρ k = CW k U . y k = ∑ k i =1 CW k -i Ux i + CW k h 0 + Dx k .

Therefore the approximation problem of temporal convolution by state-space models is reduced to the approximation problem of general convolution kernel ρ k , 1 ≤ k ≤ T by exponentially decaying convolution kernel ˆ ρ k , 1 ≤ k ≤ T . The optimal weights are defined by C, W, U = arg min C,W,U sup k | ρ k -CW k U | .

Proposition 3.2. For any given convolution kernel ρ k , 1 ≤ k ≤ T , the single-layer state-space model is universal approximator for temporal convolution.

In other words, for any ϵ > 0 , there exists a hidden dimension m and corresponding weights C, W, U such that ρ k = CW k U satisfies

See Appendix B.3 for the proof. The main idea is to represent the single-layer state-space model output as a convolution between input and kernel function. The approximation of temporal convolution is then reduced to the approximation of general kernel with the SSM-induced kernels.

Remark 3.3 . Although the Proposition 3.2 indicates that we can use single-layer state-space model to approximate any convolution, it does not reveal the necessary hidden dimension m for such approximation.

3.3 Universality of SSM

Now we show that five-layer state-space model is universal. Without loss of generality, assume the output y is one-dimensional. The main proof is based on the famous Kolmogorov-Arnold representation theorem [17]. By Kolmogorov-Arnold representation theorem, we know any multivariate continuous function f : R d → R can be represented by

Remark 3.4 . George Lorentz [18] shows that we can use the same Φ : f ( x 1 , . . . , x d ) = ∑ 2 d q =0 Φ ( ∑ d p =1 ϕ q,p ( x p ) ) . Sprecher [19] proves that it can be further reduced to the same ϕ :

f ( x 1 , . . . , x d ) = ∑ 2 d q =0 Φ ( ∑ d p =1 λ p ϕ ( x p + ηp ) + c q ) . Braun and Griebel [20] gives the first constructive proof for the superposition. Moreover, the inner function ϕ is shown to be independent of target function f . It means the learning of function ϕ can be approximated without retraining for different target functionals.

We summarize the Kolmogorov-Arnold theorem as follow:

Theorem 3.5 ([17, 20]) . Fix dimension d ≥ 2 . There are real numbers a, b p , c q and a continuous and monotone function ϕ : R → R , such that for any continuous function f : [0 , 1] d → R , there exists a continuous function Φ : R → R with

Proposition 3.6. For any bounded causal continuous sequence to sequence relationship H : { x k } T k =1 → { y k } T k =1 and tolerance ϵ > 0 , there exists a hidden dimension m and corresponding state-space model (as constructed in Figure 3) such that the error of approximation

See the proof in Appendix B.4. The main idea is demonstrated in Figure 3, the nonlinear functions are separately approximated by two-layer state-space model.

Remark 3.7 . The Kolmogorov theorem provides a construction for achieving universality in a fivelayer state-space model. However, the quantity of hidden neurons increases linearly with the sequence length. This can become exceedingly burdensome when the sequence length escalates.

Another approach is from the perspective of Volterra Series, which features the sequence-length independent neurons.

...

......

...

...

......

Element-wise function

Convolution

Element-wise function

......

......

Theorem 3.8 ([21]) . For any continuous time-invariant system with x ( t ) as input and y ( t ) as output can be expanded in the Volterra series as follow

In particular, we call the expansion order N to be the series' order.

A simplified interpretation of the N -th Volterra Series expansion is the ' N -th Taylor expansion in the sequence variable x '.

Proposition 3.9. For any bounded causal continuous time-homgeneous sequence to sequence relationship H : { x k } T k =1 →{ y k } T k =1 and tolerance ϵ > 0 , there exists a hidden dimension m and corresponding state-space model (as constructed in Figure 4) such that the error of approximation

Moreover, the neurons of the state-space model do not explicitly depend on the sequence length T .

See the proof in Appendix B.5. The main idea is to approximate the convolution kernels h n ( τ 1 , . . . , τ n ) by the low-rank tensor product of first-order convolution kernel.

Γ(ΓOΓHΓPΓHΓQΓWΓıΓZΓLΓVΓHΓΛΓSΓUΓRΓGΓXΓFΓW

Γ(ΓOΓHΓPΓHΓQΓWΓıΓZΓLΓVΓHΓΛΓSΓUΓRΓGΓXΓFΓW

Γ/ΓLΓQΓHΓDΓUΓΛΓFΓRΓPΓEΓLΓQΓDΓWΓLΓRΓQ

Remark 3.10 . The advantage of Volterra-series-type construction is the approximation of the convolution kernel with SSM-induced kernel as well as the approximation of multivariable convolution kernel with tensor product of one-dimensional convolution kernel do not explicitly depend on the sequence length. Similar approaches have been adopted by idea of implicit convolution in CKConv [22].

3.4 Memory decay of SSM

In the ensuing discourse, we turn our focus towards an examination of the memory property inherent in state-space models. It has been thoroughly studied in literature that recurrent neural networks exhibit a phenomenon of exponential memory decay [14]. An intriguing question that naturally arises in this context is whether state-space models are plagued by similar challenges. Upon careful investigation, it is concluded that state-space models, much like their neural network counterparts, do possess an asymptotically exponential decaying memory.

Proposition 3.11. Assume there exists a constant c 0 > 0 such that

Assume the output y t is the output of single-layer state-space model with parameters C, W, U . Then, for the same constant c 0 , if the output's derivative satisfies dy t dt → 0

At the same time, general smooth nonlinear activation does not change the exponential decay property of a sequence:

Proposition 3.12. Assume there exists a constant c 0 > 0 such that

For given Lipschitz continuous layer-wise activations σ , there exists a positive constant c 0 such that the output memory function dy t dt → 0

See the proofs for above two propositions in Appendix B.6 and Appendix B.7.

Based on the above two propositions, by induction we have the following theorem:

Theorem 3.13. Assume H is a multi-layer state-space model with Lipschitz continuous function as the layer-wise activations. Assume the state-space model is stable in the sense that matrix W 's eigenvalue are bounded by 1.

There exists a positive constant c 0 such that the memory function (defined in Equation (10) ) of state-space model is decaying exponentially

4 Numerical verifications

Based on the generalization of memory function ρ in linear functional, we verify the asymptotic memory decay of state-space models with simple randomly generated models. The definition is given in one-dimensional case, but it can be generalized to multi-variable case by taking different unit inputs in various coordinates. The motivation for the above definition is based on the idea of measuring the earlier input at the later output.

In our experiment, we construct various RNN models and SSM with random generated weights. It can be seen in Figure 5 that the memory of naive state-space models also has an exponentially decay memory. It is consistent with the previous theorem that state-space model has an asymptotic exponentially decaying memory. Notice that here the naive SSM is simply adding a tanh activation across layers without specially tuning the weights. Such random initialization can expose the memory issue more significantly as the S4 layer is constructed with several parameterization techniques. However, the manually constructed S4 still has an asymptotic exponential decaying memory as is shown in Figure 6.

5 Related Work

In this section, we introduce the previous works on state-space models. As the single-layer statespace model is a linear RNN, we summarize the related approximation work on RNN. In particular, the approximation result and memory result is emphasized as this paper works on the universal approximation property and memory decay property of SSM.

State-space models State-space models originate from the HIPPO matrix which is optimal in the online function approximation sense [2-4]. The Hippo matrix initialization for recurrent matrix W enables the state-space model to have a slow decaying memory. The universal approximation idea is heuristically demonstrated in Orvieto et al. [23]. However, the proof from the Koopman theory perspective only guarantees the existence of universal approximation. Our proof is a constructive proof which can be further generalized to study the approximation rate with respect to the hidden dimensions and network depths.

Recurrent neural networks Recurrent neural networks (RNNs) [24] are one of the most popular neural networks for sequence modelling. Various results have been established in RNNs approximation theory, see Sontag [25], Hanson et al. [13]. Apart from the universal approximation, the exponential decaying memory property is the notorious phenomenon in recurrent neural networks which prohibits the scale up of the models in terms of the sequence length [14, 26].

6 Discussion

In Table 1 we compare the classical sequence models including RNN, TCN and attention-based transformer. The state-space model can be considered as an enhancement of Recurrent Neural Networks (RNNs) due to its superior optimization and inference speed. Despite maintaining a similar network topology, inference cost, and memory pattern, it provides a more efficient and streamlined approach. The effort to extend the long-memory learning is also carried out in convolutional networks and attention-based transformers. Romero et al. [22] proposes to parameterize the convolution

0

20

40

60

80

100

120

time

t

10

24

10

20

10

16

10

12

10

8

10

4

10 0

memory

layers=1

layers=2

layers=3

layers=4

(a) RNN

0

20

40

60

80

100

120

time

t

10

15

10

12

10

9

10

6

10

3

10 0

memory

layers=1

layers=2

layers=3

layers=4

(b) GRU

0

20

40

60

80

100

120

time

t

10

16

10

13

10

10

10

7

10

4

10

1

memory

layers=1

layers=2

layers=3

layers=4

(c) LSTM

0

20

40

60

80

100

120

time

t

10

17

10

14

10

11

10

8

10

5

10

2

memory

layers=1

layers=2

layers=3

layers=4

(d) Naive SSM

kernel implicitly, which utilizes the power of spline function approximation y = sin( w 0 ( Wx + b )) . Similar idea has been adopted in Poli et al. [12]. To summarize, we regard SSM, CKConv and linear transformer as the sequence models' improvement in learning long-memory for long sequences.

7 Conclusion

In this paper, we give a constructive proof for the universal approximation property of multi-layer state-space models. It is shown that the nonlinear recurrent activations in classical recurrent neural networks are not necessary when there are nonlinear activations across different hidden layers. This result implies state-space model is as powerful as the classical recurrent neural networks in the approximation sense. Furthermore, we study the memory decay in multi-layer state-space models, which is a notorious issue in classical recurrent neural networks. While empirical evidence suggests

0

500

1000

1500

2000

time

t

10

8

10

7

10

6

10

5

10

4

10

3

10

2

10

1

memory

layers=1

layers=2

layers=3

that state-space models do not experience significant memory decay, they nonetheless exhibit a memory pattern that decays exponentially in the asymptotic sense.

Our research has exciting implications for future work in state-space models. By extending our work to the approximation rate of state-space models, we can obtain better understanding of state-space models' hypothesis space. Such result is important to further optimize the architecture in various real-world applications. We aim to unlock the full potential of state-space models by identifying the ideal network structure (including depth and hidden dimension) for specific tasks and applications.

References

V. Siivola and A. Honkela. A state-space method for language modeling. In 2003 IEEE Workshop on Automatic Speech Recognition and Understanding (IEEE Cat. No.03EX721) , pages 548-553, St Thomas, VI, USA, 2003. IEEE. ISBN 978-0-7803-7980-0. doi: 10.1109/ ASRU.2003.1318499.

Albert Gu, Tri Dao, Stefano Ermon, Atri Rudra, and Christopher Ré. HiPPO: Recurrent Memory with Optimal Polynomial Projections. In Advances in Neural Information Processing Systems , volume 33, pages 1474-1487. Curran Associates, Inc., 2020.

Jimmy T. H. Smith, Andrew Warrington, and Scott Linderman. Simplified State Space Layers for Sequence Modeling. In International Conference on Learning Representations , February 2023.

Daniel Y. Fu, Tri Dao, Khaled Kamal Saab, Armin W. Thomas, Atri Rudra, and Christopher Re. Hungry Hungry Hippos: Towards Language Modeling with State Space Models. In The Eleventh International Conference on Learning Representations , February 2023.

Junxiong Wang, Jing Nathan Yan, Albert Gu, and Alexander M Rush. Pretraining without attention. arXiv preprint arXiv:2212.10544 , 2022.

Yi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen, Dara Bahri, Philip Pham, Jinfeng Rao, Liu Yang, Sebastian Ruder, and Donald Metzler. Long Range Arena : A Benchmark for Efficient Transformers. In International Conference on Learning Representations , January 2021.

Albert Gu, Karan Goel, Ankit Gupta, and Christopher Ré. On the Parameterization and Initialization of Diagonal State Space Models. Advances in Neural Information Processing Systems , 35:35971-35983, December 2022.

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 , volume 30. Curran Associates, Inc., 2017.

Albert Gu, Isys Johnson, Aman Timalsina, Atri Rudra, and Christopher Re. How to Train your HIPPO: State Space Models with Generalized Orthogonal Basis Projections. In International Conference on Learning Representations , February 2023.

Shaojie Bai, J Zico Kolter, and Vladlen Koltun. An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271 , 2018.

Eric Martin and Chris Cundy. Parallelizing Linear Recurrent Neural Nets Over Sequence Length. In International Conference on Learning Representations , February 2018.

Michael Poli, Stefano Massaroli, Eric Nguyen, Daniel Y. Fu, Tri Dao, Stephen Baccus, Yoshua Bengio, Stefano Ermon, and Christopher Re. Hyena Hierarchy: Towards Larger Convolutional Language Models. In International Conference on Machine Learning , June 2023.

Joshua Hanson, Maxim Raginsky, and Eduardo Sontag. Learning Recurrent Neural Net Models of Nonlinear Systems. In Proceedings of the 3rd Conference on Learning for Dynamics and Control , pages 425-435. PMLR, May 2021.

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):1-85, 2022. ISSN 1533-7928.

Y. Bengio, P. Simard, and P. Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks , 5(2):157-166, March 1994. ISSN 1941-0093. doi: 10.1109/72.279181.

Shida Wang, Zhong Li, and Qianxiao Li. Inverse approximation theory for nonlinear recurrent neural networks. arXiv preprint arXiv:2305.19190 , 2023.

A. N. Kolmogorov. On the representation of continuous functions of many variables by superposition of continuous functions of one variable and addition , volume 28, pages 55-59. American Mathematical Society, Providence, Rhode Island, 1963. ISBN 978-0-8218-1728-5 978-1-4704-3239-3. doi: 10.1090/trans2/028/04.

Lothar Collatz and Werner Krabs. Approximationstheorie: Tschebyscheffsche Approximation mit Anwendungen . Springer-Verlag, April 2013. ISBN 978-3-322-94885-4.

David A Sprecher. ON THE STRUCTURE OF REPRESENTATIONS OF CONTINUOUS FUNCTIONS OF SEVERAL VARIABLES AS FINITE SUMS OF CONTINUOUS FUNCTIONS OF ONE VARIABLE. Proceedings of the American Mathematical Society , 1965.

Jürgen Braun and Michael Griebel. On a Constructive Proof of Kolmogorov's Superposition Theorem. Constructive Approximation , 30(3):653-675, December 2009. ISSN 0176-4276, 1432-0940. doi: 10.1007/s00365-009-9054-2.

Stephen Boyd, L. O. Chua, and C. A. Desoer. Analytical Foundations of Volterra Series. IMA Journal of Mathematical Control and Information , 1(3):243-282, January 1984. ISSN 0265-0754. doi: 10.1093/imamci/1.3.243.

David W. Romero, Anna Kuzina, Erik J. Bekkers, Jakub Mikolaj Tomczak, and Mark Hoogendoorn. CKConv: Continuous Kernel Convolution For Sequential Data. In International Conference on Learning Representations , January 2022.

Antonio Orvieto, Samuel L Smith, Albert Gu, Anushan Fernando, Caglar Gulcehre, Razvan Pascanu, and Soham De. Resurrecting recurrent neural networks for long sequences. arXiv preprint arXiv:2303.06349 , 2023.

David E. Rumelhart, Geoffrey E. Hinton, and Ronald J. Williams. Learning representations by back-propagating errors. Nature , 323(6088):533-536, October 1986. ISSN 1476-4687. doi: 10.1038/323533a0.

Eduardo D. Sontag. A learning result for continuous-time recurrent neural networks. Systems & Control Letters , 34(3):151-158, June 1998. ISSN 01676911. doi: 10.1016/S0167-6911(98) 00006-1.

Haotian Jiang, Qianxiao Li, Zhong Li, and Shida Wang. A Brief Survey on the Approximation Theory for Sequence Modelling. Journal of Machine Learning , 2(1):1-30, June 2023. ISSN 2790-203X, 2790-2048. doi: 10.4208/jml.221221.

Andrew R. Barron. Approximation and estimation bounds for artificial neural networks. Machine Learning , 14(1):115-133, January 1994. ISSN 1573-0565. doi: 10.1007/BF00993164.

G. Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems , 2(4):303-314, December 1989. ISSN 1435-568X. doi: 10.1007/ BF02551274.

Ronen Eldan and Ohad Shamir. The Power of Depth for Feedforward Neural Networks. In Conference on Learning Theory , pages 907-940. PMLR, June 2016.

A Memory of multi-layer linear RNNs

In this section, we study the memory function of linear RNN. The depth of linear RNN does not directly expand the memroy pattern as the memory are still decaying exponentially. Nonetheless, although the depth does not increase the approximation capacity, a deeper model is endowed with more structural property.

Take the two-layer Linear RNN as an example:

The memory function of two-layer linear RNN is

The main advantage of two-layer linear RNN, compared with single-layer linear RNN, is that it can learn unbounded combination of exponential decay function as long as λ 2 j and λ 1 i are close enough. Notice that for simplicity we do not include the bias term in the evaluation of memory function. The multi-layer linear Recurrent Neural Network (RNN), including a bias term, can be perceived as a linear combination of various depth-specific linear RNNs, devoid of a bias term.

B Proof

B.1 Universal approximation

Here we include the universal approximation from Barron [27], it is frequently used in the later constructive proof for state-space models.

Theorem B.1 (Cybenko [28], Barron [27]) . For any continous function f : R d → R and compact set K ⊆ R d . Assume the activation function σ : R → R is bounded and sigmoidal:

For any ϵ > 0 , there exists m ∈ N , A ∈ R m × d , b ∈ R k , C ∈ R m × k such that

B.2 Proof for Proposition 3.1

Proof. Fix the bounded continuous function f .

For any ϵ > 0 , according to the universal approximation theorem in Theorem B.1, there exists U 1 , U 2 , b 1 such that

Take W 1 = W 2 = b 2 = 0 , the two-layer state-space model can approximate element-wise continuous functions. (Here the element-wise function mean the sequences that for each k , y k only depends on x k .)

B.3 Proof for Proposition 3.2

Proof. The original statement is given in the discrete index. We prove the result for the continuous index and the discrete case can be derived by discretization.

Without loss of generality, assume the input output sequence are all one-dimensional. Otherwise we shall stacking the C, W, U for different input-output channels.

Since the input and output are one-dimensional, we know c, u are vectors and W is a square matrix. To approximate the target convolution:

Since the prediction error can be decomposed into following form

Approximating the temporal convolution with state-space model over all bounded inputs x can be reduced to function approximating problem:

In other words, approximating a convolution layer with state-space model is equivalent to approximating a general integrable function by function with exponential form ˆ ρ s = ∑ m i =1 c i e -λ i s .

where by state-space model

By change of variable, we have

+

Φ(

C

3

W

T

3

-

p

U

3

ˆ

ϕ

Here f ( τ ) = ρ -log( τ ) . Since polynomials are universal approximators on compact intervals, we know there exists c i , λ i such that the aforementioned inequality is satisfied. (For example, if f is smooth, we can take the Taylor expansion of function f .)

B.4 Proof for Proposition 3.6

Proof. Our proof is based on Equation (18), for any sequence relationship H : { x k } T k =1 →{ y k } T k =1 , we need to approximate ϕ and Φ , and subsequently approximate the representation prescribed by the Kolmogorov-Arnold theorem.

Fix tolerance ϵ .

As is shown in Figure 3, the first element-wise function ϕ ( · ) can be approximated by two-layer state-space model. This is a result from the direct application of Proposition 3.1. In math terms, there exists U 1 , U 2 , b 1 such that two-layer state-space model approximate function ϕ .

We shall denote U 2 σ ( U 1 x + b 1 ) by ˆ ϕ ( x ) .

Next, according to Proposition 3.2, we know the (temporal) convolution can be approximated via single-layer state-space model. There exists weights C 3 , W 3 , U 3 such that

The last layer is again an element-wise function Φ( · ) , which can be approximate by two-layer state-space model with weights U 4 , U 5 , b 4 . (Figure 3)

Based on the above result, without loss of generality we assume the outer function Φ is Lipschitz continuous with coefficient L , then the final approximation error is bounded by L ∥ ρ ∥ L 1 ϵ + Lϵ + ϵ .

∥

∥

∥

∥

∥

T

∑

p

=1

T

∑

p

=1

∥

∥

∥

∥

To summarize, we achieve the approximation of general nonlinear sequence-to-sequence relationship with representation (with Lipschitz continuous Φ ) via five-layer state-space model.

Since the Lipscthiz continuous function is dense in the set of continuous function, therefore the universal approximation can be generalized to the representation with Φ not necessarily Lipschitz continuous.

∥

(

x

p

+

qa

))

-

U

5

(

U

4

(

C

3

W

T

3

-

p

U

3

ˆ

ϕ

(

x

p

+

qa

)) +

b

4

)

(56)

B.5 Proof for Proposition 3.9

Proof. For simplicity, we will only present the approximation of an n -th order component of the Volterra Series. The general approximation of nonlinear sequence-to-sequence relationship can be achieved by approximating different order component separately and taking the linear combination.

Consider the target functional

The state-space model's n -th order term can be represented by

It can be seen the kernel function of state-space model is ˆ h n ( τ 1 , . . . , τ n ) = ∑ m i =1 ∏ n j =1 ˆ h ( m ) j ( τ j ) while the original n -th order kernel is multi-variable function h n ( τ 1 , . . . , τ n ) . For any tolerance ϵ , there exists a sufficiently large hidden dimension m such that the multi-variable function is approximated by the single-variable function's product:

For example, we may consider ˆ h n to be polynomial of τ j and take the Taylor expansion of kernel h n .

Remark B.2 . While the aforementioned proof for approximation is provided through a polynomial method, it's commonly accepted that polynomials may not be the most efficient means to parameterize kernel functions. Consequently, a variety of techniques have been empirically investigated to represent convolutional layers [22].

B.6 Proof for Proposition 3.11

Proof. As x t converges to x ∗ exponentially and ρ is integrable, we know the limit of y t exists

Here ρ s = C ⊤ e Ws U, s ≥ 0 is the memory function for (continuous) state-space model.

By the dominated convergence theorem, as ρ is integrable and e c 0 t | x t -s -x ∗ | is a bounded sequence,

B.7 Proof for Proposition 3.12

Proof. Since lim t →∞ x t = x ∗ , by continuity of the activation function σ ( · )

Hereafter we define y ∗ = σ ( x ∗ ) .

Since σ is Lipschitz continuous, let L be its Lipschitz constant

The Lipschitz continuity is a weak assumption that most of the activations such as ReLU, GeLU, tanh, hardtanh satisfy.

C Limitations

Theoretical results on approximation do not have quantitative results. Therefore it is not easy to directly compare the efficiency of different types of models over a specific task. The good news is that the general memory function servers as a guideline in constructing models. Take the Hyena [12] architecture as an example, as the implicit representation of convolution kernel is utilized in the network, Hyena is not a recurrent model. If we replace the convolution layer by state-space model, we can 'translate' a non-recurrent neural network into a recurrent neural network without sacrificing the approximation capacity . The main advantage of recurrent networks, compared with implicit convolution form, lies in the lower inference memory cost.

This study primarily explores the qualitative attributes of the state space model within the context of approximation theory. To better delineate it from other architectures like linear transformers, a more in-depth investigation into the rate of approximation is necessary.

D Comparisons between RNNs, SSMs and S4

In Table 2, we compare different recurrent models in terms of the recurrence, universality, temporal parallel and the memory decay speed.

Our core findings are established for SSM; however, we argue that they are applicable to S4 as well. The primary differences between the vanilla state-space models (SSMs) and S4 involve model parameterisation, weight initialisation, discretisation, normalisation, dropout, and residual connections. The model architectures of SSMs and S4 are almost identical, as both alternately stack linear RNNs and nonlinear activation layers. Therefore, in terms of universal approximation, the approximation capacities of both SSMs and S4 are equivalent.

E Further discussion on the two proofs for universality of SSMs

We provided comparison between the two proof methods: An analogy between Kolmogorov-theorem and classical fully-connected neural networks can be drawn because of the finite number of layers in both. It is shown in Eldan and Shamir [29] that a simple function expressible by a small 3-layer feedforward neural networks cannot be approximated to a certain accuracy unless the network's width is exponential in the dimension. In contrast, Volterra-Series shares similarities with deep learning, and as a result, the advantages of deep learning over classical fully-connected neural networks carry over

to this approach. The authors are inclined to consider Volterra-Series based construction as relatively superior, and increasing the depth to be a more efficient way to scale up the model.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper provides a constructive proof that state-space models (SSMs) are universal approximators of sequence-to-sequence mappings.\nMoreover, it shows that SSMs (and even empirically S4) suffer from exponentially decaying memory just like standard RNNs.\n\nSTRENGTHS:\nUp to my knowledge this is the first (constructive) proof that SSMs are universal. I find it in particular interesting that SSMs also suffer from exponentially decaying memory (given the provided definition of such).\n\nWEAKNESSES:\nRegrettably, the paper exhibits a significant lack of quality in its writing, containing numerous grammatical errors and typos. It is imperative that it undergoes a comprehensive proofreading process to address these issues.\n\nFrom my understanding, the paper proves universality for SSMs, which does not include universality for S4 (i.e., SSMs with specific structure of the matrices). This is a major limitation, as in practice no one uses simple SSMs, but only S4. Can S4 be included in the proof? I presume one has to show that also S4 can approximate element-wise functions up to any precision.\n\nThe section about the curse of memory is very hard to follow. Can you please rewrite it and properly introduce the concept of memory functions?\n\nThe paper is not rigorously written. For instance, it would be much more readable, if the authors would define every variable, e.g., $W \\in \\mathbb{R}^{m\\times m}$ and so on. This would also help the authors avoid using variables that haven't been introduced before.\n\nThe provided full paper in the appendix and the main paper differ: for instance in equation 9: $\\mathbf{H}$ depends on $t$ in the full paper, but not in the main paper. \n\nForm what I understood, the universality proof of proposition 3.6 approximates functions, where the target value at every index depends on all elements in the full input sequence. However, this is not realistic, as mainly causal operators between sequences have to be learned, i.e., operators that are independent of the future values of the input sequence at every index. Can you please change the proof accordingly?\n\nQUESTIONS:\nSee weaknesses\n\nLIMITATIONS:\nThe paper provides an interesting and important proof that SSMs are universal, as well as that the memory functions decay exponentially. However, the proof does not include S4 models. Moreover, the quality of writing is very poor, which makes it hard to follow. Overall, the provided proof is very simple, which makes it appealing.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-06"}

comments: SUMMARY:
This paper attempts to show several properties of SSMs: a) SSMs can approximate element-wise functions and temporal convolutions b) Universality of SSMs c) Exponential memory decay. The authors also show experiments of SSM's exponential memory decay and compare them against variants of RNN architectures.

STRENGTHS:
* Thorough background section and clear introduction of the RNN and SMM architecture.

* Clear writing.

* The usage of the Kolmogorov-Arnold thoerem and Volterra series is interesting.

WEAKNESSES:
* My main concern is most of the main results seems trivial: When taking away the tricks that makes SSMs work such as smarter initialization and diagonal parameterisation, architecture wise, SSMs are simply an RNN without non-linearly between hidden states. Hence, the theory results (i.e. proposition 3.1, 3.2, 3.12 and theorem 3.13) seems to transfer very trivially from RNNs.

*  The 2 formulations for showing universality of SMMs in section 3.2 seems to deviate greatly from the SSM architecture (i.e. figure 3 and 4 does not follow the definition of SSMs in equation 1 and 2). It is unclear how much the result transfers for standard SSMs used in practice.

* In figure 5 and 6 there are no error bars or mentioning of number of seeds.

QUESTIONS:
Authors may address my comments above.

LIMITATIONS:
N/A
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 2
DATE: 2023-07-06

comments: SUMMARY:
This paper analyzes properties of state space models (SSMs) and verifies the analytic results with numerical simulations.

The primary result is that SSMs have the same basic properties as classic RNNs.  They perform temporal convolution on their inputs, with exponentially decaying memory and are universal function approximators.

STRENGTHS:
My overall assessment is that this paper is an important contribution to our understanding of SSMs.  It raises really important questions about how SSMs are apparently able to learn long-range dependencies and points to the generality of exponentially-decaying memory.  

The exposition was pretty clear; although the math is challenging for a broad audience, the simulations give confidence that the results are sound.

WEAKNESSES:
It's worth thinking more about presentation of the figures.  Figure 4 was pretty helpful but Figure 3 was pretty baffling.   Generally speaking my suggestion is that the captions could be more explicit and all of the terms in the expressions should appear in the figures.

The paper raises a really important question that should be addressed more explicitly.  If SSMs have basically the same properties as generic RNNs, why do they apparently work so much better?  I appreciate that it may not be possible to answer this question with certainty, but some thoughtful discussion would really enhance the impact of this paper.

QUESTIONS:
Why do SSMs work well empirically?  Is it just that they more easily find long time constants in their exponential decay?   I think it's really important to say something substantive about this.

LIMITATIONS:
Why do SSMs work well?
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-07-06

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe authors set out to analyze state space models, which have been gaining popularity as alternatives to transformer based systems that can better model long range dependencies and are more computationally efficient. Since such models do not utilize a non-linear activation function along the temporal access, it is important to analyze if this poses a restriction to their modeling capabilities. The paper provides a construction-based argument to prove that as long as there are layer-wise nonlinearities in the model, it becomes a universal approximator for any sequence model and thus does not require activation functions in the temporal domain to improve model capacity. Further, the authors also show that like the earlier recurrent networks (RNN, GRU, etc.), these models also suffer from an exponentially decaying memory.\n\nWhile the paper tackles quite a relevant topic on a family of models that are becoming widely popular, the draft itself could use some work. In particular, the presentation and clarity of the work needs to be improved, and it would be very helpful to also get some intuition behind the propositions mentioned and proved. That is, to understand what the propositions imply and why they are important.\n\nSTRENGTHS:\n- The authors show that the state space models (SSMs) which have no non-linearity in their temporal axis can still universally approximate any sequential mapping up to some arbitrary error. This is proved by construction.\n- The authors also show that like RNNs, such models also suffer from the exponential memory decay problem.\n- Some preliminary numerical experiments are conducted to test the memory decay problem across different recurrent models.\n\nWEAKNESSES:\n- The writing of the draft can be substantially improved. It would be good to include some explanations into the implications of each proposition and theorem, as to understand why exactly it is meaningful and important. The plots are currently taking a lot of extra space which can be freed to add this content.\n- It would be nice if the authors could provide some kind of rates of memory decay to better understand if it is better or worse in SSMs than other RNN-based methodologies.\n\nQUESTIONS:\n- Line 48: Why is this relationship nonlinear? It looks like a linear function of $x$.\n- Line 83: Does the definition of $\\hat{\\rho}_t$ involve $t$ in the exponential or $(t-s)$ which is written in the draft (mistakingly, I believe?)\n- Could the authors provide some clarification and their reasoning on their construction of the memory function? Why is this reasonable? How is this computed?\n- For universality results in Section 3.3, could the authors provide some intuition behind Remark 3.4, what it implies and how is it achieved?\n- Is there a difference in some assumptions between Kolmogorov-theorem based construction with Volterra-Series based construction? Is the latter always superior? What cost does it come with?\n\nLIMITATIONS:\nThe authors have adequately addressed the limitations.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-06"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper presents universal approximation results for state-space models (SSM) with layer-wise nonlinearity. In particular, two-layer SSMs with layer-wise nonlinearity can approximate any continuous function over a compact set. Moreover, SSMs can approximate elementwise function and convolution. The paper also characterizes the memory behavior of SSMs, showing that their memory still decays exponentially when the eigenvalues of the A matrix is bounded from 1. These theoretical results are validated with numerical experiments.\n\nSTRENGTHS:\n1. Universal approximation results are helpful to theoretically characterize the expressive power of SSMs. These models are becoming more popular and these results are not yet known to the best of my knowledge. Consequently the paper could help better understand these models.\n\n2. The presentation is quite clear. Even though this paper is theory-heavy, the main proof ideas are summarized in the main paper. This helps readers understand the technical challenges and the idea of the approach.\n\nWEAKNESSES:\n1. Lacking connection to linear RNNs. SSMs are a special case of linear RNNs, and universal approximation results of linear RNNs are available. Moreover, one can show that almost any linear RNNs can be written as SSMs (e.g. Sec 2.2 of Gupta et al. 2022). This is simply because almost any matrix A can be diagonalized, and put into RNNs. Could the university approximation results of linear RNNs be used to prove university approximation results of SSM through this connection?\n\n2. Lack of applications, or a direction to help with applications. While the theoretical results could help with the understanding of these models, the paper does not point out potentially applications of these theoretical results. This might limit the significance of these results.\n\n\n[1] Simplifying and Understanding State Space Models with Diagonal Linear RNNs. Ankit Gupta, Harsh Mehta, Jonathan Berant. 2022.\n\nQUESTIONS:\n1. What are the dimensions of input/output of the SSMs? The notation is unclear on this.\n2. Eq (9): What's H(x_test). Why is rho_hat defined this way?\nMore generally I don't understand this section.\n3. Why does the paper focus on approximation results for elementwise function and convolution?\nElementwise function has no recurrent so it's all about the layer-wise non-linearity?\n4. I don't understand Prop 3.12. Is it the same constant c0?\n\nLIMITATIONS:\nNot necessary.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-12"}