{'fraction_non_alphanumeric': 0.03781604184829991, 'fraction_numerical': 0.009699215344376635, 'mean_word_length': 4.408447937131631, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A local Echo State Property through the largest Lyapunov exponent

Echo State Networks are efficient time-series predictors, which highly depend on the value of the spectral radius of the reservoir connectivity matrix. Based on recent results on the mean field theory of driven random recurrent neural networks, enabling the computation of the largest Lyapunov exponent of an ESN, we develop a cheap algorithm to establish a local and operational version of the Echo State Property.


Introduction
Echo State Networks (ESN) are neural networks designed for performing complex non-linear regression or classification tasks, such as non-linear time-series forecasting [1,2]. As an instance of a more general framework called reservoir computing [3], the ESN architecture is based on a randomly connected recurrent neural network, called reservoir, which is driven by a temporal input. The state of the reservoir is a rich representation of the history of the inputs [4], so that a simple linear combination of the reservoir neurons is often a good predictor of the future of the inputs. The computation of the output connections can be done explicitly and corresponds to the minimization of the relative entropy between the network and the inputs dynamics [5], for which the associated gradient descent may be implemented with biologically plausible learning rules [6].
In this paper, we focus on the input-driven reservoir, which may be governed by a variety of dynamical systems beyond random neural networks [7], provided they produce consistent reservoir dynamics for a given input. This condition is of primary importance since its violation systematically leads to irrelevant results. In the original paper [1], Jaeger has given a condition, which he names Echo State Property (ESP), guaranteeing that the network states are consistent. This definition of the ESP and the equivalent formulations manipulate left infinite input time-series assuming that the initial condition occurs at t = −∞. If n is the number of neurons in the reservoir, x(t) ∈ R n is the state of the reservoir at time t ∈ Z and u(t) ∈ R is the input to the reservoir of time t ∈ Z. The ESP definition can be summarized as In other words, it means that the initial condition of the network (at t = −∞) does not influence the trajectory of the states, which corresponds to the property that the input-driven network has a unique global attractor [8]. The ESP seems to be important in practice to design efficient reservoirs. Indeed, a network without ESP would have a poor accuracy in the inevitable presence of perturbations or noise: a small perturbation could bring the network to states it has never seen before, destroying the prediction capabilities of the network. Put differently, the network has to have some fading memory so that the initial conditions and perturbations do not impact the accuracy in the long term.
A fundamental result is that a bound on the maximum singular value η of the network connectivity matrix J ∈ R n×n can provide the global ESP for every input. More specifically, if the dynamics of the network is governed by where m ∈ R n is the input matrix, and S(.) is a sigmoid function with unit slope at the origin, then the following result holds: ). If η < 1, then the global ESP holds for every input.
It is important to observe that the sufficient condition in 1.1 holds for the largest singular value η and not for the largest eigenvalue modulus ρ (also called spectral radius), which are different for most matrices. Indeed, as pointed out in [9], the theory of random matrices gives a relationship between the maximum singular value η and the maximum eigenvalue ρ of the random matrix J when the number of neurons tends to infinity. First, using recent results on the empirical spectral distribution of random matrices [10], one can show that large random matrices, whose entries are i.i.d. random variables with mean 0, finite variance σ 2 √ n , have eigenvalues which tend to cover uniformly the disk of radius σ as the number of neurons tends to infinity. For these matrices, the non-scaled standard deviation of the weights σ is in fact equal to the spectral radius ρ. Second, one can use results concerning the right edge of the Marchenko-Pastur convergence [11,12,13] to show that η → 2σ when the number of neurons tends to infinity. From this result, as mentioned in [9], it is clear that the condition on the singular values translates to Theorem 1.2. When the number of neurons tends to infinity (and with the appropriate scaling of the weights variance by 1 √ n ) the ESP holds for all inputs if ρ = σ < 1/2.
Interestingly, there is here a clear gap between the theoretical sufficient condition η < 1 (i.e σ < 1/2) and the condition ρ < 1 (i.e σ < 1) which seems to be valid in practice [14]. Based on the notion of structured singular value and on concepts from control theory [15], a tighter sufficient condition has been derived involving the computation of the infimum of the maximal singular values of the connectivity matrix for variety of underlying norms [16]. Despite its improvement over the classical singular value, this criterion is difficult to compute in practice, remains poorly understood from the point of view of random matrix theory, and does not respond to the problem of finding a criterion which depends on input, as we will discuss below. It is also interesting to mention the recent work [9], where the concentration of measure phenomenon [17] is used to prove that: ). If ρ < 1 − , then for any x,x ∈ R n , the probability that ||G(x, t) − G(x, t)|| > ||x −x|| is exponentially small when the number of neurons is large.
This result may seem sufficient to prove the contraction property with high probability, implying the ESP when σ < 1 with high probability. Actually, one must be careful because this result does not imply that P[∀x,x ∈ R n , ∀t > 0, ||G(x, t) − G(x, t)|| > ||x −x||] is small with high probability, which is a much stronger result. However, the authors claim that their result shows why choosing σ close but smaller than one is sufficient in practice. In a sense, they argue that networks which do not verify criterion of Theorem 1.1 can still perform well in applications.
On the other side, it is also instructive to look for a necessary condition for the ESP. When the spectral radius ρ is larger than one, then the trivial null equilibrium of the system with zero input is linearly unstable, and Jaeger has shown that: This result is in fact related to the existence of chaotic attractors as shown in [18]. Therefore, there is no hope for an ESP for all inputs beyond ρ = 1. However, in practice [14], it may be important to increase ρ above 1 to improve the ESN performance (to increase the memory for instance). If we want to go beyond ρ = 1, we need to drop the requirement to have the ESP for all inputs. It has recently been argued that one can define an ESP with respect to a particular input (or a set of inputs) [19]. Intuitively, this means that a network driven by an input will not display excessive irregularity if it has the ESP with respect to that input. In [19], a bound for the ESP is also provided with C i the smallest absolute component of the vector mu(i) and I is the indicator function, then the network has the ESP with respect to u.
Intuitively, this bound plays with the saturation of the sigmoid and will be efficient if the inputs are strong enough to drive the network in the saturating regime. Although this is a loose bound, it has the interesting property that the network may have temporarily non-contracting dynamics and still have the ESP. These ideas are clearly related to the fact that stimulating a chaotic system can result in a synchronized non-chaotic response, as shown in the context of random neural networks in [20].
In this paper, we aim at contributing to the debate about the ESP using a mean-field approach applied to non-autonomous random neural networks in the large n limit. This theory derives a self-consistent statistical description of the reservoir dynamics unravelling the transition between regularity and irregularity in the network, based on a Lyapunov stability analysis. Although brought very recently into the field of echo-state networks by [21], this theoretical approach has a long history, dating back to early works on spin-glass models [22,23], followed by applications to random neural networks dynamics as in [18,24,25,26]. The rigorous justification of this heuristic approach is non-trivial and has been resolved by [27,28,29] using large deviations techniques. These mathematical results actually requires to add an (arbitrary) small white-noise perturbation to the reservoir dynamics, in order to be able to use a change of probability formula (e.g. Girsanov Theorem) which is at the heart of the large deviation proof. The rigorous proof of the mean-field equations when this additional noise is removed remains open to our knowledge, but this is not a real problem in the ESN framework since adding such noise term is actually used in practice as a form of regularization, shown to be equivalent to the classical Tikhonov regularization [30].
The network we consider in this paper is a leaky integrator ESN [31] defined over a regular graph with degree αn, proportional to n. This means that every neuron in the network is only connected to αn other neurons, which is often used in practice to reduce computational complexity. To apply the mean-field theory, we will assume that n goes to infinity, but consider α ∈ (0, 1] to be a constant. The connections between neurons are weighted: we write J ij the weight from neuron j to neuron i. The weights are independent random variables satisfying: This quenched hypothesis excludes any dynamics on the weights: they are kept constant after having been randomly drawn. Given a one-dimensional input time series u : {1 · · · T } → R, the classical neural network discrete dynamics is where x(t) ∈ R n corresponds to the activity of all the neurons in the network at time t. The vector of feedforward connections m ∈ R n is made of i.i.d. random variables satisfying E(m i ) = 0, E(m 2 i ) = m 2 . The numbers l and τ are in [0, 1] and control the timescale of the ESN dynamics. The function S(.) is a typical odd sigmoid with S(0) = 0, S (0) = 1, S (x) > 0 and xS (x) ≤ 0. Note that it implies it is a 1-Lipschitz function. Actually, the following computations become explicit when a particular choice is made: x) (which follows the requirements above). We write j→i the summation of incoming information to a neuron which is only done over the neurons which are connected (through the graph) to the considered neuron. The paper is organized as follows: in section 2, we derive a mean field theory of driven leaky integrator recurrent neural networks (RNNs) on a regular graph, and we show how it can be used to find the frontier between order and disorder for the network dynamics. Then, in section 3 we show how this can be used to define a computable condition guaranteeing an operational version of the ESP.

Mean-field equations
From the seminal work [18], recently extended to the framework of stimulus driven RNN [20,21], one can derive a self-consistent equation describing the statistical properties of the reservoir activity in the large n limit, which is known as the mean-field theory. In this section, we present an extension of [21] to leaky RNNs on regular graphs.
The key idea is to make the assumption that the variables x i (t) are i.i.d. and independent of J and m. This makes possible to use the central limit theorem on j→i J ij x j (t) which can thus be considered as a Gaussian process. When k = αn → +∞, all the a i (t) = j→i J ij x j (t) + m i u(t) for i ∈ {1..n} tend to behave as centered Gaussian variables with variance is going to help us derive the mean-field dynamical system describing the variance of the x i . However, the independence between x i (t) and S(a i (t)) is not granted and we cannot simply add their variance. Nonetheless, we can compute according to the technical result in the appendix of [32], and where Using again the result in [32], we can show that The recursive combination of equations (3), (5) and (8) provides a consistent description of the global variance of the neurons. An algorithm is provided in algorithm 1.

Order-disorder transition
The consistency equation (3) characterizes the transition between order and disorder in the network as a function of the variance of the connections σ 2 and the sparsity coefficient α. We first illustrate this phenomenon in the autonomous case and then discuss its impact in the input driven case.

Without input
the terms x i (t) and S(a i (t)) are independent, and the third term in (3) disappears. Thus, let us study the autonomous dynamical system γ 2 (t+1) = (1−lτ ) 2 γ 2 (t)+τ 2 F ασ 2 γ 2 (t) . Due to the properties of the sigmoid function S, the function F is increasing, concave and satisfies F (0) = 0 and F (0) = 1. Therefore, the function Ψ : is also increasing and concave. Therefore, the slope at 0, denoted µ = Ψ (0), is the effective parameter controlling the phase transition, and is given by This leads to a simple characterization of the behavior of the system for different values of µ: In the first situation σ < σ * = l α ( 2 τ − l), all neuron variables converge to the quiescent state, whereas the network behavior becomes irregular as soon as σ > σ * . Note that this generalizes the classical results of [18,24] dealing with the case τ = α = l = 1, a case which is also treated in [33], where stability criteria are established for dynamical systems defining recurrent kernels for infinite-dimensional ESN.

With inputs, largest Lyapunov exponent
When the system is driven by external inputs, the network will never go to a quiescent state. Indeed, it is clear from equation (3) that the situation γ 2 (t) = 0 will never happen. But one should not conclude that the network is always disordered because it could be strongly locked to the inputs, which is another way of defining the notion of order in such systems. The network will be said to be in order (resp. disorder) when a small perturbation independent of the inputs will vanish (rep. grow) with time. This corresponds to the notion of Lyapunov stability for the input driven system. The largest Lyapunov is below 1 in the case of robustness of the dynamics to small perturbations (order), and above 1 when the dynamics is significantly impacted by small perturbations, as is the case in chaotic systems (disorder). Formally, the largest lyapunov exponent can be defined as: where δ(t) is a distance at time t between two trajectories of (2) starting with different initial conditions separated by δ(0). More precisely, let us define δ(t) such that x i (t) − x i (t) ∼ N where x i and x i are two solutions of (2) starting from two different initial conditions with In the situation where δ(t) is small, we have the following recurrence equation: Therefore, one obtains the following relationship on the variances: When γ 2 (t) is obtained by solving iteratively (3), one can find the local Lyapunov exponent: When λ(t)[u] < 1, local asymptotic stability is ensured and the reservoir tends to be synchronized by the input, whereas when λ(t)[u] > 1, small perturbations are exponentially amplified and the reservoir is likely to enter a chaotic regime. It is natural that this measure depends on time because, for instance in the case σ > 1, synchronized states will only appear during periods when the input is sufficiently large compared to σ.
Combining (10) and (11), one can define a global finite horizon largest Lyapunov exponent as: where λ(t) is defined in (13). Furthermore, at this stage, one already obtains an important property, showing that adding external input can only stabilize the system. Indeed, since Φ ≤ 1 (due to the fact that |S | ≤ 1), we always have the following inequality: Therefore, if the system without external input is in the ordered phase, namely when µ < 1, then it is also in the ordered phase (λ T [u] < 1) for all input. This results supports the fact that, in practice, ρ < 1 is a sufficient condition for the ESP.
In figure 1, we have applied algorithm 1 to estimate Λ T in the case where u(t) = 0 (left) and where u(t) = sin(ωt) (right) for various values of parameters σ and τ . In this figure, one observes that Λ T is an increasing function of σ, which is a consequence of the fact that both γ(t) and λ(t) are increasing functions of σ, and corresponds with the intuition that increasing the disorder level would increase the unstability of the dynamics. The case of null input (left) with τ = 1 corresponds to the classical case [25], and displays a kink at σ = 1, whose consequences in terms of information processing has been discussed in [34]. However, the impact of the leak rate τ on the Lyapunov exponent has not been studied so far to our knowledge, and reveals an interesting U-shaped behavior indicating that there exists an optimal intermediate value of τ which minimizes the instability of the system. Our purpose in the present paper is to evaluate the Lyapunov exponent when the system is driven by an external time-series, which is displayed on the right panel of figure 1 with u(t) = sin(ωt). This figure shows that the overall behavior is similar to the null-input case, with the expected difference that σ must be set much larger than one (around 1.6 when τ = 1) to observe an exponent Λ T > 1. Intuitively, the driven system is more stable because the input acts as a time-dependent bias in the sigmoid transfer function, hence reducing its average slope |S | along a trajectory, and therefore the norm of the Jacobian matrix which controls the local expansion rate. Notice that the quantity Φ defined in (12) corresponds to the average squared slope of S, where the average will be taken with respect to the Gaussian distribution with appropriate time-dependent variance (13).

Local Echo State Property
In this section, we discuss in more details the connection between the Lyapunov exponent Λ T and the ESP.

Definition
The intuition behind the ESP is that the network should follow a reproducible and robust attractor. If the attractor is not stable, then the output connectivity matrix would be learned on a trajectory which could be different from the trajectory observed during the prediction or test phase, leading to poor accuracy. A key element to quantify the stability of the network trajectory is to measure the impact of small perturbations. If these perturbations are amplified over time then the dynamics is too irregular for good performance, the network is chaotic. Therefore, we define a local version of the ESP which guarantees the robustness of the dynamics to perturbations: Definition 3.1 (Local ESP). A driven dynamical system has the local Echo State Property if a small perturbationx(t 0 ) = x(t 0 ) + δ applied at time t 0 decreases to 0 in the large time asymptotic limit, namely ||x(t) −x(t)|| → 0 when t → ∞ for δ sufficiently small. This definition differs from the traditional ESP Definition 1.1 in two aspects: first, it deals with perturbations which do no necessarily occur at time t = −∞. This definition only asks the perturbed solution to converge eventually towards the unperturbed solution, whereas the traditional definition asks that the solutions are identical based on the fact that the perturbation occurred an infinite number of time steps before. This definition is closer to the practical application of ESN where the initial condition corresponds to t = 0. Second, this definition only guarantees a local stability of the trajectories asking them to be robust only to small enough perturbations. On the other hand the traditional ESP requires that even large perturbations leave the trajectory unchanged. Put differently the traditional ESP guarantees a unique globally stable attractor, whereas the local ESP guarantees local stability of possibly many attractors (which have the same statistical properties).
We claim that the local ESP is sufficient for the good behavior of the network for most applications. More precisely, the only danger for systems that satisfy the local ESP, and not the traditional global ESP, is when learning is made on one attractor and prediction / test is made on another. In applications, if prediction / test is made immediately after learning such that we are sure to stay on the same attractor, then the local ESP is sufficient. On the other hand, if the initialization of the prediction / test phase is done randomly, then the network may converge to a different attractor than that explored during learning. In that case, one would expect the performance to be poor.

Characterization
Measuring the evolution of small perturbations precisely corresponds to computing the largest Lyapunov exponent. Indeed, if λ < 1 then a small perturbation will eventually vanish and the perturbed solution will converge to the unperturbed solution. Therefore, by construction we have the following quantitative criterion for the local ESP: Theorem 3.1. If λ[u] < 1 then the network has the local ESP for the input u.
Some remarks: • The local ESP can be valid for systems experiencing temporary growth of perturbations as long as they are followed by a more important decrease. What matters in the definition of the local ESP is the balance of growth and decrease over a long time.
• From the key inequality (15), we deduce that the local ESP hold for all inputs whenever µ < 1. This is a further argument supporting the practical criterion of a spectral radius below 1 should work for all inputs.

Numerical experiments
We now present an algorithm to compute λ [u]. A dichotomy algorithm, or any zero search algorithm for non-linear functions, could be implemented to find an approximation of σ L , but given the cheap computational cost of computing λ[u] for any σ, we will rather perform a grid search in this paper.
The algorithm to compute λ T [u] is stated below, when σ, m, α, l, τ and u have been fixed. Note that this algorithm is computationally cheap, in O(T ), a ← ασ 2 γ 2 + m 2 u(t) 2 10: To show on a numerical example that the local ESP guarantees good accuracy, we have computed the prediction performance for a prediction task. More precisely, we consider here the classical task of Mackey-Glass (MG) time-series prediction. The MG dynamical system [35] is given by the following delayed differential equation: For each time-series, the task is to predict u(t + 1) (one-step ahead) given the past u(1), .
where w ∈ R n was computed with the usual Wiener-Hopf solution: w = x(t)u(t + 1) . We see that even for some σ > 1 the accuracy is good although the global ESP for all inputs is not satisfied any more. However, the accuracy becomes significantly poorer after a certain critical value for σ. In figure 2 (bottom), we have plotted the value of the Lyapunov exponent Λ T computed with the algorithm above. We see that it crosses 1 quite precisely at a critical value σ * for which the accuracy moves to a regime of much higher values.
In order to further investigate the link between the local Lyapunov exponent Λ T and ESN performance, we have generated several discrete time-series corresponding to various values of δ M G ∈ {10, 12, 14, 16, 18, 20, 22} with parameters a = 0.2 and b = 0.1. In figure 3 (right), ESN performance is measured by the Mean Square Error on a testing set and is displayed as a function of the variance parameter σ, for various values of the delay δ M G . Good performance is typically achieved for an intermediate range of values of σ, and one observes that the upper value of this range is smaller for higher values of δ M G , as indicated by the black arrow. We interpret this loss of performance for high values of σ as related to the loss of the ESP. If this is indeed the case, then it should be possible to predict this behavior by using Algorithm 1 to compute σ * , the value of σ for which local Lyapunov exponent Λ T becomes larger than 1. As displayed in figure 3 (left), σ * is a decreasing function of δ M G , which is perfectly consistent with the above observation. This numerical example illustrates that the proposed theoretical advance presented in this article helps predicting and understanding the behavior of the performance curve for Echo-State Networks. However, finding the optimal value of all the hyper-parameters, beyond a systematic cross-validation procedure, remains a challenging theoretical problem.

Conclusion
In this paper, we have shown that the mean field theory for ESN developed in [21] can be, first, extended to leaky integrator networks on regular graphs; and, second, used to compute accurately a condition for the local ESP corresponding to the edge of chaos. We argue that the local ESP with respect to the given input is the useful condition to check in many applications, to ensure that the ESN representation is stable to small perturbations. We do not claim that the edge of chaos is always the best regime, but it has been shown that for some applications, typically requiring a lot of memory, it was optimal [36]. We believe that the proposed method to assess the local ESP should be systematically used to make sure the ESN has a regular dynamics leading to good accuracy. However, finding the optimal values of the hyper-parameters (e.g. σ, τ, α etc.) for a given supervised learning task necessitates to take into account both the input and the target, which goes beyond the scope of the present approach : we provide a method to compute a bound for these parameters, given the input time-series, to ensure the ESP.
The theory has only been detailed for one dimensional inputs, but the extension of this approach to multidimensional inputs is not difficult (see [21]). Extending this method to other types of dynamics should be feasible as long as the computation of F and Φ can be numerically done or conveniently reformulated. Finally, the mean-field approach only deals with the limit of very large networks n → ∞, whereas in practice the aim might be to perform a given task with the smallest possible reservoir to avoid over-fitting issues. Therefore, a further investigation of the finite-size effects around the meanfield limit would be of interest. For instance, a related question has been studied in [37], where it is shown that networks with a variance parameter σ < 1 have a probability to be unstable which is maximal for a specific size of the reservoir.  Figure 3: Analysis of ESN performance as a function of the delay δ M G in the Mackey-Glass prediction task. Left: Using Algorithm 1, we were able to compute the value σ * of the weights variance for which Λ T becomes larger than 1, corresponding to the edge of chaos. The value of σ * depends on the delay parameter δ M G : it appears that increasing δ M G leads to a smaller value of σ * . Right: Mean-square error (testing set) as a function of the variance σ for the Mackey-Glass prediction task, for different values of the delay δ M G . This figure confirms the prediction made in the Left panel : as indicated by the black arrow, for higher values of δ M G , the value of σ where the performance starts to become poorer appears earlier. For the simulations the parameters of the MG system were a = 0.2, b = 0.1 with a time-step δt = 1 and the ESN parameters were n = 100, α = l = τ = 1, m = 1, for time-series of length T = 2000.