Transitions among metastable states underlie context-dependent working memories in a multiple timescale network
Abstract
Transitions between metastable states are commonly observed in the neural system and underlie various cognitive functions such as working memory. In a previous study, we have developed a neural network model with the slow and fast populations, wherein simple Hebb-type learning enables stable and complex (e.g., non-Markov) transitions between neural states. This model is distinct from a network with asymmetric Hebbian connectivity and a network trained with supervised machine learning methods: the former generates simple Markov sequences. The latter generates complex but vulnerable sequences against perturbation and its learning methods are biologically implausible. By using our model, we propose and demonstrate a novel mechanism underlying stable working memories: sequentially stabilizing and destabilizing task-related states in the fast neural dynamics. The slow dynamics maintain a history of the applied inputs, e.g., context signals, and enable the task-related states to be stabilized in a context-dependent manner. We found that only a single (or a few) state(s) is stabilized in each epoch (i.e., a period in the presence of the context signal and a delayed period) in a working memory task, resulting in a robust performance against noise and change in a task protocol. These results suggest a simple mechanism underlying complex and stable processing in neural systems.
Keywords:
Sequence multiple timescale working memory1 Introduction
Neural trajectories are commonly observed in neural systems [12] and are involved in temporal information processing, such as working memory[19] decision-making [6]. The organization and processing of task-related information through these trajectories is an essential question in neuroscience.
Two theoretical approaches are proposed to answer the question. In this approach, each pattern in the trajectory is represented as a metastable state, wherein synaptic connectivity in a neural network is formed through Hebbian learning. An asymmetric connection from the current to the successive pattern[1, 4, 18, 17, 14, 16, 3] leads to transitions between patterns. These sequences of metasable states are robust to noise and are widely observed in neural systems[12]. A transition between these states is explicitly embedded into connectivity (i.e., the connectivity composed of correlations between the current and the next patterns), resulting in a next pattern being determined only by the current pattern. Hence, the generation of non-Markov sequences depending on the long history of previous patterns is not possible.
In another approach[11, 2, 20, 10] trained recurrent neural networks (RNNs) were used to generate neural trajectories using machine learning methods. RNNs reproduce neural trajectories observed in neural systems, and how these trajectories encode and process information over time has been investigated. These models allow for generating complex sequences dependent on the history. However, parameters are finely tuned through non-biologically plausible learning, and the parsimonious principle of temporal information processing in neural dynamics is unclear. Thus, a simple and biologically plausible model that generates long-history-dependent sequences is necessary.
To this end, we have studied a neural network model with fast and slow neural dynamics[9], wherein the slow dynamics integrate previous information and regulate fast dynamics. Using this model, in this study, we propose a novel mechanism underlying stable working memories: stabilizing and destabilizing task-related states at an adequate time. We also examine whether our model performs a context-dependent working memory task wherein history-dependent computation is necessary.
2 Model
2.1 Neural dynamics
Our model is based on a previous study[9] that showed that an RNN with multiple timescales enables the learning of sequential neural patterns including non-Markov sequences. The model has two populations with different timescales connected to each other (Fig. 1A). One population comprises fast neurons , and the other comprises slow neurons . The fast population receives an external stimulus and generates a target response corresponding to the given input. These neurons evolve according to
(1) | ||||
(2) | ||||
(3) | ||||
(4) | ||||
(5) |
where is a recurrent connection from the to -th neuron in the population of and is a connection from the -th neuron in the population of to the -th neuron in the population of . The mean values of and are set to zero with a variance equal to 1/. , and are set to , and , respectively, while the time scales of and , denoted as and , are set to 1 and 33, respectively. is the th element of an input pattern.
2.2 Learning process
In our model, only is plastic and changes according to
where is the learning speed, and it is set to . is the -th element of a target , which is an -dimensional pattern. In previous studies[7, 8, 5], we demonstrated that a single population with a single timescale learns mappings between constant input and target patterns using this learning rule. In the current two-population model, there are two inputs for the fast sub-network—one is from an external input and the other is from the slow sub-network that stores previous information. Thus, the synaptic dynamics can modify the connection to generate a target pattern depending not only on the currently applied input but also on the preceding input, as shown in [9]. We, in the present study, demonstrate this model performs a context-dependent task.

3 Results
3.1 Context-dependent task
First, we consider learning a simple context-dependent task that is composed of two context signals, a delayed signal and a cue signal (Fig. 1B). In this task, one of the context signals is applied to fast neurons, followed by the delayed signal. Finally, the cue signal is applied. On applying the cue signal, the network is required to generate “Go” pattern or “No-Go” pattern depending on the context signal. When the applied context signal is , the network should generate the Go pattern, while it should generate the No-Go pattern when the context signal is . Here, we denote Go and No-Go patterns as and , respectively. Thus, the network must maintain the context signal to generate an adequate response pattern.
The signal and response patterns are random -bit binary patterns, each element of which corresponds to a neuron of , with probabilities , where is the activity state of the -th element of patterns and . All elements of the delayed signal are . We apply the context, the delayed, and the cue signal sequentially with duration time as an external input in Eq. 2, as illustrated in Fig. 1B. If the fast dynamics reach (or ), namely , a trial is completed, and the next trial starts. Now, the target patterns are defined only when the cue signal is applied. Therefore, the learning process runs only during the cue signal application; otherwise, only the neural dynamics run.
We show successful trials in the context-dependent task in Figure 2A. In the presence of the context signal , fast neural dynamics already show a high overlap with , while they show quite different patterns in the presence of . The slow dynamics follow the fast dynamics in both cases. The fast dynamics change slightly upon the delayed signal after the context signal , while they change drastically after . Although the network receives the same delayed signals, quite different neural dynamics emerge owing to the slow dynamics that reflect the preceding context signals. Finally, the fast dynamics converge to the correct target or depending on the preceding context signals and , respectively. We measured the success rate across 20 trials for each context signal, resulting in a 95% success rate ( Fig. 2B).
To examine the role of the slow dynamics in this task, we analyzed the neural dynamics with , i.e., the dynamics of the two populations change with the same timescale. In this case, the neural dynamics do not store the history of the fast dynamics over a long time. We plot two trajectories for the context A and B in Fig. 2C. In the present of the context signals, two trajectories show different behaviors depending on the identity of the context signals. After the presentation of the context signal, the difference between the two trajectories rapidly decreased during the delayed epoch and the cue one. Thus, the network generates the same neural patterns (in this case, ) in both contexts and in the presence of the cue signal. Altogether, these results show that the the population with the slow timescale enables successful performing the context-dependent task.

3.2 Delayed match to sample task
In the task analyzed above, the network is required to store only the context information irrespective of the cue signals; this is because the correct response is uniquely determined by the context signal. However, the required responses are commonly dependent on cue signals in addition to context signals, as analyzed in [11, 19]. Subsequently, we examined whether our model performs such a complex context-dependent task (denoted as a delayed match to the sample task), as shown in Fig. 3A. This task is based on procedure similar to the task analyzed above. There are two context signals, and , and two cues, and , and the same-name patterns (i.e., and , or and ) belong to the same category. A network is required to “Go” (denoted as matched pattern ) when the context and cue signal in the same category are given, while it is required to “No-Go” (denoted as non-matched pattern ) when these cues are in a different category. Unlike the previous task, the network should generate two different patterns depending on the cue signals, in addition to the context signals.
The context and cue signals (, and ) and response patterns ( and ) are the random -bit patterns generated in the same manner as in the previous task. There are two patterns for and as well as two patterns for and . When the two () patterns are the same, the learning performance is poor. Thus, we add random perturbation parts to and , as shown in Fig. 3A. The delay signal and learning procedure are the same as that in the previous task.

First, we present four trajectories corresponding to the four conditions (two contexts by two cues) in Figs. 3B-D. Here, the fast neural dynamics are projected onto the 2D principal component (PC) space after averaging over 20 trajectories for each condition. The projected trajectories for four different conditions are shown by solid and dotted lines in different colors.
In the presence of context signals, neural trajectories are separated into two groups according to the context signals and converge into neural states and . Following the context signals, the delay signals are applied. Two groups of trajectories evolve from and and reach and with a decrease in the distance between the two groups. Although the difference decreases, that between neural states in the slow dynamics remains high at the end of the delay epoch, and the information of the preceding context signal is retained in the slow dynamics. Finally, applying the cue to the network separates the four trajectories into the match () and non-match () states depending on the contexts and cues. The trajectories diverge into different states in the presence of the same cue owing to the slow dynamics that reflect the context signals. In this manner, the network performs the delayed match to sample task. To precisely evaluate the performance of this model, we measured the success rate for 20 trials for each condition, resulting in more than % trials being successful for all conditions.
In a noisy system such as a neural system, information processing should be robust against noise and perturbations. We explore the robustness of our model against perturbations in the initial states and the change in stimulus duration . First, for the modification of , we changed for each epoch (the context signal, the delay signal, and the cue signal) from to in the test process after training the network with . We measured the success rate by 20 trials for modified and observe that such perturbations do not reduce the success rate compared to the normal situation, as shown in Fig. 3E.

Next, we analyze the robustness against the perturbations of the initial states, wherein the initial states of the fast and slow dynamics, and , in the test process are selected randomly from a larger distribution around the origin in the neural state space than those in the learning process. We set the initial states of and in the test process to random -dimensional states uniformly sampled from a closed interval , whereas in the learning process, the initial states are limited to a smaller closed interval . Therefore, almost all initial states in the test process are novel for the network. By measuring the success rate against 20 trials for the perturbation case, we observed that % of all trials were successful for three conditions, while more than % of all trials were successful for one condition (context A – cue b). The network successfully performs the delayed match to sample task with highly volatile initial states, except for A – b condition. In total, these results indicate that our learning process generates a network model robust against perturbations of the initial states and signal duration.
Why is such robust information processing possible? To answer this question, we analyzed the stability of neural trajectories in each epoch (i.e., in the presence of context, delayed, and cue signals) in the test process. First, to explore the robustness during the signal epoch, the initial states are randomly generated around in the same manner as the perturbation case, and the fast and slow dynamics run according to Eqs. 2 and 3. Figure 4A demonstrates these trajectories in the presence of the context . Neural trajectories from the perturbed initial states converge to and remain around for some time. is stable and attracts trajectories starting from a broad area of the neural state space in the context epoch. The same analysis in the delayed and cue epochs revealed that , and are stable states in the corresponding epochs, as shown in Figs. 4B and C. After changing the signal, each state is destabilized. and are stable for the same delay signals depending on the preceding contexts. and are stable dependent on the context and the cue. The slow dynamics store the context information and stabilize the different states through interaction with the cue signal. These results demonstrate that successive stabilization and destabilization of the epoch-specific states underlie the stable performance of the delayed match to the sample task.
In contrast, in the presence of (i.e., the correct target state for A – b condition) is less stable than the other task-related states, resulting in some trajectories not reaching , but , as shown in Fig. 4D. Thus, the task often fails. These results indicate that our model robustly performs a delayed match to sample task by sequential stabilization of the task-related states.
4 Discussion and Summary
We have proposed and demonstrated that sequential stabilization of task-related states leads to the robust performance of the context-dependent task. During each epoch (i.e., in the presence of the context signal, the delayed one, and the cue one), the epoch-specific states are stabilized and destabilized in the fast dynamics through the regulation of the slow dynamics. The slow dynamics maintain the previous stimulus and enable the neural state in the fast dynamics to transit from one state to another in context-dependent (i.e., non-Markov) manner.
Such transitions of neural states are distinguished from the typical models of the transitions. Although asymmetric Hebbian connection model[1, 4, 18, 17, 14, 16, 3] generates transitions between metastable states, the current pattern is determined only by the immediately preceding pattern and, consequently, non-Markov sequences are not allowed. Sophisticated training methods of RNNs[11, 2, 20, 10] generate complex neural trajectories, but how such trajectories are formed is unclear and the stability of these trajectories is poor[10].
Recent theoretical studies revealed relevance of the stable states in neural processing[22, 21]. In these studies, several stable states exist in the neural state space and the adequate input drives the neural state from one stable state to another for performing the cognitive tasks, e.g., flip-flop function and generation of muscle activity. Thus, initial states before being applied the input are crucial for performing a task. In contrast, in our model, the input stabilizes a single (or a few) state(s) in the fast dynamics depending on the previous inputs stored in the slow dynamics. Hence, neural states beginning from a broader area converge the adequate state. Our proposed model sheds light on neural processing by the hierarchical timescale structure, which are commonly observed in the neural system[13, 15].
Acknowledgments
We thank Kunihiko Kaneko for fruitful discussion for our manuscript. This work was partly support by JSPS KAKENHI (no.20H00123).
References
- [1] Amari, S.I.: Learning patterns and pattern sequences by self-organizing nets of threshold elements. IEEE Transactions on Computers 100(11), 1197–1206 (1972)
- [2] Chaisangmongkon, W., Swaminathan, S.K., Freedman, D.J., Wang, X.J.J.: Computing by Robust Transience: How the Fronto-Parietal Network Performs Sequential, Category-Based Decisions. Neuron 93(6), 1504–1517.e4 (2017)
- [3] Gros, C.: Neural networks with transient state dynamics. New Journal of Physics 9 (2007)
- [4] Kleinfeld, D.: Sequential state generation by model neural networks. Proceedings of the National Academy of Sciences 83(December), 9469–9473 (1986)
- [5] Kurikawa, T., Barak, O., Kaneko, K.: Repeated sequential learning increases memory capacity via effective decorrelation in a recurrent neural network. Physical Review Research 2(2), 023307 (jun 2020)
- [6] Kurikawa, T., Haga, T., Handa, T., Harukuni, R., Fukai, T.: Neuronal stability in medial frontal cortex sets individual variability in decision-making. Nature Neuroscience 21(12), 1764–1773 (dec 2018)
- [7] Kurikawa, T., Kaneko, K.: Embedding responses in spontaneous neural activity shaped through sequential learning. PLoS computational biology 9(3), e1002943 (jan 2013)
- [8] Kurikawa, T., Kaneko, K.: Dynamic Organization of Hierarchical Memories. Plos One 11(9), e0162640 (2016)
- [9] Kurikawa, T., Kaneko, K.: Multiple-timescale Neural Networks: Generation of Context-dependent Sequences and Inference through Autonomous Bifurcations. arXiv preprint p. 2006.03887 (jun 2020)
- [10] Laje, R., Buonomano, D.V.: Robust timing and motor patterns by taming chaos in recurrent neural networks. Nature neuroscience 16(7), 925–33 (jul 2013)
- [11] Mante, V., Sussillo, D., Shenoy, K.V., Newsome, W.T.: Context-dependent computation by recurrent dynamics in prefrontal cortex. Nature 503(7474), 78–84 (nov 2013)
- [12] Miller, P.: Itinerancy between attractor states in neural systems. Current Opinion in Neurobiology 40(5), 14–22 (oct 2016)
- [13] Murray, J.D., Bernacchia, A., Freedman, D.J., Romo, R., Wallis, J.D., Cai, X., Padoa-Schioppa, C., Pasternak, T., Seo, H., Lee, D., Wang, X.J.: A hierarchy of intrinsic timescales across primate cortex. Nature neuroscience 17(12), 1661–1663 (nov 2014)
- [14] Recanatesi, S., Katkov, M., Romani, S., Tsodyks, M.: Neural network model of memory retrieval. Frontiers in Computational Neuroscience 9(DEC), 1–11 (2015)
- [15] Runyan, C.A., Piasini, E., Panzeri, S., Harvey, C.D.: Distinct timescales of population coding across cortex. Nature 548(7665), 92–96 (aug 2017)
- [16] Russo, E., Treves, A.: Cortical free-association dynamics: Distinct phases of a latching network. Physical Review E 85(5), 1–21 (2012)
- [17] Seliger, P., Tsimring, L.S., Rabinovich, M.I.: Dynamics-based sequential memory: Winnerless competition of patterns. Physical Review E - Statistical Physics, Plasmas, Fluids, and Related Interdisciplinary Topics 67(1), 4 (jan 2003)
- [18] Sompolinsky, H., Kanter, I.: Temporal Association in Asymmetric Neural Networks. Physical Review Letters 57(22), 2861–2864 (dec 1986)
- [19] Stokes, M.G., Kusunoki, M., Sigala, N., Nili, H., Gaffan, D., Duncan, J.: Dynamic Coding for Cognitive Control in Prefrontal Cortex. Neuron 78(2), 364–375 (apr 2013)
- [20] Sussillo, D., Abbott, L.F.: Generating coherent patterns of activity from chaotic neural networks. Neuron 63(4), 544–57 (aug 2009)
- [21] Sussillo, D., Barak, O.: Opening the black box: low-dimensional dynamics in high-dimensional recurrent neural networks. Neural computation 25(3), 626–49 (mar 2013)
- [22] Sussillo, D., Churchland, M.M., Kaufman, M.T., Shenoy, K.V.: A neural network that finds a naturalistic solution for the production of muscle activity. Nature neuroscience 18(7), 1025–33 (2015)