Solvable Neural Network Model for Input-Output Associations: Optimal
  Recall at the Onset of Chaos
In neural information processing, an input modulates neural dynamics to
generate a desired output.
  To unravel the dynamics and underlying neural connectivity enabling such
input-output association, we proposed an exactly soluble neural-network model
with a connectivity matrix explicitly consisting of inputs and required
outputs.
  An analytic form of the response upon the input is derived, whereas three
distinctive types of responses including chaotic dynamics as bifurcation
against input strength are obtained depending on the neural sensitivity and
number of inputs.
  Optimal performance is achieved at the onset of chaos, and the relevance of
the results to cognitive dynamics is discussed.
Tomoki Kurikawa, Kunihiko Kaneko
# Solvable Neural Network Model for Input-Output Associations: Optimal Recall at the Onset of Chaos

###### Abstract

In neural information processing, an input modulates neural dynamics to generate a desired output. To unravel the dynamics and underlying neural connectivity enabling such input-output association, we proposed an exactly soluble neural-network model with a connectivity matrix explicitly consisting of inputs and required outputs. An analytic form of the response upon the input is derived, whereas three distinctive types of responses including chaotic dynamics as bifurcation against input strength are obtained depending on the neural sensitivity and number of inputs. Optimal performance is achieved at the onset of chaos, and the relevance of the results to cognitive dynamics is discussed.

Neural systems exhibit rich dynamics generated by strong recurrent connections[1]. For performing cognitive tasks in neural systems, sensory inputs modulate the neural dynamics to generate specific output patterns resulting in suitable behaviors. In the association task between the input signals and output choices, for instance, the signal modifies ongoing (spontaneous) neural dynamics, leading to the emergence of an appropriate attractor that guides the correct choice[2; 3], as strongly contrasted with input-output transformation in feed-forward networks[4; 5] Unveiling the mechanisms behind such modulation and the type of connectivity relevant to it is essential for understanding information processing in neural systems.

One widespread and powerful approach to understanding the information processing involves recurrent neural networks trained with machine learning techniques[2; 3; 6; 7; 8]. However, these trained networks are finely tuned for specific tasks, which masks the connectivity relevant to cognitive functions. There is a need for a simple model to bridge the gap between neural connectivity and neural dynamics in shaping the input/output transformations.

Another approach, the auto-associative memory model, offers network connectivity explicitly represented by memorized patterns, as pioneered in the Hopfield network [9; 10; 11]. In this approach, different fixed-point attractors correspond to distinct memorized patterns, to which neural states converge, depending on their initial states. Thus, neural dynamics themselves are not modulated by the input. The role of spontaneous dynamics without input and the connectivity underlying the change in the dynamics to produce the output remain to be elucidated.

In the present Letter, we propose a neural network model with a novel connectivity matrix designed to generate any memorized patterns when the associated inputs are applied with a certain strength. This connectivity is explicitly represented based on a set of input and output patterns. The recall to the input is given by the location of a fixed point for any strength of the input, which is analytically obtained in our model. Besides this fixed-point, a chaotic attractor also emerges depending on the input strength, the gain parameter, and the number of memorized patterns. We obtain the phase diagram on distinct recall behaviors against these parameters, which demonstrates that the highest performance in the recall is achieved at the onset of the chaos. Finally, computational roles of chaotic internal dynamics are discussed in possible relation to experimental observations.

We consider a neural network model composed of \(N\) neurons. The network is required to generate target patterns \(\mathbf{\xi^{\mu}}\) (\(\mu=1,2,,,,M\)) in response to input patterns \(\mathbf{\eta^{\mu}}\), where \(M=\alpha N\), and, \(\mathbf{\eta^{\mu}}\) and \(\mathbf{\xi^{\mu}}\) are \(N\)-element vertical vectors. Each element of these vectors takes a binary value (\(\pm 1\)) that is randomly generated according to the probability distribution \(P(\xi^{\mu}_{i}=\pm 1)=P(\eta^{\mu}_{i}=\pm 1)=1/2\). The neural activity \(x_{i}\) evolves according to the following equation:

\[\dot{x_{i}}=\tanh(\beta(\Sigma_{j}J_{ij}x_{j}+\gamma\eta^{\mu}_{i}))-x_{i}, \tag{1}\]

where \(\beta\) and \(\gamma\) are the gain of the activation function and the input strength, respectively.

To memorize input/output maps between \(\mathbf{\eta}\) and \(\mathbf{\xi}\), we have designed the connectivity matrix \(J\) that is composed of \(\mathbf{\eta}\) and \(\mathbf{\xi}\), in contrast to the Hopfield network that incorporates only \(\mathbf{\xi}\). Further, to mitigate the effects of
potential interference across memories that could impair recall performance[12; 13; 14], the designed connectivity is given with a pseudo-inverse matrix of the target-input matrix \(X\) as follows:

\[J= X\left(\begin{array}{cc}I&I\\ -I&-I\end{array}\right)X^{+} \tag{2}\] \[X= [\boldsymbol{\xi}^{\boldsymbol{1}},\boldsymbol{\xi}^{\boldsymbol {2}},\ldots,\boldsymbol{\xi}^{\boldsymbol{M}},\boldsymbol{\eta}^{\boldsymbol{1 }},\boldsymbol{\eta}^{\boldsymbol{2}},\ldots,\boldsymbol{\eta}^{\boldsymbol{M }}], \tag{3}\]

where \(I\) is an \(M\)-dimensional identity matrix, \(X\) is an \((N,2M)\)-matrix and \(X^{+}\triangleq(X^{T}X)^{-1}X^{T}\) is a pseudo-inverse matrix of \(X\), where \(X^{T}\) is a transpose matrix of \(X\). Due to the pseudo-inverse matrix, \(J\boldsymbol{\xi}^{\boldsymbol{\mu}}+\gamma\boldsymbol{\eta}^{\boldsymbol{ \mu}}=\boldsymbol{\xi}^{\boldsymbol{\mu}}+(\gamma-1)\boldsymbol{\eta}^{ \boldsymbol{\mu}}\) and, consequently, the target \(\boldsymbol{\xi}^{\boldsymbol{\mu}}\) is a fixed point under \(\boldsymbol{\eta}^{\boldsymbol{\mu}}\) with \(\gamma=1\) for \(\beta\to\infty\), based on the properties of \(\tanh(\beta x)\). This property applies to all \(\mu\), indicating that all \(\boldsymbol{\xi}^{\boldsymbol{\mu}}\) are the fixed points under the corresponding inputs with \(\gamma=1\). In other words, all associations are successfully memorized in this model. To satisfy the pseudo-inverse matrix, however, the number of vectors, \(2M\), that are linearly independent of each other should be less than \(N\). As a consequence, at best, \(M=N/2\) associations are allowed and the memory capacity is bounded by \(\alpha=0.5\) at a maximum.

How does the network recall to the input except for \(\gamma=1\) and \(\beta\to\infty\)? We, now, derive an analytical form of a fixed point of the neural dynamics upon input for any value of \(\gamma\) with finite \(\beta\). For it, we consider \(x^{\text{fp}}(\gamma)=(a(\gamma)\boldsymbol{\xi}+b(\gamma)\boldsymbol{\eta})\) and derive \(a(\gamma)\) and \(b(\gamma)\) such that satisfy the fixed point condition for any \(\gamma\) as follows. Below, the superscript \(\mu\) is omitted for clarity unless otherwise noted since the result is not dependent on \(\mu\). By using \(J\boldsymbol{\xi}=J\boldsymbol{\eta}=\boldsymbol{\xi}-\boldsymbol{\eta}\), we have

\[Jx^{\text{fp}}=(a+b)(\boldsymbol{\xi}-\boldsymbol{\eta}), \tag{4}\]

and, subsequently, by substituting \(x^{\text{fp}}\) to \(\dot{x}=0\) in Eq. 1,

\[a\boldsymbol{\xi}+b\boldsymbol{\eta}=f((a+b)(\boldsymbol{\xi}-\boldsymbol{ \eta})+\gamma\boldsymbol{\eta}), \tag{5}\]

where \(f(x)=\tanh(\beta x)\). Considering \(i\)-th elements such that \(\xi_{i}\) equals \(\eta_{i}\), \(a+b=f(\gamma)\) should be satisfied and, similarly, by considering \(i\)-th elements such that \(\xi_{i}\) equals \(-\eta_{i}\), \(a-b=f(2(a+b)-\gamma)\) should be satisfied. Thus we derive \(a\) and \(b\) as

\[a =(f(\gamma)+f(2f(\gamma)-\gamma))/2, \tag{6}\] \[b =(f(\gamma)-f(2f(\gamma)-\gamma))/2, \tag{7}\]

where \(a\) and \(b\) are uniquely determined and depend solely on \(\gamma\) for a given activation function \(f(x)\) while they are independent of \(N\), \(\alpha\). It is straightforward to check that Eq.4 is satisfied for any \(\boldsymbol{\xi}\) and \(\boldsymbol{\eta}\). Although not proven analytically, we have confirmed numerically that \(x^{\text{fp}}\) is a unique fixed-point for given \(\mu\) and \(\gamma\). This rigorous solution is applicable not only to \(\tanh(\cdot)\) but also to any arbitrary function, as long as \(\boldsymbol{\xi}\) and \(\boldsymbol{\eta}\) are binary vectors. As \(\gamma\) increases from zero, \(a(\gamma)\) increases and takes a peak for \(\gamma=1\), while \(b(\gamma)\) increases more slowly as plotted in Fig.1A. For \(\gamma\) less than 2, \(a(\gamma)\) is larger than \(b(\gamma)\) and, oppositely, beyond \(\gamma=2\), \(b(\gamma)\) is larger than \(a(\gamma)\)[15]. The overlap of \(x^{\text{fp}}\) with \(\boldsymbol{\xi}\), termed \(m\triangleq\Sigma_{x}x^{\text{fp}}_{i}\xi_{i}/N\), is also plotted in Fig. 1B. For a given \(\beta\), \(m\) increases up to \(\gamma=1\) and, subsequently, decreases. As \(\beta\) increases, the curve of \(m\) is steeper so that \(x^{\text{fp}}\) nearly equals 1 even for the weak input. The overlap of \(x^{\text{fp}}\) with \(\boldsymbol{\eta}\) slowly increases with \(\gamma\), followed by a sharp rise at \(\gamma\approx 2\) beyond which it approaches unity, i.e., the network just outputs the input as it is (Fig. 1B). Thus, in the following part, we consider the range of \(0\leq\gamma\leq 2\).

Although \(x^{\text{fp}}\) is a fixed point for any value of parameters, it is necessary to ascertain its stability and the existence of other attractors, to assess whether the recall of \(x^{\text{fp}}\) really works from any initial states. We numerically solved Eq. (1) (\(N=2048\), unless otherwise noted), and found another chaotic attractor in addition to \(x^{\text{fp}}\). By varying \(\alpha\) and \(\beta\), three types of recall behaviors are observed depending on the stability of these two attractors, which are characterized by the distinct bifurcation diagrams of \(m\) against \(\gamma\) (as shown in Fig. 2A(i)-(iii)): (i) Stable recall of \(x^{\text{fp}}\) for any strength of the input: \(x^{\text{fp}}\) is a unique attractor for any \(\gamma\). (ii) Stable recall of \(x^{\text{fp}}\) only for a certain range of \(\gamma\): \(x^{\text{fp}}\) is a unique attractor for \(\gamma\sim 1\), whereas for smaller \(\gamma\) the chaotic attractor appears, which exhibits a smaller overlap with \(\xi\) compared with the overlap of \(x^{\text{fp}}\)[16]. For smaller \(\gamma\) values, the neural state fails to converge into \(x^{\text{fp}}\), and instead, it converges into the chaotic attractor from most initial states, meaning that the network fails to recall the target. Still, for \(\gamma\sim 1\), the neural state from any initial

Figure 1: Analytically obtained response of the network to input with increasing the input strength \(\gamma\). A) \(a(\gamma)\) and \(b(\gamma)\) in Eqs.6 and 7, for \(\beta=1\). B) The overlaps of \(x^{\text{fp}}\) with a target and an input for increasing \(\gamma\), plotted for different \(\beta\) in blue and red, respectively.
state converges to \(x^{\rm fp}\) whose overlap with the target is close to unity, resulting in the recall of the target. (iii) No stable recall of \(x^{\rm fp}\) for any \(\gamma\): the chaotic attractor exists across all ranges of \(\gamma\), even though \(x^{\rm fp}\) coexists around \(\gamma=1\). The chaotic attractor has a much larger basin of attraction than \(x^{\rm fp}\) even for \(\gamma\sim 1\) (Fig. S1C). Consequently, the recall of the target is impaired.

To analyze these three behaviors, we first explored the stability of \(x^{\rm fp}\) and of the chaotic attractor across a range of \(\beta\) with a constant \(\alpha=0.38\). We found that for a small value of \(\beta\) (\(\beta=0.8\)), the stable recall (i) is achieved. The neural states from any initial states for any \(\gamma\) converge rapidly into \(x^{\rm fp}\) (as shown in Fig. S1A), indicating high robustness in the success recall. However, the degree of overlap with the target is notably below the unity.

As \(\beta\) increases, \(x^{\rm fp}\) approaches the target for all ranges of \(\gamma\). Beyond the critical \(\beta\), denoted by \(\beta_{F}\), \(x^{\rm fp}\) turns to be unstable for a certain range of \(\gamma\), while the chaotic attractor emerges, corresponding to the recall type (ii) as shown in Fig. 2A(ii). The overlap of the chaotic attractor with the target is much lower than that of \(x^{\rm fp}\). Although, for \(\gamma=1\), \(x^{\rm fp}\) is the unique attractor, there exists long-term transient chaos before the neural state converges into \(x^{\rm fp}\) (see Fig. S1B).

With the further increase in \(\beta\), the range of \(\gamma\) within which the chaotic attractor exists expands, eventually, covering all the range of \(0\leq\gamma\leq 2\) at another critical value of \(\beta\) (termed \(\beta_{I}\)). Beyond \(\beta_{I}\), the system exhibits the recall type (iii). Even for \(\gamma=1\), the basin of the chaotic attractor covers the full state space, and most orbits from random initial conditions converge into it (Fig. S1C). Thus, the recall of the target almost fails.

To comprehensively understand the recall behavior across \(\beta\) and \(\gamma\), we draw the regions where the chaotic attractor is present in Fig. 2B. We also investigated the stability of \(x^{\rm fp}\), which is, however, not directly related to the type of recall and is shown in Fig. S2. In the area above the curve, the chaotic attractor is present. \(\beta_{F}\) is the minimum value of the curve in \(\beta\leq 1\), whereas \(\beta_{I}\) is the maximum value of \(\beta\) on the curve at \(\gamma=1\). These two critical values of \(\beta\) determine the phase boundary of three recall behaviors (i)-(iii).

With an increase in \(\beta\), \(x^{\rm fp}\) approaches the target, and accordingly, the final states in all the recall trials overlap almost perfectly with the target below \(\beta=\beta_{I}\) at which the chaotic attractor emerges (Fig. 2C). As \(\beta\) increases beyond \(\beta_{I}\), the basin of the \(x^{\rm fp}\) attractor shrinks, while that of the chaotic attractor expands. Consequently, the overlap between the final state and the target averaged over randomly chosen initial states significantly decreases, as depicted in Fig. 2C. Thus, the recall performance reaches its peak (i.e., at the onset of chaos) across all ranges of \(\gamma\).

So far, we presented the results with the fixed number of memories \(\alpha N\) (\(\alpha=0.38\)). Noting that standard associative memory models such as the Hopfield network, recall fails beyond a critical number of embedded memories. We next analyze the change in the recall process with increasing \(\alpha\) and demonstrate it exhibits similar behavior to the change with the increases in \(\beta\): Three types of recall behavior emerge as \(\alpha\) varies, as shown in Fig. 3A. For small \(\alpha\), \(x^{\rm fp}\) is stable and a unique attractor for any \(\gamma\) (type (i) ). With the increase in \(\alpha\), the chaotic attractor emerges within a certain range of \(\gamma\) (type (ii) ), and this range expands (Fig.3B). Finally, the range within which the chaotic attractor is present covers all the ranges of \(\gamma\) (type (iii) ). In contrast to the clear change in the recall process with increasing \(\beta\), the value of \(x^{\rm fp}\) remains

Figure 2: Three recall behaviors in response to \(\mathbf{\eta}\) depending on \(\beta\). A) The overlaps \(m\) against the increase in \(\gamma\) are shown for \(\beta=0.8,4,4.7\) in (i)-(iii) panels, respectively. In each panel, each of the black dots for a given \(\gamma\) represents the overlap of \(x\) with \(\mathbf{\xi}^{1}\) averaged over 100 unit-time after the transient period. To confirm the stability of \(x^{\rm fp}\) and explore another attractor, we sampled the dynamics from 20 random initial states in addition to an initial state equal to \(x^{\rm fp}\). The dotted lines represent the overlap of \(x^{\rm fp}\) with \(\mathbf{\xi}^{1}\) as also shown in panel C. B) Stability of the chaotic attractor against \(\beta\) and \(\gamma\). The chaotic attractor is present above the curve. All results are obtained for \(\alpha=0.38\). C) The overlap at \(\gamma=1\) with the increase in \(\beta\), as in A. Dots represent the overlaps obtained from 100 randomly chosen initial states, while the solid line exhibits the overlap averaged over them.
unchanged during the increase in \(\alpha\).

We now focus on the behavior for \(\gamma=1\) and explore the number of memories recalled successfully. We found that at \(\alpha=\alpha_{C}(\beta)\) the chaotic attractors emerge for all embedded patterns \(\mu\) (\(\alpha_{C}(\beta)\) is obtained by solving \(\beta=\beta_{I}(\alpha)\)). For \(\alpha<\alpha_{C}\), the fixed points \(x^{\mathrm{fp},\mu}=(a\mathbf{\xi}^{\mu}+b\mathbf{\eta}^{\mu})\) for all \(\mu\) are stable and all the embedded patterns are successfully recalled, whereas for \(\alpha>\alpha_{C}\), almost all the recall trials fail for all patterns due to the emergence of the chaotic attractors whose basins of attraction are much larger than those of \(x^{\mathrm{fp},\mu}\). The number of successfully recalled memories increases linearly below \(\alpha=\alpha_{C}(\beta)\) and then drops to zero drastically (see Fig. 3C,) signifying that \(\alpha_{C}(\beta)N\) is the memory capacity in this model (e.g., \(\alpha_{C}(4)=0.38\)). \(\alpha_{C}(\beta)\) decreases towards a certain finite value \(\alpha_{C}(\infty)\) with the increase in \(\beta\) as analyzed in detail in the following.

We finally show the phase diagram of the recall process against \(\alpha\) and \(\beta\) by identifying \(\beta_{F}(\alpha)\) and \(\beta_{I}(\alpha)\) (\(\alpha_{C}(\beta)\) is the inverse function of \(\beta_{I}(\alpha)\)) as shown in Fig 3D. As \(\alpha\) approaches zero, \(\beta_{F}\) diverges, meaning that if \(\alpha\) is set to a sufficiently small value, \(x^{\mathrm{fp}}\) is stable throughout all \(\gamma\) even for quite large \(\beta\). For such a limit, \(x^{\mathrm{fp}}\) approaches a step function; \(x^{\mathrm{fp}}=1\) for \(0<\gamma<2\) and \(x^{\mathrm{fp}}=0\) for otherwise. Consequently, the network perfectly recalls the target for \(0<\gamma<2\).

\(\beta_{I}\) increases drastically as \(\alpha\) decreases from \(0.5\) and diverges at \(\alpha_{C}(\infty)\). For \(\alpha\) below \(\alpha_{C}(\infty)\), the neural state converges to \(x^{\mathrm{fp}}\) for \(\gamma=1\) even for \(\beta\rightarrow\infty\). The asymptotic analysis demonstrates that \(\alpha_{C}(\infty)\sim 0.340\) for \(N\rightarrow\infty\) (See Fig. S3), indicating that the memory capacity is \(\alpha=0.340\) when \(\beta\) is sufficiently large.

In summary, we present an analytically solvable neural network model for I/O associations in which each input stabilize the target pattern as a unique fixed-point under the limit of memory capacity. This connectivity in the network consists of both target and input patterns, by introducing the pseudo-inverse matrix, which allows for rigorous recalls of any (correlated) target patterns. This is in contrast to our previous model[17] valid only for mutually orthogonalized patterns. By using this model, we derive the response to the input as the analytical expression of the fixed point for any input strength, whereas the response dynamics were explored in random networks (without embedded patterns)[18; 19; 20] and low-rank networks[21; 22]. We also demonstrate the emergence of the additional chaotic attractor numerically. Through exploration of the stability of these attractors, we identified three distinct recall processes.

Introducing the pseudo-inverse matrix (\(X^{+}\) in Eq. 3) into the connectivity generally requires the global information of the network, which may be difficult to implement biologically( but see[14] for Hopfield network). In our previous study[23; 24], however, a Hebbian and anti-Hebbian learning that only requires local information can shape the connectivity that is similar to our current connectivity. Still, filling the gap between the learning-shaped connectivity and the current connectivity needs further studies.

Here, we uncovered three phases of recalls, concerning the dominance of the chaotic attractor. Interestingly, the recall performance is maximized at the onset of the chaos, where the spontaneous chaotic activity is bifurcated to the fixed point that corresponds to the target output. In fact, such transitions of the activities with changes in the stimuli are observed in many cortical areas[25; 26] These are consistent with our findings of the optimal performance under sponta

Figure 3: Three recall behaviors in response to \(\mathbf{\eta}\) depending on \(\alpha\). A) The overlaps against the increase in \(\gamma\) are shown for \(\alpha=0.05,0.3,0.4\) in (i)-(iii) panels, respectively. Black dots and dotted lines exhibit the neural states and \(x^{\mathrm{fp}}\) in the same way as in Fig. 2A. B) Stability of the chaotic attractor against \(\alpha\) and \(\gamma\). The chaotic attractor is present above the red curve. All results are obtained for \(\beta=4\). C) (Upper panel) Bifurcation diagram of the overlap at \(\gamma=1\) with the increase in \(\alpha\) is shown in the same way as in A. (Lower panel) The number of memorized patterns (i.e., the number of \(x^{\mathrm{fp},\mu}\) (\(\mu=1,\ldots,\alpha N\) ) into which the neural state converges) normalized by \(N\) is plotted. Filled lines in gray and black show the behavior for \(\beta=4,32\), respectively. The dotted line represents the maximum number of possible memories normalized by \(N\) (i.e., \(\alpha\)). D) Three recall behaviors in response to \(\mathbf{\eta}\). A phase diagram of the recall regimes (i,ii,iii) against \(\alpha\) and \(\beta\). \(\beta_{F}\) (orange) gives the boundary of the stable \(\mathbf{x}^{\mathrm{fp}}\), while \(\beta_{I}\) (magenta) shows the border of the impaired recall regime.
neous chaotic dynamics, whereas the roles of the chaotic dynamics in the response and learning need to be further elucidated. Indeed, the relevance of spontaneous chaotic (and high-dimensional) dynamics to computational neuroscience has been discussed, for instance, in the reservoir computing[27; 28; 29; 30], memories[31], mixed-selectivity for efficient separation[32], sampling[33], neural avalanche[34; 35] and learning[36; 37]. Our study has demonstrated a new role of chaotic dynamics in recall performance.

Although Hopfield networks[9; 10] and their variants[12; 13; 14] have great contributions to associative memory, the modulation of the internal dynamics by external input that is essential for performing cognitive functions has not been included. Our model presents a novel prototype connectivity underlying such modulation, which will advance our understanding of neural processing.

###### Acknowledgements.

 T.K. and K.K. are supported by JSPS KAKENHI (No.20H00123, T.T and K.K) and Novo Nordisk Foundation (0065542, K.K)
