===== PDF PAGE 1 =====
                Dynamical phases of short-term memory mechanisms in RNNs





         Bariscan Kurtkaya* 1 2 Fatih Dinc* 2 3 4 Mert Yuksekgonul 5 Marta Blanco-Pozo 2 6 Ege Cirakman 2

               Mark Schnitzer 2 6 7 Yucel Yemez 1 Hidenori Tanaka† 8 9 Peng Yuan† 10 Nina Miolane† 3





                            Abstract                                   1. Introduction

        Short-term memory is essential for cognitive pro-              Learning to respond based on delayed information is a fun-

        cessing, yet our understanding of its neural mecha-            damental challenge in both neuroscience and machine learn-

        nisms remains unclear. Neuroscience has long fo-               ing (Constantinidis & Klingberg, 2016; Bengio et al., 1994).

        cused on how sequential activity patterns, where               In machine learning, early studies in the 1990s identified

        neurons fire one after another within large net-               this difficulty as the problem of learning long-term depen-

        works, can explain how information is maintained.              dencies, particularly in recurrent neural networks (RNNs)

        While recurrent connections were shown to drive                trained on tasks requiring information retention across time

        sequential dynamics, a mechanistic understand-                 (Bengio et al., 1994). Despite significant progress in neural

        ing of this process still remains unknown. In this             network architectures, this issue remains central to design-

        work, we introduce two unique mechanisms that                  ing systems capable of effective temporal reasoning.

        can support this form of short-term memory: slow-

                                                                       To address long-term dependencies, machine learning re-

        point manifolds generating direct sequences or

                                                                       searchers developed specialized architectures such as Long

        limit cycles providing temporally localized ap-

                                                                       Short-Term Memory (LSTM) networks, Gated Recurrent

        proximations. Using analytical models, we iden-

                                                                       Units (GRUs), and, more recently, Transformers (Hochre-

        tify fundamental properties that govern the se-

                                                                       iter, 1997; Chung et al., 2014; Vaswani, 2017). These mod-

        lection of each mechanism. Precisely, on short-

                                                                       els introduced mechanisms that enhance memory retention,

        term memory tasks (delayed cue-discrimination

                                                                       e.g., by learning neuronal timescales. In contrast, biological

        tasks), we derive theoretical scaling laws for criti-

                                                                       neurons communicate through action potentials and are gov-

        cal learning rates as a function of the delay period

                                                                       erned by biophysical parameters, such as membrane time

        length, beyond which no learning is possible. We

                                                                       constants, that determine the decay of activity over time

        empirically verify these results by training and

                                                                       (Jonas et al., 1993; McCormick et al., 1985; Miles, 1990;

        evaluating approximately 80,000 recurrent neural

                                                                       Isokawa, 1997; Geiger et al., 1997). This fundamental dif-

        networks (RNNs), which are publicly available

                                                                       ference raises a key question: how do biologically inspired

        for further analysis1 . Overall, our work provides

                                                                       neural systems learn to associate events separated in time?

        new insights into short-term memory mechanisms

        and proposes experimentally testable predictions               This question has regularly been studied under a central

        for systems neuroscience.                                      topic in neuroscience: short-term memory, a fundamental

                                                                       cognitive function that enables organisms to temporarily

    *

    Equal contribution † Supervision. 1 Koc University, Turkey         store and manipulate information. This process is essential

2

  CNC Program, Stanford University, Stanford, USA 3 Geometric          for adaptive behavior and is disrupted in several neurologi-

Intelligence Lab, UC Santa Barbara, Santa Barbara, USA 4 Kavli         cal and psychiatric conditions such as Alzheimer’s disease

Institute for Theoretical Physics, UC Santa Barbara, Santa Bar-        (Bondi et al., 2017), schizophrenia (Lee & Park, 2005) and

bara, USA 5 Computer Science, Stanford University, Stanford, USA

6                                                                      post-traumatic stress disorder (Scott et al., 2015) among

  James H. Clark Center for Biomedical Engineering & Sciences,

Stanford University, Stanford, USA 7 Howard Hughes Medical             others. Yet, while short-term memory is a central cogni-

Institute, Stanford University, Stanford, USA 8 Phi Lab, NTT Re-       tive function, the mechanisms that support it remain poorly

search, Sunnyvale, USA 9 Center for Brain Science, Harvard Uni-        understood in systems neuroscience (Serences, 2016).

versity, Cambridge, USA 10 Institute for Translational Brain Re-

search, Fudan University, Shanghai, China. Correspondence to:          In the mammalian brain, short-term memory is supported

Fatih Dinc <fdinc@ucsb.edu>.                                           by a dynamic network spanning cortical and subcortical

                                                                       regions such as the prefrontal, parietal, and sensory cor-

Proceedings of the 42 nd International Conference on Machine

                                                                       tices, and the hippocampus (Todd & Marois, 2004; Curtis &

Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025

by the author(s).                                                      D’Esposito, 2003; Harrison & Tong, 2009; Gnadt & Ander-

    1

      https://github.com/fatihdinc/dynamical-phases-stm                sen, 1988; Baeg et al., 2003; Cavanagh et al., 2018; Meyers



                                                                   1


===== PDF PAGE 2 =====
                                         Dynamical phases of short-term memory mechanisms in RNNs



et al., 2008). Theories explaining this core process can be                          ent memory tasks or training conditions? Q3: And how

broadly grouped into three levels. At the synaptic trans-                            do these learned mechanisms vary with the delay duration,

mission level, memory may be stored in “activity-silent”                             i.e., the time during which the information must be held in

states, maintained by transient synaptic changes induced by                          memory?

plasticity (Mongillo et al., 2008; Stokes, 2015; Kozachkov

                                                                                     We set out to answer these questions through a computa-

et al., 2022; Masse et al., 2019; Brennan & Proekt, 2023).

                                                                                     tional theory perspective, generating predictions for in-vivo

At the neuronal activity level, persistent spiking has been

                                                                                     experiments that we then test in-silico. To achieve this,

linked to memory maintenance during delay periods (Gnadt

                                                                                     we trained approximately 80,000 recurrent neural networks

& Andersen, 1988; Barash et al., 1991; Curtis & D’Esposito,

                                                                                     (RNNs) to perform classical system neuroscience experi-

2003; Baddeley & Hitch, 1974) (Fig. 1A). Finally, at the

                                                                                     ments designed to assess short-term memory capabilities,

population level, short-term memory has been associated

                                                                                     while also studying simple toy models and low-rank RNN

with sequential patterns of neural activation (Baeg et al.,

                                                                                     models as they performed a simpler short-term memory

2003; Harvey et al., 2012; Rajan et al., 2016; Wang, 2021)

                                                                                     task (Fig. 1D-E). Our contributions can be summarized

(Fig. 1B).

                                                                                     as follows: (i) Using interpretable dynamical system mod-

In this work, we study mechanisms that can support mem-                              els stripped down to their most essential components for

ory maintenance at the final population level (Fig. 1B-C).                           solving a delayed activation task (Fig. 1D-E), we illus-

Increasing evidence suggests that memory stability and ro-                           trate how RNNs can develop distinct strategies during learn-

bustness can emerge from a dynamic, distributed neural                               ing, depending on the task and optimization parameters

population activity and is governed by underlying attractor                          (Figs. 2, 3, and S1). (ii) We show how changing one of

states (Cavanagh et al., 2018; Spaak et al., 2017; Meyers                            the simplest tasks in a trivial manner, e.g., by adding a

et al., 2008; Stroud et al., 2024; Brennan & Proekt, 2023).                          post-reaction period, can qualitatively change the learned

Yet several theoretical, and empirically relevant, questions                         short-term memory mechanisms. This finding is particularly

remain unresolved: Q1: What mechanisms support mem-                                  relevant as a cautionary tale for the systems neuroscience

ory maintenance through sequential neural activity? Q2:                              community modeling animal behaviors by drawing compar-

What determines which mechanism is favored under differ-                             isons to RNNs (Mante et al., 2013) (Fig. 3). (iii) Utilizing





 A      Persistent activity model         B        Sequential activation       C                Limit cycles              D                  Delayed cue discrimination task



         Memory A           Memory B







                                                                                                                                        (i) Cue (ii) Delay (iii) Reaction(iv) Post-

                                                                                                                                                                         Reaction









                                                                                                                          E                     Simulation with RNNs

        Memory encoding window

                                                                                                                                               Cue signal       Target response

                                                                                                                          Input and output









        Maintenance window                                                                                                             1

        Response window

                                                                                                                               values









                                                                                                                                                      Cue 1         Output 1

                                                                                                                                                      Cue 2         Output 2

     Distinct groups of neurons are      Memory maintenance happens via the       Sequences can become periodic

     persistently active during the    same group of sequentially active neurons, oscillations in the post-trial period

                                                                                                                                       0

      maintenance of a particular         readout neurons subserve distinct      when limit cycles are used for storing

           short-term memory                  memory-guided responses                     short-term memory                                  Tin Tdelay TrespTpost Tin Tdelay TrespTpost







Figure 1. Studying short-term memory mechanisms with biologically motivated neural network models. A-C A visualization of

short-term memory maintenance in neural activations. A Earlier models predict that fixed and persistent activities of a subset of neurons

during the delay period could encode the content corresponding to distinct memories (red vs blue populations) (Fuster & Alexander, 1971;

Atkinson & Shiffrin, 1968). B Memory contents can also be stored within a sequentially firing neuron population (Rajan et al., 2016),

where distinct readout neurons decode distinct memories. C In this work, we show that limit cycles, i.e., periodic orbits, can locally

approximate the memory mechanism in panel (B). However, if left undisturbed, limit cycles may result in spurious periodic responses in

the post-reaction window (magenta). D-E An illustration of the delayed cue-discrimination task and its simulation with RNNs. D The task

includes two correct cue-reaction matches (blue-left, red-right) and consists of four periods: (i) Cue period, where one of the two cues

is presented; (ii) Delay period, with no expected reaction; (iii) Reaction period, where the cue class needs to be outputted; and (iv) an

optional post-reaction period at the end of the trial. E We designed an equivalent task for RNNs, in which two input channels are mapped

to the output channels and for a given trial only a single input is provided in the form of a rectangular pulse of duration Tin . RNNs can be

trained to follow the stages (i-iv) similar to the animals in their target responses. When the cue period is omitted, we refer to this task as

delayed activation task.

                                                                                 2


===== PDF PAGE 3 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



analytical models, we demonstrate theoretical scaling laws           and W out ∈ RNout ×Nrec and bout ∈ RNout for an Nout -

and synthesize a phase diagram of mechanisms for solv-               dimensional output. For notational simplicity, we assume

ing the task, which is a function of the task properties and         ϵ = 0 until our empirical discussions in Section 3.4.

optimization parameters (Figs. S2 and 4G). (iv) Through

                                                                     RNN models of sequential activity–Recent work has iden-

a large-scale study of RNNs2 , we extract the same scaling

                                                                     tified the generation of neural sequences as a potential key

laws in RNNs trained to perform delayed cue-discrimination

                                                                     component of short-term memory (Rajan et al., 2016). This

tasks, which are quantitatively consistent with our theoret-

                                                                     distributed sequence can be used to store the short-term

ical explorations within error bars. We show that RNNs

                                                                     memory content and explicitly keep track of time, which

have little to no trouble learning a modified task with no

                                                                     contrasts with earlier theories of short-term memory main-

delayed output, providing further evidence that training bio-

                                                                     tenance relying on the persistent activities of some neurons

logically inspired neural networks to delay their outputs is

                                                                     (Fuster & Alexander, 1971; Atkinson & Shiffrin, 1968)

fundamentally difficult (Figs. 4, S3, S4, S5 and S6).

                                                                     (Fig.1B). Previous work has provided insights into how

                                                                     these sequences are generated by examining neuronal-level

2. Background                                                        mechanisms (Rajan et al., 2016; Sommer & Wennekers,

                                                                     2005; Laje & Buonomano, 2013), often focusing on the

Systems neuroscience often utilizes animal models, e.g.,

                                                                     learned connectivity structures (Rajan et al., 2016; Laje &

mice, rats, birds, and flies, to study cognitive functions

                                                                     Buonomano, 2013). However, the population-level causal

including short-term memory (Serences, 2016). Alterna-

                                                                     mechanisms underlying neural computation, which could

tively, it is often possible to design artificial models such

                                                                     be investigated through latent dynamics, remain largely un-

as RNNs, which can be trained on observed neural activi-

                                                                     explored.

ties or tasks that are traditionally performed by animals in

laboratories (Mante et al., 2013; Sussillo & Barak, 2013;            To study the latent mechanisms of sequential neural activ-

Yang et al., 2019; Masse et al., 2019; Dubreuil et al., 2022).              PKfocus on a class of low-rank RNNs (i.e., when

                                                                     ities, we

Then, once RNNs are trained, their computation can be                W = k=1 m(k) n(k)T are constrained to be low-rank). In

reverse-engineered to investigate the nature of the neural           this class, the computation performed by RNNs can be stud-

computation performed by biological networks, generat-               ied with the latent dynamical system (Dubreuil et al., 2022;

ing hypotheses that can later be tested with experimental            Valente et al., 2022; Dinc et al., 2025a; 2023):

procedures (Walker et al., 2019; Finkelstein et al., 2021).                                    N

Consequently, RNNs have recently become a key compo-                                                 (k)

                                                                                               X

                                                                      τ κ̇k (t) = − κk (t) +         ni ×

nent of computational neuroscience studies (Dubreuil et al.,                                   i=1

2022; Valente et al., 2022; Finkelstein et al., 2021; Sussillo                                                           !    (2)

                                                                                           K

& Barak, 2013).

                                                                                           X

                                                                                                     (l)       in

                                                                                 × tanh          m κl (t) + W u(t) + b ,

Here, we consider a family of RNNs that are biologically                                   l=1



relevant and whose parameters can be interpreted as func-            where the latent variables are defined as κk (t) = n(k)T r(t)

tional connections between neurons (Perich & Rajan, 2020;            (Dinc et al., 2025a). Intuitively, by constraining the rank

Perich et al., 2021). Specifically, we study RNNs defined            of the weight matrix, W , one can project the computation

by the following equation:                                           performed by N neurons down to a K-dimensional latent

  τ ṙ(t) = −r(t) + tanh(W r(t) + W in u(t) + b + ϵ), (1)            dynamical system. In this work, we use this paradigm (i.e.,

                                                                     training low-rank RNNs) to illustrate the distinct mecha-

where r(t) ∈ RN refers to the firing rates of N neu-                 nisms that support sequence generation, as they emerge dur-

rons, u(t) ∈ RNin pre-defined Nin -dimensional inputs,               ing training. Then, our large-scale experiments generalize

W ∈ RN ×N , W in ∈ RN ×Nin weight parameters with                    our findings to full-rank RNNs with no explicit restrictions.

b ∈ RN corresponding bias terms, and ϵ some noise that

is, in practice, sampled i.i.d. from a Gaussian distribu-            3. Results

tion. The output is taken as a projection of the neural ac-

tivities as ô(t) = f (W out r(t) + bout ), where f (·) is ei-       3.1. Latent mechanisms underlying neural sequences

ther identity or sigmoid function in this work (see below)

                                                                     As a first step, we set out to answer our first question

   2

     The      dataset    is    publicly  available   through         (i.e., Q1: What mechanisms support memory maintenance

https://doi.org/10.5281/zenodo.15529757.      To obtain this         through sequential neural activity?) using a simple short-

dataset, we used several computers with NVIDA RTX 3090               term memory task, stripped of any extraneous components,

GPUs or equivalent, which roughly amounts to 230 kg CO2

emission, 930 km driven by an ICE car, 115 kg coal burned, 4         that can be solved using neural sequences (Fig. 1D-E).

tree seedlings sequesting carbon for 10 year as computed via         Specifically, we focused on one of the simplest tasks called

https://mlco2.github.io/impact/.                                     a delayed activation task (Dinc et al., 2025b). In this task,



                                                                 3


===== PDF PAGE 4 =====
                                                               Dynamical phases of short-term memory mechanisms in RNNs



                                                                                                    Trial start      Response start   Trial end                      0    Absolute firing rates     1

 A                     Tdelay = 75 ms, Tresp = 10 ms, α = 1                                         Latent state     Latent state     Decision

                                                                                                    (during trial)    (after trial)   boundary               1

                     100









                                                                           Activity of the second

 Normalized values









                                                                            latent variable(a.u.)









                                                                                                                                                 Neuron ID

                     10-2



                     10-4

                                       Loss function

                     10-6              Gradient norm

                                                                                                                                                     100

                               100              102                104

                                                                                                                                                                 0   50         0      100        200

                                     Number of training epochs                   Activity of the first latent variable (a.u.)                                              Time (ms)

 B

                       Tdelay = 75 ms, Tresp = 10 ms, α = 10-2



                                                                           Activity of the second

                                                                                                                                                          1





                                                                            latent variable(a.u.)

                     100

 Normalized values









                                                                                                                                                 Neuron ID

                     10-2



                                       Loss function

                     10   -4           Gradient norm

                                                                                                                                                     100

                               100         102               104                                                                                                 0   50         0      100        200

                                     Number of training epochs                  Activity of the first latent variable (a.u.)                                               Time (ms)

 C

                       Tdelay = 75 ms, Tresp = 10 ms, α = 10-4

                                                                           Activity of the second









                                                                                                                                                         1

                                                                            latent variable(a.u.)









                     100

 Normalized values









                                                                                                                                              Neuron ID

                                      Loss function

                     10-2             Gradient norm





                                                                                                                                                     100

                               100        102          104           106                                                                                         0   50         0      100        200

                                     Number of training epochs                  Activity of the first latent variable (a.u.)                                               Time (ms)







Figure 2. Changing optimization parameters may result in RNNs learning distinct attractor mechanisms. We trained a rank-2 RNN

to perform the delayed activation task, in which RNNs initialized at a particular state (Methods) should delay their output by Tdelay for a

Tresp time interval. The task does not constrain the network activity or the output outside of these time windows. A Left. The normalized

gradient norm and the loss function values. Middle. Flow maps of the learned latent dynamical systems demonstrating the (learned)

attractor mechanism. The shaded areas around the decision boundary correspond to network outputs within 0.75 (outer green boundary)

and 0.25 (outer red boundary). Right. Absolute firing rates of the network, whose latent dynamics were illustrated in the middle column.

Dotted line corresponds to the start of the response period. Parameters: N = 100 neurons, τ = 10ms, ∆t = 5ms, Tdelay = 75ms,

Tresp = 10ms, α = 1 for stochastic gradient descent using otherwise the default parameters in Pytorch (Paszke et al., 2017). B-C

Same as in panel (A), but trained with learning rates of 10−2 and 10−4 , respectively.



the network is initialized to a particular state, which is ran-                                                                points. This transition is often structured, i.e., the same

domly selected in the state space (Methods), and has to                                                                        latent trajectory would be followed as the system passes

withhold its response (ô(t) = 0) for a Tdelay time win-                                                                       through these regions (Sussillo & Barak, 2013), and there-

dow. Afterwards, the network is forced to output a response                                                                    fore can lead to stable and sequential activations of neurons

(ô(t) = 1) for Tresp time window.                                                                                             (Fig. 1B). The second mechanism relies on the generation

                                                                                                                               of limit cycles, which are defined as closed trajectories that

Two distinct mechanisms can subserve neural sequences–

                                                                                                                               represent sustained, periodic oscillations. In this mecha-

Broadly, we set out to study two latent mechanisms that may

                                                                                                                               nism, when the oscillation periods are much larger than the

subserve the observed neural sequences. The first mecha-

                                                                                                                               trial windows, neural sequences can emerge during the task

nism relies on the generation of a set of slow-points, neural

                                                                                                                               execution without repetition (Fig. 1C). But, once the task

states in which the neural dynamics vary slowly (ṙ(t) ≈ 0).

                                                                                                                               concludes, the limit cycles would continue to oscillate and

In this mechanism, neural sequences emerge during the slow

                                                                                                                               regenerate the sequential activities, whereas the slow-points

transition of the latent dynamical system through these slow-

                                                                                                                               are transitionary and would not repeat (Fig. 1B-C).





                                                                                                                           4


===== PDF PAGE 5 =====
                                  Dynamical phases of short-term memory mechanisms in RNNs



Since a minimum of two dimensions is required to generate               behavior within the task window, but can show distinct prop-

oscillatory behavior in dynamical systems (Strogatz, 2018),             erties outside; and the two mechanisms we identified belong

we start by studying the learned latent representations in an           to this class. For the rest of this work, we will formalize this

RNN with rank K = 2 (corresponding to two-dimensional                   connection between the learned latent mechanisms and the

latent dynamics). The output, ô(t), of the RNN is defined as           task and/or optimization parameters. In doing so, we will

a nonlinear projection of the latent variables using a sigmoid          generalize these findings beyond anecdotal observations via

function f (·). For the largest learning rate (Fig. 2A), this           theoretical investigations and large-scale experiments.

rank-2 RNN was incapable of solving the task despite the

nearly-zero gradient3 . As the learning rates decreased, it             3.2. Influence of task design on the learned mechanism

was capable of solving the task with limit cycles with a

moderate learning rate (Fig. 2B), but utilized slow-points              Behavioral experiments in systems neuroscience often con-

(also referred to as “SP manifolds” for generality) for the             tain arbitrary design choices that are deeply embedded in

lowest learning rate (Fig. 2C). Notably, both mechanisms                the experimental paradigm, yet their implications are rarely

produced neural activity sequences during the task window               scrutinized. Consider the delayed cue discrimination task, a

(Fig. 2, right panels).                                                 task commonly studied in neuroscience experiments with

                                                                        mice (Ebrahimi et al., 2022). In the machine learning con-

Despite leading to equivalent neural activities within the              text, it consists of four distinct periods (Fig. 1D-E): cue,

trial window, the two mechanisms had qualitatively different            delay, reaction, and an optional post-reaction period (i-iv).

behaviors after the trial concluded (Fig. 2). Limit cycles had          Upon observation of a cue, the networks have to wait for

led to recurrent generations of the same sequences, whereas             a brief period and output a response in the corresponding

the SP manifolds converged to a persistent activity style               output channel. Typically, there are two possible cues and

representation after the trial concludes. We will make this             hence two output channels. If there is a post-reaction period,

observation rigorous in our large-scale studies below. For              then the networks should learn to output zeros after the re-

now, we provide insights into another relevant question: Do             sponse window concludes. In experimental context, while

RNNs commit to learning one mechanism from the start, or                animals typically indicate their response by licking either

are they capable of changing their inner mechanisms during              a right or left spout, the reward or punishment is often di-

the training?                                                           rectly provided at the conclusion of the behavior without the

Learned latent mechanisms can evolve during learning–                   post-reaction window. The distinction, as we show below,

We next studied the latent dynamical systems of a rank-                 matters for the final learned solution.

2 RNN as it was training to solve the delayed activation                Minor modifications to the task requirements can change the

task (Fig. S1). Interestingly, the loss function showed                 learned mechanisms–We now set out to answer our second

characteristic periods of learning, corresponding to changes            question (i.e., Q2: What determines which mechanism is

in mechanisms (Fig. S1A). Specifically, after the first jump            favored under different task or training conditions?). To do

in the loss function, a SP manifold was formed in the latent            so, we perform a minor change to the delayed activation

dynamical system (Fig. S1B; left). Here, a line of slow-                task by requiring a short post-reaction waiting period and

points allowed the network output to stall until Tdelay . Then,         illustrate how minor changes in experimental design can

the SP manifold had acquired a curved structure (Fig. S1B;              fundamentally alter the mechanisms networks tend to learn

middle), reminiscing an onset to a rotating solution. Finally,          during training. In the modified delayed activation task,

after the oscillations in the loss function values ceased, a            (rank-2) RNNs are required to switch their responses at

limit cycle had emerged in the latent dynamical system (Fig.            the end of the response period and output zero for a brief

S1B; right). Hence, we confirmed that RNNs could change                 duration before the trial concludes (Fig. 1D-E). In networks

their inner mechanisms during learning, i.e., what started as           trained without this modification (Tpost = 0ms), the latent

a SP manifold solution later evolved into a limit cycle.                dynamical systems can learn both slow-point manifolds

In reality, since functional connections in the brain can               (for shorter delays) and limit-cycles (for longer delays),

rapidly reorganize within the start and end of a trial                  similar to Fig. 2. However, when we introduce even a

(Ebrahimi et al., 2022), the two mechanisms can become                  brief post-reaction period (Tpost = 30ms), the networks

practically inseparable in biological neural networks. In               predominantly learn limit cycle solutions, despite achieving

other words, there is an equivalence class of mechanisms                similar task performance (Fig. 3A-B). We quantified and

that can generate neural sequences that have the same local             confirmed these findings with a broader empirical study with

                                                                        1600 RNNs (Fig. 3C; via Fisher’s exact test with Bonferroni

    3

      This phenomenon has been studied in details by a previous         corrections). Thus, in rank-2 RNNs solving the delayed

work (Dinc et al., 2025b), in which the learning dynamics can           activation task, increasing the delay period promoted the

get stuck in no-learning zones with near-zero gradients when very

                                                                        emergence of limit cycle solutions, and this tendency was

large learning rates are used.

                                                                        dramatically amplified by the addition of a post-reaction



                                                                    5


===== PDF PAGE 6 =====
                                                          Dynamical phases of short-term memory mechanisms in RNNs



    A                Training a rank-2 RNN on                    B Fully trained network Fully trained network                                             C                         An empirical study with

                    two versions of the DA task                                                                                                                                    100 networks per condition

                                                                                         for Tpost = 0 ms             for Tpost = 30 ms    Trial start

                                                                                                                                                                               1              ***           **

                  100                                                                                                                     Response









                                                                                                                                                           Fraction of networks

Normalized loss









                                                                Activity of the second

function values









                                                                 latent variable(a.u.)









                                                                                                                                                             with full rotations

                                                                                                                                            start

                  10-1                                                                                                                    Trial end

                                    Tpost = 0 ms                                                                                          Latent state

                  10   -2

                                    Tpost = 30 ms                                                                                         (during trial)

                                                                                                                                          Latent state

                  10-3                                                                                                                     (after trial)

                                                                                                                                           Decision

                            100       102           104   106                                                                                                                  0

                                                                                                                                           boundary                                      40   60     80     100

                            Number of training epochs                                    Activity of the first latent variable (a.u.)                                                    Delay period (Tdelay)





Figure 3. Changing trivial task parameters may result in RNNs favoring limit cycle solutions. A We performed experiments similar

to those in Fig. 2, but now with an added post-reaction period (Tpost ). B Learned latent dynamics for the fully trained networks in panel

(A). Parameters for A-B: As in Fig. 2A, with Tdelay = 30ms, Tresp = 10ms, Tpost = 0 or 30ms, and α = 10−3 . C Fraction of networks

developing rotating solutions (i.e., limit cycles) when solving the two versions of the task as a function of delay Tdelay . Parameters:

α = 0.005, varying levels training epochs corresponding to Tdelay , otherwise the same as in panels A-B. Comparisons: Fisher’s exact test

with Bonferroni corrections, ∗∗∗ p < 0.001, and ∗∗ p < 0.01.



window. This demonstrated that seemingly minor changes                                                                 Earlier work has considered a one-dimensional toy system,

in the task design can favor learning distinct short-term                                                              the normal form of a saddle-node bifurcation, ẋ = x2 + r

memory maintenance mechanisms.                                                                                         (Strogatz, 2018), to study the learning dynamics of slow-

                                                                                                                       point formation (Dinc et al., 2025b). This system approx-

3.3. A theoretical scaling analysis of mechanistic phases                                                              imates the local behavior of one-dimensional flow maps

                                                                                                                       G(κ, u) near their minima, where slow-points (also ob-

So far, we used simple examples to demonstrate how RNNs                                                                served in Fig. 2) arise. To perform a similar analysis with

can use different latent mechanisms to generate neural se-                                                             the oscillatory dynamics observed in Figs. 2 and 3, we will

quences, that RNNs can change their inner mechanisms dur-                                                              consider a second toy model in this work: a two-dimensional

ing the course of their training, that the choice between these                                                        system exhibiting a limit cycle, one of the simplest settings

mechanisms is not random but depends on specifics of the                                                               in which periodic orbits, and hence oscillations, can emerge

experimental design. Now, to provide an answer to the third                                                            (Strogatz, 2018). Both toy models are meant to qualita-

question (i.e., Q3: How do the learned mechanisms vary                                                                 tively mirror the behavior of the respective latent flow maps

with delay duration?), we turn to a set of low-dimensional                                                             G(κ, u) that may be learned by an RNN (Fig. 2). While

dynamical models and study their learning dynamics.                                                                    these toy systems are not exhaustive, they capture key fea-

Why study low-dimensional toy models?–Recent work has                                                                  tures of the latent mechanisms that RNNs may converge

shown that training (full-rank) RNNs often converges to                                                                to, and allow us to dissect their learning dynamics in a

effectively low-dimensional solutions (Valente et al., 2022),                                                          controlled and analytical setting, which we discuss next.

a property that appears to generalize across many real-world                                                           Extracting scaling laws from toy models–To start with, in

networks (Thibeault et al., 2024). As discussed in Eq. (2),                                                            Appendix S2.1, we reproduce the findings of the earlier work

these low-dimensional computations can often be inter-                                                                 on slow-point manifolds for a more general version of the de-

preted as latent dynamical systems. In this view, training the                                                         layed activation task with Tdelay ̸= Tresp . This analysis re-

RNN parameters (W, W in , b) amounts to shaping a latent                                                               veals a maximum learning rate, also reported in (Dinc et al.,

flow map of the form:                                                                                                  2025b), beyond which the learning dynamics destabilize

                                                                                                                       and even an approximation of the desirable solution cannot

                                  τ κ̇(t) = G(κ(t), u(t); W, W in , b),                                     (3)

                                                                                                                       be reached. Our analysis reveals that this maximum learn-

                                                                                                                                                                              −βSP

where G governs the evolution of low-dimensional latent                                                                ing rate follows a power law such that αSP ∼ O(Tdelay       ),

variables κ(t) in response to input u(t). Hence, studying                                                              where βSP ∈ [4, 5]. The exact value βSP achieves within

how toy models, which do not necessarily share the same                                                                this interval depends whether Tdelay and Tresp are compara-

architectural assumptions as RNNs but still aim to learn                                                               ble, with larger delays leading to more substantial decreases

similar local dynamics, may provide intuition for how these                                                            (approaching βSP → 5 in the limit Tdelay ≫ Tresp ). Such a

flow maps may be learned. Thus, we set out to analyze                                                                  steep decrease with the desirable learning rate can explain

simple low-dimensional dynamical systems that capture the                                                              our anecdotal observations in Figs. 2 and 3C that slow-

two mechanisms (slow-points and limit cycles) we have                                                                  points become rarer for large Tdelay or high learning rates,

observed in trained RNNs.                                                                                              which will be substantiated in the next section.



                                                                                                                  6


===== PDF PAGE 7 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



Now, we focus on the limit cycle model. For simplicity,               (Figs. 1, 2, and S1), and therefore can offer further insights

we fix the radius to an attractive fixed-point, and allow a           into learning dynamics in more complicated architectures.

periodic oscillation in the frequency such that the equations         Below, we provide one example case, and show empirically

of the motion for the toy model become (See Appendix                  that similar phase spaces emerge in full-rank RNNs trained

S2.2 for derivations) x(t) = sin(2πrt), where r ∈ R is                on delayed cue discrimination tasks.

a learnable parameter. The network output is defined as

ô(x) = Θ(x < 0), where Θ(·) is defined as the Heaviside              3.4. Empirical scaling analyses of latent mechanisms

function. By inspection, the rotations have a half-period

of Thalf = 2r 1

                , and the model outputs zero for the first            As a final step, we tested the theoretical predictions of the

Thalf while outputting one for the second half. An example            toy models, including the proposed scaling laws and the

flow map is shown in Fig. S2A; changing the parameter, r,             phase space of latent mechanisms, by training full-rank

modulates the frequency/period of the cycle.                          RNNs on delayed cue-discrimination tasks (Figs. 4, S3, S4,

                                                                      and S5). Similar to low-rank RNNs, full-rank RNNs also

In Appendix S2.2, we compute an analytical loss function              learned to solve the task using two distinct mechanisms (Fig.

for the limit cycle model in the limits Tresp = Tdelay and            4A; Fig. S3A,B). Solutions involving sustained oscillations

Tresp ≪ Tdelay . We illustrate the latter case in Fig. S2B,           exhibited minimal power at low frequencies, as the dynam-

note the exact correspondence between the analytical curve            ics were dominated by high-frequency components (Fig.

and the numerical simulations. For both cases, the loss               S3C). Based on this observation, we developed a mecha-

                                             1

function has a global optimum at r = 2Tdelay     . However, it        nism discrimination index that automatically classified the

has a kink around the global minimum and quickly flattens             learned RNNs into three groups: (i) networks relying on

to a constant value for r ≤ 2(Tdelay1+Tresp ) . Hence, if the         slow-point manifolds, (ii) networks employing limit cycles,

learning rate is larger than some critical value, the oscilla-        and (iii) networks that failed to perform the task (see Fig.

tions around the global minimum can throw the parameter               S4 for representative examples).

r to a value r < 2(Tdelay1+Tresp ) , terminating the training

                                                                      Large-scale RNN experiments reproduced the toy model

process due to the zero gradient despite the fact that the            predictions–We then applied this classification to examine

model cannot solve the task. Our analysis reveals that this           whether different mechanisms consistently emerged across

                                                ∗        −βLC

maximum learning rate scales following αLC          ∼ Tdelay          varying delay durations. In line with theoretical predictions,

where βLC ∈ [2, 3]. Notably, given that βLC ≤ βSP , the               increasing the length of the delay period preferentially led to

limit cycle solution has a better scaling than the slow-point         the emergence of limit cycles (Fig. 4B). These oscillatory so-

one, providing a theoretical explanation for our observation          lutions disappeared beyond a critical learning rate for a given

in Fig. 2. Specifically, since the RNN in Fig. 2 was trained          delay, with the transition scaling as βLC = 2.72 ± 0.07 (Fig.

using a learning rate right at the transition (compare to Fig.        4C), in close agreement with predictions (see Fig. S3D-

S1), it is not surprising that a slow point mechanism even-           E for the procedure used to compute critical delays). For

tually evolved into a limit cycle. Moreover, this theoretical         shorter delays, RNNs predominantly developed slow-point

prediction is also consistent with the experiments in Fig. 3C,        manifolds, with the transition scaling as βSP = 4.05 ± 0.10,

where increasing the delay period for a fixed learning rate           also matching the theoretical range (Fig. S3). However,

resulted in more RNNs finding limit cycle based solutions.            when we trained RNNs on a modified task variant that in-

Hence, both learning rate and the duration of the delay can           cluded a post-reaction window, slow-point solutions were

influence the learned latent mechanism during training.               no longer observed, and only oscillatory dynamics emerged

Further insights from toy models– The distinct scaling of             (Fig. 4D-F). To summarize these transitions, we plotted

βLC and βSP also highlights the existence of an interest-             phase diagrams (Fig. 4G-I) derived from both the theoret-

ing phenomenon: a phase space of mechanisms that can be               ical model and the full-rank RNN experiments, capturing

learned by RNNs. This phase space (which will be discussed            the conditions under which each mechanism emerged and

in Fig. 4G) depends on the delay time (a task parameter)              their associated scaling laws.

and the learning rate (an optimization parameter). On the             Control experiments–Finally, we performed two additional

other hand, it is important to not over-interpret the toy model       control experiments. In Fig. S5, we repeated the analysis

results. Specifically, increasing the dimensionality of the           using RNNs with slower intrinsic dynamics (i.e., larger τ ),

latent dynamical system can allow more efficient solutions            and in Fig. S6, we tested a version of the task that no

to the task, and it may be possible for RNNs to utilize other         longer required memory maintenance. In the latter case,

(diverse) mechanisms for storing memories (e.g., those us-            the dependence on task duration nearly vanished, and the

ing inherent transient dynamics in high-dimensional neural            scaling observed in Fig. 4 was substantially weakened (β =

networks (Jaeger, 2002; Liu et al., 2025; Maass et al., 2002;         0.38 ± 0.02). These findings reinforce the idea that the

Ichikawa & Kaneko, 2021)). Fortunately, the toy models we             computational mechanisms adopted by RNNs are not fixed

discussed utilize mechanisms that are observed in practice



                                                                  7


===== PDF PAGE 8 =====
                                                             Dynamical phases of short-term memory mechanisms in RNNs



                                Scaling analysis in delayed cue discrimination tasks with no post-reaction period (Tpost = 0ms)

            A                                      Memory                 B                                                                                         C

                                                  mechanism                                                                                                                                                         Scaling of the

        Loss function values

                                                                                             1









                                                                          Fraction of RNNs

                                                  Not learned                                                                                                                                                    no-solution boundary









                                                                                                                                                                    Learning rates

                               0.1                                                                                                                                                        10-1

                                                  Limit cycle

                                                  SP manifold

                                                                                                                                                                                          10-2

                                                                                                                                                                                                            β = 2.72 ± 0.07,

                                                                                             0

                                                                                                                                                                                                           R2 = 0.98, p<10-3

                                0                                                                                                                                                         10         -3



                                      0                               1000                                     0               100         200          300   400                                     30             100          300

                                                Number of epochs                                                                         Delay (ms)                                                              Delay (ms)

                                Scaling analysis in delayed cue discrimination tasks with a post-reaction period (Tpost = 50ms)

                D                                                         E                                                                                         F

                                                                                                                                                                                                                     Scaling of the

                                                                                             1

       Loss function values









                                                                             Fraction of RNNs                                                                                                                     no-solution boundary









                                                                                                                                                                    Learning rates

                               0.1                                                                                                                                                        10-1





                                                                                                                                                                                          10-2

                                                                                                                                                                                                            β = 2.65 ± 0.23,

                                                                                                                                                                                                           R2 = 0.93, p<10-3

                               0                                                             0                                                                                            10-3

                                      0                               1000                                          0              100      200         300   400                             30                     100          300

                                                Number of epochs                                                                         Delay (ms)                                                              Delay (ms)

                                                                  Phases of learned short-term memory mechanisms

                 G                              Toy models                H                                                               Tpost = 0 ms              I                                           Tpost = 50 ms

                                                                                                 Learning rate (logscale)









                                                                                                                                                                         Learning rate (logscale)

                                                             Scaling curves                                                 10-1                                                                    10-1

                               10-3                        (phase boundaries)

           Learning rate









                                            Phase 3

                                           no learning           Slow point

                               10-5                              Limit cycle

                                                                                                                            10-2                                                                    10-2

                               10-7

                                      Phase 1        Phase 2

                                       both       Only limit cycles                                                         10-3                                                                    10-3

                               10-9

                                      0              200               400                                                         0              200         400                                          0         200         400

                                                                                                                                               Delay (ms)



Figure 4. Emergent phases of attractor mechanisms in RNNs performing delayed cue-discrimination. A Loss curves corresponding

to different memory mechanisms observed during training. B Distributions of learning rates and resulting memory mechanisms as a

function of the delay period. Each line represents a distinct learning rate; each run is initialized with a different random seed. C Power-law

fits shown on a log-log scale, where the y-axis indicates the maximum learnable delay and the x-axis the corresponding critical learning

rate. Each dot denotes the cutoff delay value beyond which learning fails (see Methods for how these values are estimated). D-F Same as

in panels A-C, but for tasks with post-reaction windows. G The phase diagram of mechanisms predicted by the toy model. H-I Phase

diagrams corresponding to panels B-E, where color intensity reflects the proportion of trials converging to each of the three dynamical

phases. As predicted by the theoretical analysis in G, the original task (H) reveals three distinct regimes, whereas the inclusion of a

post-reaction window (I) biases the model toward limit cycle dynamics. To generate these phase diagrams, we trained over 65,000 RNNs

across varying learning rates, delay intervals (Tdelay ), and random seeds (see Table S1). For full parameter details, refer to Section S4.



but shaped by the task’s demands. In particular, memory                                                                                        core components of the solutions. These sequences arose

duration, learning rate, and structural constraints (refer to                                                                                  through two distinct mechanisms: slow-point manifolds and

Q3 above) jointly determine the preferred mechanism.                                                                                           limit cycles. While the use of slow-points to approximate

                                                                                                                                               sequences is well aligned with prior intuitions (Khona &

4. Discussion                                                                                                                                  Fiete, 2022), the emergence of limit cycles in this context

                                                                                                                                               represents a novel prediction of our framework. Although

In this work, we set out to answer three fundamental ques-                                                                                     limit cycles have previously been observed in memory tasks

tions about the population-level mechanisms that can sup-                                                                                      (Pals et al., 2024), they typically appear when periodicity is

port short-term memory in neural networks.                                                                                                     embedded in the task design. In contrast, the delayed activa-

                                                                                                                                               tion and delayed cue-discrimination tasks used here had no

What mechanisms support memory maintenance through

                                                                                                                                               explicit periodic components. Thus, the appearance of limit

sequential neural activity? In the memory tasks studied

                                                                                                                                               cycles in these tasks suggests an alternative, previously un-

here, neural activation sequences consistently emerged as



                                                                                                                                           8


===== PDF PAGE 9 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



derappreciated, mechanism for generating sustained neural            date longer memory spans can complicate optimization and

sequences in the absence of external rhythmic input or an            destabilize learning (Dinc et al., 2025b). Unlike biological

oscillatory output.                                                  systems, which operate under biophysical constraints such

                                                                     as membrane time constants and action potentials, artifi-

What determines which mechanism is favored under dif-

                                                                     cial networks must learn timescales through training, which

ferent memory tasks or training conditions? Our analyti-

                                                                     is not always possible even if the underlying network is

cal results revealed that the selection between slow-point

                                                                     theoretically capable of solving a particular task.

manifolds and limit cycles depended on both the structure

of the task and the learning rate used in the optimization.          Overall, by framing the challenge through dynamical sys-

We later confirmed these predictions in large-scale simu-            tems theory, our work highlights a core trade-off between

lations using full-rank RNNs (Table S1). This finding is             memory duration, learning speed, and network stability. Un-

particularly striking in light of recent interest in dynamical       derstanding this trade-off offers a principled explanation for

systems approaches in neuroscience, where considerable               the persistent difficulty of learning long-term dependencies

effort has gone into identifying and manipulating attractors         and opens the door to new strategies that balance biological

and manifolds that underlie neural activity (Liu et al., 2024;       plausibility, computational efficiency, and learning perfor-

Vinograd et al., 2024). The sharp divergence in dynam-               mance.

ical solutions (slow-points versus limit cycles) emerging

                                                                     Concluding remarks—Our findings carry important impli-

from minor changes in task design underscores a critical

                                                                     cations for experimental neuroscience. We have shown

point: the structure of the task can strongly shape the neural

                                                                     that both slow-points and limit cycles can serve as effec-

dynamics that emerge.

                                                                     tive mechanisms for generating sequential neural activity.

This raises important questions about how we interpret dy-           However, in the context of a dynamic brain, where synap-

namical structures observed in neural recordings. Can we             tic plasticity continually reshapes functional connectivity

conclude that one type of solution is more fundamental than          (Ebrahimi et al., 2022), it remains unclear how to determine

another simply because it appears in a specific task variant?        whether observed sequences are supported by slow-points

Our findings highlight the need for caution. They suggest            or limit cycles. More broadly, how can we distinguish be-

that conclusions about the nature of neural computations             tween dynamical solutions that produce equivalent activity

must be grounded not only in observed dynamics but also              patterns during a trial, but diverge in their behavior once

in a careful analysis of how task parameters may constrain           the trial ends? To our knowledge, this question (concerning

or bias the underlying solutions. What may appear to be a            equivalence of distinct latent mechanisms subserving task

core computational motif could, in fact, reflect a contingent        execution, but later diverging after the task conclusion) has

outcome of the task design itself.                                   not been explicitly addressed in experimental designs within

                                                                     systems neuroscience. Tackling it would require a shift in

How do the learned mechanisms vary with the delay dura-

                                                                     how experiments are conceptualized and conducted. As a

tion? A key insight into this question comes from exam-

                                                                     starting point, our work illustrates how (even minor) ma-

ining how critical learning rates (beyond which learning

                                                                     nipulations of task structure can lead to distinct underlying

ceases to be effective) scale with delay length. In simple

                                                                     mechanisms.

delayed-response tasks, we found that the critical learning

rate allowing successful training decreases as a power-law           Beyond neuroscience, the phenomenon of staged learning

function of the delay. As the delay increases, smaller and           dynamics and algorithmic phase transitions has been widely

smaller updates are required, ultimately making training             documented in artificial neural networks, including Trans-

impractically slow for long durations. This constraint may           formers trained on modular arithmetic (Liu et al., 2022;

underlie the historical difficulty of capturing long-term de-        Nanda et al., 2023), language modeling (Wei et al., 2022;

pendencies in RNNs, as highlighted in early work (Bengio             Lubana et al., 2024), and in-context learning (Raventós et al.,

et al., 1994).                                                       2024). Within this growing literature, our study of RNNs

                                                                     provides a complementary perspective, grounded in dynam-

The introduction of gated architectures such as LSTMs and

                                                                     ical systems theory, that connects computational behavior

GRUs partially addressed this issue by enabling networks

                                                                     to interpretable latent mechanisms. Recent efforts aim to

to learn adaptive timescales (Hochreiter, 1997). These ar-

                                                                     formalize learning progress in feedforward networks using

chitectures could perhaps bypass the power-law constraint

                                                                     quantities analogous to order parameters in physics (Park

by dynamically modulating their internal time-scales, and

                                                                     et al., 2024). Our results go a step further by identifying

thereby extend their memory retention periods. However,

                                                                     literal phase transitions between qualitatively distinct com-

even if successful, this flexibility would lead to trade-offs.

                                                                     putational strategies in dynamical systems. Future work

Extending timescales indefinitely slows down network re-

                                                                     may explore how these mechanisms can be implemented or

sponses, limiting their utility for rapid decision-making.

                                                                     approximated by feedforward architectures.

In addition, expanding the parameter space to accommo-



                                                                 9


===== PDF PAGE 10 =====
                               Dynamical phases of short-term memory mechanisms in RNNs



Acknowledgements                                                       intraparietal area. i. temporal properties; comparison with

                                                                       area 7a. Journal of neurophysiology, 66(3):1095–1108,

We would like to thank members of the Geometric Intelli-               1991.

gence Lab for their helpful feedback on an earlier version

of the project and Dr. Boris Shraiman for fruitful discus-           Bengio, Y., Simard, P., and Frasconi, P. Learning long-term

sions on the final manuscript. EC and BK’s internships were            dependencies with gradient descent is difficult. IEEE

supported in part by a grant from the Feldman-McClelland               transactions on neural networks, 5(2):157–166, 1994.

Open-a-Door fund of the Pittsburgh Foundation. BK thanks

the Impact Scholarship and Research Scholarship for Crit-            Bondi, M. W., Edmonds, E. C., and Salmon, D. P.

ical Thinkers programs from the Bridge to Turkiye Funds                Alzheimer’s disease: past, present, and future. Journal of

for supporting his visit to Stanford University. FD expresses          the International Neuropsychological Society, 23(9-10):

gratitude for the valuable mentorship he received at PHI Lab           818–831, 2017.

during his internship at NTT Research and acknowledges

funding from Stanford University’s Mind, Brain, Compu-               Brennan, C. and Proekt, A. Attractor dynamics with activity-

tation and Technology program, which is supported by the               dependent plasticity capture human working memory

Stanford Wu Tsai Neuroscience Institute.. MJS gratefully               across time scales. Communications psychology, 1(1):28,

acknowledges funding from the Simons Collaboration on                  2023.

the Global Brain and the Vannevar Bush Faculty Fellow-

                                                                     Cavanagh, S. E., Towers, J. P., Wallis, J. D., Hunt, L. T., and

ship Program of the U.S. Department of Defense. NM ac-

                                                                       Kennerley, S. W. Reconciling persistent and dynamic hy-

knowledges funding from the National Science Foundation,

                                                                       potheses of working memory coding in prefrontal cortex.

award 2313150. PY was additionally supported by the Foun-

                                                                       Nature communications, 9(1):3498, 2018.

dation of the Shanghai Municipal Education Commission

(No. 24RGZNA01). This research was supported in part by              Chung, J., Gulcehre, C., Cho, K., and Bengio, Y. Empirical

grant NSF PHY-2309135 and the Gordon and Betty Moore                   evaluation of gated recurrent neural networks on sequence

Foundation Grant No. 2919.02 to the Kavli Institute for                modeling. arXiv preprint arXiv:1412.3555, 2014.

Theoretical Physics (KITP). Some of the computing for this

project was performed on the Sherlock cluster. We would              Constantinidis, C. and Klingberg, T. The neuroscience of

like to thank Stanford University and the Stanford Research            working memory capacity and training. Nature Reviews

Computing Center for providing computational resources                 Neuroscience, 17(7):438–449, 2016.

and support that contributed to these research results.

                                                                     Curtis, C. E. and D’Esposito, M. Persistent activity in the

                                                                       prefrontal cortex during working memory. Trends in

Impact Statement                                                       cognitive sciences, 7(9):415–423, 2003.

This paper contributes to machine learning and computa-

                                                                     Dinc, F., Shai, A., Schnitzer, M., and Tanaka, H. CORNN:

tional neuroscience by making an unprecedented number

                                                                       Convex optimization of recurrent neural networks for

of trained RNNs publicly available—models that required

                                                                       rapid inference of neural dynamics. In Thirty-seventh

several weeks of compute time to generate.

                                                                       Conference on Neural Information Processing Systems,

                                                                       2023. URL https://openreview.net/forum?

References                                                             id=GGIA1p9fDT.

Atkinson, R. C. and Shiffrin, R. M. Human memory: A                  Dinc, F., Blanco-Pozo, M., Klindt, D., Acosta, F., Jiang, Y.,

  proposed system and its control processes. Psychology of             Ebrahimi, S., Shai, A., Tanaka, H., Yuan, P., Schnitzer,

  Learning and Motivation, 1968.                                       M. J., et al. Latent computing by biological neural net-

Baddeley, A. D. and Hitch, G. Working memory. vol-                     works: A dynamical systems framework. arXiv preprint

  ume 8 of Psychology of Learning and Motivation, pp.                  arXiv:2502.14337, 2025a.

  47–89. Academic Press, 1974. doi: https://doi.org/10.

                                                                     Dinc, F., Cirakman, E., Jiang, Y., Yuksekgonul, M.,

  1016/S0079-7421(08)60452-1.

                                                                       Schnitzer, M. J., and Tanaka, H. A ghost mechanism:

Baeg, E., Kim, Y., Huh, K., Mook-Jung, I., Kim, H., and                An analytical model of abrupt learning. arXiv preprint

  Jung, M. Dynamics of population code for working mem-                arXiv:2501.02378, 2025b.

  ory in the prefrontal cortex. Neuron, 40(1):177–188,

  2003.                                                              Dubreuil, A., Valente, A., Beiran, M., Mastrogiuseppe, F.,

                                                                       and Ostojic, S. The role of population structure in com-

Barash, S., Bracewell, R. M., Fogassi, L., Gnadt, J. W., and           putations through neural dynamics. Nature Neuroscience,

  Andersen, R. A. Saccade-related activity in the lateral              pp. 1–12, 2022.



                                                                10


===== PDF PAGE 11 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



Ebrahimi, S., Lecoq, J., Rumyantsev, O., Tasci, T., Zhang,            Laje, R. and Buonomano, D. V. Robust timing and motor

  Y., Irimia, C., Li, J., Ganguli, S., and Schnitzer, M. J.             patterns by taming chaos in recurrent neural networks.

  Emergent reliability in sensory cortical coding and inter-            Nature neuroscience, 16(7):925–933, 2013.

  area communication. Nature, 605(7911):713–721, 2022.

                                                                      Lee, J. and Park, S. Working memory impairments in

Finkelstein, A., Fontolan, L., Economo, M. N., Li, N., Ro-              schizophrenia: a meta-analysis. Journal of abnormal

  mani, S., and Svoboda, K. Attractor dynamics gate cor-                psychology, 114(4):599, 2005.

  tical information flow during decision-making. Nature

  Neuroscience, 24(6):843–850, 2021.                                  Liu, C., Jia, S., Liu, H., Zhao, X., Li, C. T., Xu, B., and

                                                                        Zhang, T. Recurrent neural networks with transient tra-

Fuster, J. M. and Alexander, G. E. Neuron activity related to           jectory explain working memory encoding mechanisms.

  short-term memory. Science, 173(3997):652–654, 1971.                  Communications Biology, 8(1):137, 2025.

Geiger, J. R., Lübke, J., Roth, A., Frotscher, M., and Jonas,        Liu, M., Nair, A., Coria, N., Linderman, S. W., and An-

  P. Submillisecond ampa receptor-mediated signaling at                 derson, D. J. Encoding of female mating dynamics by a

  a principal neuron–interneuron synapse. Neuron, 18(6):                hypothalamic line attractor. Nature, pp. 1–3, 2024.

 1009–1023, 1997.

                                                                      Liu, Z., Michaud, E. J., and Tegmark, M. Omnigrok:

Gnadt, J. W. and Andersen, R. A. Memory related motor                   Grokking beyond algorithmic data. In The Eleventh Inter-

  planning activity in posterior parietal cortex of macaque.            national Conference on Learning Representations, 2022.

 Experimental brain research, 70:216–220, 1988.

                                                                      Lubana, E. S., Kawaguchi, K., Dick, R. P., and Tanaka,

Harrison, S. A. and Tong, F. Decoding reveals the contents              H. A percolation model of emergence: Analyzing trans-

  of visual working memory in early visual areas. Nature,               formers trained on a formal language. arXiv preprint

  458(7238):632–635, 2009.                                              arXiv:2408.12578, 2024.

Harvey, C. D., Coen, P., and Tank, D. W. Choice-specific              Maass, W., Natschläger, T., and Markram, H. Real-time

  sequences in parietal cortex during a virtual-navigation             computing without stable states: A new framework for

  decision task. Nature, 484(7392):62–68, 2012.                        neural computation based on perturbations. Neural com-

Hochreiter, S. Long short-term memory. Neural Computa-                 putation, 14(11):2531–2560, 2002.

  tion MIT-Press, 1997.

                                                                      Mante, V., Sussillo, D., Shenoy, K. V., and Newsome, W. T.

Ichikawa, K. and Kaneko, K. Short-term memory by tran-                 Context-dependent computation by recurrent dynamics

  sient oscillatory dynamics in recurrent neural networks.             in prefrontal cortex. nature, 503(7474):78–84, 2013.

  Physical Review Research, 3(3):033193, 2021.

                                                                      Masse, N. Y., Yang, G. R., Song, H. F., Wang, X.-J., and

Isokawa, M. Membrane time constant as a tool to assess cell            Freedman, D. J. Circuit mechanisms for the maintenance

   degeneration. Brain Research Protocols, 1(2):114–116,               and manipulation of information in working memory.

  1997.                                                                Nature neuroscience, 22(7):1159–1167, 2019.



Jaeger, H. Adaptive nonlinear system identification with              McCormick, D. A., Connors, B. W., Lighthall, J. W., and

  echo state networks. Advances in neural information                  Prince, D. A. Comparative electrophysiology of pyrami-

  processing systems, 15, 2002.                                        dal and sparsely spiny stellate neurons of the neocortex.

                                                                       Journal of neurophysiology, 54(4):782–806, 1985.

Jonas, P., Major, G., and Sakmann, B. Quantal components

  of unitary epscs at the mossy fibre synapse on ca3 pyrami-          Meyers, E. M., Freedman, D. J., Kreiman, G., Miller, E. K.,

  dal cells of rat hippocampus. The Journal of physiology,             and Poggio, T. Dynamic population coding of category

  472(1):615–663, 1993.                                                information in inferior temporal and prefrontal cortex.

                                                                       Journal of neurophysiology, 100(3):1407–1419, 2008.

Khona, M. and Fiete, I. R. Attractor and integrator networks

  in the brain. Nature Reviews Neuroscience, 23(12):744–              Miles, R. Synaptic excitation of inhibitory cells by single

  766, 2022.                                                           ca3 hippocampal pyramidal cells of the guinea-pig in

                                                                       vitro. The Journal of physiology, 428(1):61–77, 1990.

Kozachkov, L., Tauber, J., Lundqvist, M., Brincat, S. L.,

  Slotine, J.-J., and Miller, E. K. Robust and brain-like             Mongillo, G., Barak, O., and Tsodyks, M. Synaptic theory

  working memory through short-term synaptic plasticity.               of working memory. Science, 319(5869):1543–1546,

  PLoS computational biology, 18(12):e1010776, 2022.                   2008.



                                                                 11


===== PDF PAGE 12 =====
                               Dynamical phases of short-term memory mechanisms in RNNs



Nanda, N., Chan, L., Lieberum, T., Smith, J., and Stein-             Spaak, E., Watanabe, K., Funahashi, S., and Stokes, M. G.

  hardt, J. Progress measures for grokking via mechanistic             Stable and dynamic coding for working memory in pri-

  interpretability. arXiv preprint arXiv:2301.05217, 2023.             mate prefrontal cortex. Journal of neuroscience, 37(27):

                                                                       6503–6516, 2017.

Pals, M., Macke, J. H., and Barak, O. Trained recurrent

  neural networks develop phase-locked limit cycles in a             Stokes, M. G. ‘activity-silent’working memory in prefrontal

  working memory task. PLOS Computational Biology, 20                  cortex: a dynamic coding framework. Trends in cognitive

  (2):e1011852, 2024.                                                  sciences, 19(7):394–405, 2015.

Park, C. F., Lubana, E. S., Pres, I., and Tanaka, H. Compe-          Strogatz, S. H. Nonlinear dynamics and chaos: with appli-

  tition dynamics shape algorithmic phases of in-context               cations to physics, biology, chemistry, and engineering.

  learning. arXiv preprint arXiv:2412.01003, 2024.                     CRC press, 2018.

Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E.,           Stroud, J. P., Duncan, J., and Lengyel, M. The computa-

  DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., and Lerer,           tional foundations of dynamic coding in working memory.

  A. Automatic differentiation in pytorch. In 31st Confer-             Trends in Cognitive Sciences, 2024.

  ence on Neural Information Processing Systems, 2017.

                                                                     Sussillo, D. and Barak, O. Opening the black box: low-

Perich, M. G. and Rajan, K. Rethinking brain-wide interac-             dimensional dynamics in high-dimensional recurrent neu-

  tions through multi-region ‘network of networks’ models.             ral networks. Neural computation, 25(3):626–649, 2013.

  Current opinion in neurobiology, 65:146–151, 2020.

                                                                     Thibeault, V., Allard, A., and Desrosiers, P. The low-rank

Perich, M. G., Arlt, C., Soares, S., Young, M. E., Mosher,             hypothesis of complex systems. Nature Physics, pp. 1–9,

  C. P., Minxha, J., Carter, E., Rutishauser, U., Rudebeck,            2024.

  P. H., Harvey, C. D., et al. Inferring brain-wide inter-

  actions using data-constrained recurrent neural network            Todd, J. J. and Marois, R. Capacity limit of visual short-

  models. bioRxiv, pp. 2020–12, 2021.                                  term memory in human posterior parietal cortex. Nature,

                                                                       428(6984):751–754, 2004.

Rajan, K., Harvey, C. D., and Tank, D. W. Recurrent net-

  work models of sequence generation and memory. Neu-                Valente, A., Pillow, J. W., and Ostojic, S. Extracting com-

  ron, 90(1):128–142, 2016.                                            putational mechanisms from neural data using low-rank

                                                                       rnns. Advances in Neural Information Processing Sys-

Raventós, A., Paul, M., Chen, F., and Ganguli, S. Pretrain-

                                                                       tems, 35:24072–24086, 2022.

  ing task diversity and the emergence of non-bayesian

  in-context learning for regression. Advances in Neural             Vaswani, A. Attention is all you need. Advances in Neural

  Information Processing Systems, 36, 2024.                            Information Processing Systems, 2017.

Schäfer, A. M. and Zimmermann, H. G. Recurrent neural               Vinograd, A., Nair, A., Kim, J., Linderman, S. W., and An-

  networks are universal approximators. In Artificial Neural           derson, D. J. Causal evidence of a line attractor encoding

  Networks–ICANN 2006: 16th International Conference,                  an affective state. Nature, pp. 1–3, 2024.

  Athens, Greece, September 10-14, 2006. Proceedings,

  Part I 16, pp. 632–640. Springer, 2006.                            Walker, E. Y., Sinz, F. H., Cobos, E., Muhammad, T.,

                                                                      Froudarakis, E., Fahey, P. G., Ecker, A. S., Reimer, J.,

Scott, J. C., Matt, G. E., Wrocklage, K. M., Crnich, C., Jor-         Pitkow, X., and Tolias, A. S. Inception loops discover

  dan, J., Southwick, S. M., Krystal, J. H., and Schweins-            what excites neurons most using deep predictive models.

  burg, B. C. A quantitative meta-analysis of neurocogni-             Nature neuroscience, 22(12):2060–2065, 2019.

  tive functioning in posttraumatic stress disorder. Psycho-

  logical bulletin, 141(1):105, 2015.                                Wang, X.-J. 50 years of mnemonic persistent activity: quo

                                                                      vadis? Trends in Neurosciences, 44(11):888–902, 2021.

Serences, J. T. Neural mechanisms of information storage

  in visual short-term memory. Vision research, 128:53–67,           Wei, J., Tay, Y., Bommasani, R., Raffel, C., Zoph, B.,

  2016.                                                               Borgeaud, S., Yogatama, D., Bosma, M., Zhou, D., Met-

                                                                      zler, D., et al. Emergent abilities of large language models.

Sommer, F. T. and Wennekers, T. Synfire chains with                   arXiv preprint arXiv:2206.07682, 2022.

  conductance-based neurons: internal timing and coordina-

  tion with timed input. Neurocomputing, 65-66:449–454,              Yang, G. R., Joglekar, M. R., Song, H. F., Newsome, W. T.,

  2005. ISSN 0925-2312. doi: https://doi.org/10.1016/                  and Wang, X.-J. Task representations in neural networks

  j.neucom.2004.10.015. Computational Neuroscience:                    trained to perform many cognitive tasks. Nature neuro-

  Trends in Research 2005.                                             science, 22(2):297–306, 2019.



                                                                12


===== PDF PAGE 13 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



Methods

S1. Theoretical details on attractor mechanisms subserving short-term memory

S1.1. A short background on dynamical system theory

A dynamical system describes how the state of a system evolves over time. Formally, it can be represented by a differential

equation of the form:

                                            ẋ(t) = f (x(t)), x(t0 ) = x0 ,

where x0 denotes the initial state, and ẋ represents the time derivative of the state variable x ∈ Rn .

In neuroscience, researchers often examine neural firing rates r ∈ Rn through the lens of dynamical systems. This approach

helps uncover how temporal dynamics unfold within lower-dimensional neural state spaces, as characterized by dynamical

systems theory.

Since firing rates are themselves components of the system’s state, in this study we simulate such systems using leaky

firing-rate RNNs—biologically interpretable neural networks. One might argue that RNNs may not be expressive enough to

learn such complex dynamics and that more sophisticated architectures like Long Short-Term Memory networks (LSTMs)

or Transformers might perform better. However, this concern is addressed by the universal approximation property of RNNs,

which states that, given a sufficient number of neurons, even vanilla RNNs can approximate any dynamical system (Schäfer

& Zimmermann, 2006). Additionally, compared to more complex models, RNNs offer greater interpretability due to their

simpler and shallower architecture.

As previously mentioned, neuroscientists often study neural activity through the lens of attractor dynamics. In this framework,

researchers analyze how systems evolve over time by characterizing their underlying attractor structures. As we focus on

several commonly studied attractors from dynamical systems theory (Strogatz, 2018), we describe the fixed-point attractors,

slow-point manifolds, and limit cycles below.



Fixed-Point Attractors: In a fixed-point attractor, the system evolves toward a specific state where it remains indefinitely.

Once the state is reached, the time derivative becomes zero, i.e., ẋ = 0.



Slow-Point Manifolds: Slow-point manifolds are particularly relevant to memory-related mechanisms in neuroscience.

These manifolds describe regions of the state space where the system changes very slowly, satisfying ẋ ≈ 0. Unlike fixed

points, which trap the system, slow points allow it to persist along a trajectory over time. This property enables the system

to maintain information temporarily, as illustrated in Fig. S4D.



Limit Cycle Attractors: Limit cycle attractors describe systems that exhibit sustained oscillatory behavior. These

trajectories form closed loops in state space and are often associated with rhythmic or repeated tasks. In such cases, ẋ ̸= 0,

as shown in Fig. S4C. However, as demonstrated in our experiments, limit cycles can closely approximate slow-point

manifolds during the trial period.

Importantly, a single dynamical system may contain multiple attractor types, and the specific trajectory it follows can depend

on the initial condition x0 . Nonetheless, identifying and understanding these fundamental attractor structures is essential for

uncovering the mechanisms underlying neural population dynamics.



S2. Theoretical studies of scaling relationships via toy models

In this section, we provide the additional details and calculations regarding the toy models we introduced in the main text.



S2.1. The ghost model

The first model we considered is the ghost model, which effectively forms a slow point that can be used to store the duration

of the delay before the network takes an action. This model was introduced in a prior work (Dinc et al., 2025b), whose

results we briefly summarize below. Then, we generalize the methodology introduced in the earlier work, which we will

eventually use to study the additional toy models we introduced in this work.



                                                              13


===== PDF PAGE 14 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



S2.1.1. S UMMARY OF THE PREVIOUS WORK

The toy model starts with a one-dimensional dynamical system:



                                                      τ ẋ(t) = x2 (t) + r,                                                 (S1)



where x ∈ R is the state variable and r ∈ R is a learnable parameter. Here, τ is a fixed time scale, which we effectively set

to one such that time is computed in dimensionless units (in units of τ ). This system is very well known in the traditional

dynamical system theory literature as the standard form for√ the saddle-node bifurcation (Strogatz, 2018). Specifically, for

r < 0, the dynamical system has two fixed points x∗ = ± −r, the one on the left being attractive and the other repulsive.

However, for r > 0, the system has no fixed-points. Hence, a “saddle-node bifurcation” is said to take place as r is varied

between positive and negative values (Strogatz, 2018). Since local minima of most functions can be approximated by a

quadratic term, this is considered the standard form for the saddle-node bifurcation and can be used to approximate the

emergence/collusion of two fixed-points.

Though traditional work often focuses on changes as r is varied by hand, (Dinc et al., 2025b) has taken an alternative

approach and considered learning this parameter through a task. Specifically, the output of the network is defined as

ô(x) = Θ(x − x∗ ), where Θ(·) is the Heaviside function and x∗ is some fixed-parameter (which is later taken to ∞ in

analytical calculations). The model is initialized at x(t = 0) = 0. Then, the goal of the model is to output 0 until some time

T and then 1 for another T times. In mathematical terms, o(t) = Θ(t − T ). Unlike the prior work (Dinc et al., 2025b),

since our goal is to understand the scaling of the effective learning rates with respect to the delay period lengths, we define a

normalized loss function as:

                                                       1 2T

                                                         Z

                                             L(r) =            (ô(x(t)) − o(t))2 dt.                                        (S2)

                                                      T 0

It is possible to compute this loss function exactly in the limit x∗ → ∞, which is as follows (Dinc et al., 2025b):

                                                                                   ∗

                                                     (

                                                         1 − 2Tπ√r    for     r ≥ r4 ,

                                            L(r) =                                                                          (S3)

                                                         1            otherwise.

                                                             2

This loss function achieves the global minimum at r∗ = 4T

                                                        π                 ∗

                                                          2 such that L(r ) = 0. One can compute the analytical gradient



as:

                                                                  π2          π2

                                                

                                                      π

                                                − 4T r3/2 for 16T 2 <2 r < 4T 2 ,

                                                

                                       ∇L(r) = 4T rπ3/2      for r > 4Tπ

                                                                         2,                                         (S4)

                                                                       π2

                                                

                                                  0          for r < 16T 2 .

                                                



                                    2

                                  π

Here, the zero gradient for r < 16T  2 is practically undesirable, since the loss function is still quite high. This flat region,



also observed in other toy models of our interest, is referred to as a “no learning zone.” Once a model is caught in this region,

there is no returning back.

Moreover, in this toy model, an interesting phenomenon emerges around the global minimum. Specifically, the derivative at

          π2

r = r∗ = 4T 2 becomes:

                                                            (      2

                                             π2               − 2T

                                                                 π2   from the left,

                                   At r =      2

                                                 : ∇L(r) =    2T 2                                                  (S5)

                                            4T                 π2     from the right.

These expressions differ from (Dinc et al., 2025b) only in the sense that the normalization of the loss function introduces a

(T )−1 coefficient to the gradient computation. Notably, this loss function has a kink at its global optimum. Thanks to this

kink, (Dinc et al., 2025b) has defined a maximum (effective) learning rate α∗ , for any α > α∗ , the model would be thrown

from the global minimum to the zero gradient regime, after which the learning would come to an halt despite a non-desirable

loss value of 1. This learning rate can be computed as:



                                   ∗                          3π 2      ∗      3π 4 −4

                                  αghost |∇L(r)|r→r∗ =             =⇒ αghost =     T .                                      (S6)

                                                      +      16T 2              32

Thus, for a normalized loss function, the effective learning rate for the ghost point toy model scales following O(T −4 ).

Below, we extend this toy model with asymmetric response (Tresp ) and delay (Tdelay ) times.



                                                                 14


===== PDF PAGE 15 =====
                                          Dynamical phases of short-term memory mechanisms in RNNs



S2.1.2. G HOST MODEL WITH ASYMMETRIC RESPONSE TIME

For the problem of our interest, we simply replace the loss function with:

                                                Z Tdelay                                                      Z Tdelay +Tresp

                                          1                                                2           1

                       L(r) =                                  (ô(x(t)) − 0) dt +                                                  (ô(x(t)) − 1)2 dt,

                                     Tdelay      0                                                   Tresp Tdelay

                                                Z Tdelay                                            Z Tdelay +Tresp                                                        (S7)

                                          1                                                    1

                                =                              ô(x(t)) dt +                                               [1 − ô(x(t))] dt,

                                     Tdelay      0                                         Tresp     Tdelay



As shown by previous work (Dinc et al., 2025b) (by integrating the dynamical system equations), in the limit x∗ → ∞,

the network output can be written as ô(t) = Θ(t − t∗ ), where t∗ = 2√   π

                                                                           r

                                                                             . This creates three distinct regimes of analytical

                 ∗                         ∗

calculation: i) t ≤ Tdelay , ii) Tdelay ≤ t ≤ Tdelay + Tresp , and iii) Tdelay + Tresp ≤ t∗ .

                                                                                       2

Let us start with the first case, t∗ ≤ Tdelay (i.e., r ≥ 4Tπ2                                  ):

                                                                                    delay



                                    Z t∗                                         Z Tdelay                                       Z Tdelay +Tresp

                           1                                         1                                                 1

             L(r) =                        ô(x(t)) dt +                                        ô(x(t)) dt +                                     [1 − ô(x(t))] dt,

                       Tdelay        0                   Tdelay                   t∗                               Tresp         Tdelay

                       |                 {z          }

                                                                                                                                                                           (S8)

                                                                                                                   |                       {z                       }

                                         =0                                                                                                =0

                                    Z Tdelay                             ∗

                         1                                           t            π

                   =                            dt = 1 −                  =1−        √ .

                       Tdelay        t∗                            Tdelay     2Tdelay r



                                                                                                                            2                           2

Next, we consider the second case, Tdelay ≤ t∗ ≤ Tdelay + Tresp (i.e., 4(Tdelayπ+Tresp )2 ≤ r ≤ 4Tπ2                                                           ):

                                                                                                                                                       delay



                            Z Tdelay                                         Z t∗                                                  Z Tdelay +Tresp

                       1                                1                                                                    1

         L(r) =                         ô(x(t)) dt +                                      [1 − ô(x(t))] dt +                                       [1 − ô(x(t))] dt,

                   Tdelay       0                     Tresp                      Tdelay                                    Tresp     t∗

                   |                 {z           }                                                                        |                      {z                 }

                                     =0                                                                                                           =0                       (S9)

                           Z t∗                       ∗

                     1                           t      Tdelay       π    T

               =                         dt =         −        =       √ − delay .

                   Tresp       Tdelay           Tresp   Tresp    2Tresp r  Tresp



                                                                                                                   2

Finally, we consider the third case, Tdelay + Tresp ≤ t∗ (i.e., r ≤ 4(Tdelayπ+Tresp )2 ):

                                                          Z Tdelay                                         Z Tdelay +Tresp

                                                1                                  1

                               L(r) =                              ô(x(t)) dt +                                                 [1 − ô(x(t))] dt

                                              Tdelay       0                     Tresp                      Tdelay

                                              |                 {z           }

                                                                =0                                                                                                        (S10)

                                                      Z Tdelay +Tresp

                                                1

                                          =                                       dt = 1.

                                              Tresp       Tdelay





Bringing all these cases together, the loss function becomes:

                                                                                                                      2

                                     

                                       1                  for                                      r ≤ 4(Tdelayπ+Tresp )2 ,

                                                                                                               2

                                                                                                                               π2

                                                   Tdelay

                                            π √                                                            π

                            L(r) = 2Tresp r − Tresp for                                             4(Tdelay +Tresp )2 ≤ r ≤ 4Tdelay

                                                                                                                               2     ,                                    (S11)

                                                                                                            2

                                                π √

                                     1 −                  for                                      r ≥ 4Tπ2 .

                                     

                                                            2Tdelay          r                              delay





                                                                                                                                                        2

Firstly, we note that this loss function is continuous and achieves its global minimum at r∗ = 4Tπ2    such that L(r∗ ) = 0.

                                                                                                 delay

We can once again compute the derivative near the global minimum:

                                                                       3

                                             π2                 − 2Tdelay     from the left,

                                                                     Tresp π 2

                                  At r =      2    : ∇L(r) = 2T 2                                                     (S12)

                                          4Tdelay                delay        from the right.         π2





                                                                                               15


===== PDF PAGE 16 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



Similar to before, one can compute the critical learning rate due to the kink at the global optimum. First, noting rb =

       π2

4(Tdelay +Tresp )2 , we arrive at:



                            π2              π2            π 2 (2Tdelay + Tresp )Tresp Tdelay ≫Tresp π 2 Tresp

              r∗ − rb =     2     −                   2

                                                        =      2                      −−−−−−−−→         3     .            (S13)

                          4Tdelay   4(Tdelay + Tresp )    4Tdelay (Tdelay + Tresp )2                2Tdelay

Then, the critical learning rate can be found as:



                                ∗               r − rb    π 2 Tresp π 2     π 4 Tresp −5

                               αghost−as =           ∗  ≈     3     2     =          Tdelay .                              (S14)

                                              |∇L(r+ )|   2Tdelay 2Tdelay       4

                                                                                                                          −5

In words, if the delay period is significantly longer than the response period, the critical learning rate scales as ∼ O(Tdelay ).



S2.2. Limit cycle model

Similar to a ghost model, another potential strategy for a delayed response involves creating limit cycle attractors. Though

there are multiple dynamical system forms one can use to model these attractors, we focus on a simple toy model as follows:

                                          τ ρ̇(t) = (1 − ρ2 (t))ρ(t),   τ θ̇(t) = 2πr,                                     (S15)

where ρ and θ are polar coordinates and r is the trainable parameter as before. Here, τ is a fixed time scale, which we

effectively set to one such that time is computed in dimensionless units (in units of τ ). We assume that the system is

initialized at ρ = 1 and θ = −π/2, and primarily focus on x(t) = ρ(t) cos(θ(t)). Below, we discuss how we train this

model to solve the delayed response task.



S2.2.1. T OY MODEL SETUP

Since ρ = 1 is a fixed point of the limit cycle system with ρ̇(t)|ρ=1 = 0 and θ(t) = 2πrt − π2 , the time evolution of the

x-coordinate follows:

                                                     x(t) = sin(2πrt),                                              (S16)

where r is a learnable parameter. Next, define the output of this system as ô(x(t)) = Θ(x(t) < 0). For the delayed response

task, we make a slight modification and assume that the delay is longer than the reaction time such that o(t) = Θ(T − Tdelay )

and the total task time is Ttotal = Tdelay + Tresp . Then, the loss function becomes:

                                Z Tdelay                                  Z Tdelay +Tresp

                           1                                2         1

                L(r) =                   (Θ(x(t) < 0) − 0) dt +                           (Θ(x(t) < 0) − 1)2 dt,

                         Tdelay 0                                   Tresp Tdelay

                                Z Tdelay                                Z Tdelay +Tresp                                (S17)

                           1                                        1

                      =                  1(sin(2πrt) < 0) dt +                          1(sin(2πrt) > 0) dt

                         Tdelay 0                                 Tresp Tdelay



When Tresp ≤ Tdelay , a simple inspection reveals that the global optimum of this problem is achieved when Tdelay

corresponds to the half the period, i.e., r∗ = 2Tdelay

                                                  1

                                                       . At this value, the network outputs 0 until Tdelay , and 1 for another

                                ∗

Tdelay ≥ Tresp , leading to L(r ) = 0. In Fig. 3B, we show an example plot for the loss function. Notably, locally, this plot

shows a kink at the global minimum and a no-learning zone for r < rb , similar to the ghost model above. However, in

reality, the global loss landscape is far more complicated and no global no-learning zone exists.

As we discuss below, it is also possible to show that a local no-learning zone exists at r < rb = 2(Tdelay1+Tresp ) , as for any

smaller r satisfying r > −rb , the system will only output 0 throughout the whole trial, hence a flat loss region exists with

the value of 1 for all r ∈ [−rb , rb ]. Moreover, using geometrical reasoning, we can analytically compute the loss function

for − 2(Tdelay1+Tresp ) ≤ r ≤ Tdelay1+Tresp under the condition that Tdelay ≫ Tresp , and for r > − 4T  1

                                                                                                           and r < 4T  3

                                                                                                                           when

Tdelay = Tresp = T . First, we start with the limit that Tdelay = Tresp = T , and then later consider the long delay limit.



S2.2.2. A NALYTICAL CALCULATIONS WITH EQUAL DELAY AND RESPONSE TIMES

                       1                                                                                1        1

Noting that Thalf = 2|r|  is the half period of the oscillations, we start by considering the regime − 4T ≤ r ≤ 4T , in which

Thalf ≥ 2T . In this case, x(t) = 1 or 0 for the full 2T duration, depending on whether r is positive or negative. In both

                                  1          1

cases, the loss function is L(− 4T   ≤ r ≤ 4T   ) = 1, i.e., flat.



                                                               16


===== PDF PAGE 17 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



                                                                 1          1

Next, we consider the interval for which T ≤ Thalf ≤ 2T , i.e., 4T ≤ r ≤ 2T   . Then, for the times T ≤ t ≤ Thalf , the model

outputs zero, whereas it should have outputted one. For this interval, the loss function then becomes:



                                              Thalf      1                         1      1

                                     L(r) =         −1=      −1         for          ≤r≤    .                              (S18)

                                               T        2T r                      4T     2T



Finally, we consider the interval 2T                                       1          3

                                   3 ≤ Thalf ≤ T , which corresponds to 2T ≤ r ≤ 4T . In this case, the network outputs

zero for Thalf times (making an error in T − Thalf out of these), and one for another Thalf , only to come back to zero for

another 2T − 2Thalf times. Thus, in total, the network makes mistakes in 3(T − Thalf ) out of the 2T total times. This leads

to the loss function:

                                               3Thalf         3           1           3

                                  L(r) = 3 −          =3−           for       ≤r≤       .                             (S19)

                                                 T           2T r        2T          4T

                                                                   1        3

Bringing all these together, we arrive at the loss function for − 4T ≤ r ≤ 4T as:

                                                  

                                                                          1          1

                                                  1

                                                               for    − 4T ≤ r ≤ 4T   ,

                                                     1                  1        1

                                         L(r) =     2T r − 1    for    4T ≤ r ≤ 2T ,

                                                                                                                           (S20)

                                                    3 − 2T3 r           1        3

                                                  

                                                                for    2T ≤ r ≤ 4T .

                                                  



Here, it is clear that for r∗ = 2T

                                 1

                                   , the global minimum is achieved such that L(r∗ ) = 0. We can also compute the gradient at

this point as:                                                   (

                                                 1                 −2T from the left,

                                       At r =      : ∇L(r) =                                                           (S21)

                                                2T                 6T     from the right.

                       1

Next, given that rb = 4T , we can compute an effective learning rate using the kink at the global optimum as:



                                             ∗       r∗ − rb      1 1     1 −2

                                            αLC =         ∗ )| = 4T 6T = 24 T  .                                           (S22)

                                                    |∇L(r+



Interestingly, creating a limit cycle to solve the delayed response task leads to a better scaling with the trial time. Notably,

  ∗                                                      ∗

αghost in Eq. (S6) has a much higher pre-factor than αLC     in Eq. (S22). This means that for small T , it may be favorable to

learn ghost points, whereas for large T , limit cycles can be preferable.



S2.2.3. A NALYTICAL CALCULATIONS WITH LONG DELAYS

Now, we consider the limit Tdelay ≫ Tresp , and compute the analytical loss function for − 2(Tdelay1+Tresp ) ≤ r ≤ Tdelay1+Tresp .



Firstly, similar to before, the loss function is flat for the region − 2(Tdelay1+Tresp ) ≤ r ≤ 2(Tdelay1+Tresp ) , since Thalf ≥

Tdelay + Tresp . In other words, the model outputs either zeros (for r > 0) or ones (for r < 0) throughout the full window,

leading to L(r) = 1.

Next, we consider the case where Tdelay ≤ Thalf ≤ Tdelay + Tresp , i.e., 2(Tdelay1+Tresp ) ≤ r ≤ 2Tdelay 1

                                                                                                              . In this case, the

network outputs zero for Thalf , which is longer than Tdelay and thus leading to an error contribution for times Thalf − Tdelay .

Since Thalf ≤ Tdelay + Tresp and 2Thalf ≥ 2Tdelay ≥ Tdelay + Tresp , the network correctly outputs one for the rest of the

trial. Hence, the loss function becomes:

                           Thalf   Tdelay      1       Tdelay                         1                1

                  L(r) =         −        =          −                for                        ≤r≤         .             (S23)

                           Tresp   Tresp    2Tresp r   Tresp                  2(Tdelay + Tresp )     2Tdelay



                                 T     +T                              1

Thirdly, we consider the case delay2 resp ≤ Thalf ≤ Tdelay , i.e., 2Tdelay ≤ r ≤ Tdelay1+Tresp . Since Tdelay ≥ Thalf , the

model starts outputting ones even before Tdelay is reached. Hence, there is a contribution to the loss function for the time

duration Tdelay − Thalf . However, since 2Thalf ≥ Tdelay + Tresp , the model correctly outputs the ones during the response

window. Hence, the loss function becomes:

                                      Thalf         1                         1                   1

                        L(r) = 1 −           =1−                 for                ≤r≤                   .                (S24)

                                      Tdelay     2Tdelay r              2Tdelay            Tdelay + Tresp



                                                                17


===== PDF PAGE 18 =====
                                Dynamical phases of short-term memory mechanisms in RNNs

                                   T                    T    +T

Finally, we can consider the case delay

                                    2

                                                                                            1

                                        ≤ Thalf ≤ delay2 resp , i.e., Tdelay1+Tresp ≤ r ≤ Tdelay . Then, since 2Thalf ≥ Tdelay ,

the network will incorrectly output one for the duration Tdelay − Thalf . Moreover, since 2Thalf ≤ Tdelay + Tresp and

                         T

by assumption Tresp ≤ delay2    (and thereby Tresp ≤ Thalf ), the network will output zero incorrectly for the time interval

Tdelay + Tresp − 2Thalf . Then, the loss function here becomes:



             Thalf    Tdelay + Tresp − 2Thalf     Tdelay      1         1                                   1             1

L(r) = 1 −          +                         =2+        −          −                          for                  ≤r≤        .

             Tdelay            Tresp              Tresp    2rTdelay   rTresp                         Tdelay + Tresp     Tdelay

                                                                                                                         (S25)

Bringing all these together, we arrive at the (local values of the) loss function as:

                          

                          

                          1                                      for   − 2(Tdelay1+Tresp ) ≤ r ≤ 2(Tdelay1+Tresp ) ,

                                     Tdelay

                          

                           1                                                   1                 1

                          2rTresp − Tresp                               2(Tdelay +Tresp ) ≤ r ≤ 2Tdelay ,

                          

                                                                  for

                 L(r) =           1                                        1                  1

                                                                                                                           (S26)

                        1 − 2rTdelay                             for   2Tdelay ≤ r ≤ Tdelay +Tresp ,

                        

                        

                        2 + Tdelay −

                                           1         1                       1                 1

                               Tresp     2rTdelay − rTresp        for   Tdelay +Tresp ≤ r ≤ Tdelay .





Here, it is clear that for r∗ = 2Tdelay

                                  1

                                        , the global minimum is achieved such that L(r∗ ) = 0. We can also compute the

gradient at this point as:

                                                              ( T2

                                             1                  −2 Tdelay  from the left,

                                At r =            : ∇L(r) =          resp                                       (S27)

                                          2Tdelay               2Tdelay    from the right.



Next, given that rb = 2(Tdelay1+Tresp ) , we can compute the distance between the minimum and the no-learning zone as:



                               1                   1                      Tresp            Tresp ≪Tdelay  Tresp

                r∗ − rb =              −                      =                           −−−−−−−−→         2    .         (S28)

                            2Tdelay        2(Tdelay + Tresp )   2Tdelay (Tdelay + Tresp )                2Tdelay



Then, we can compute the critical learning rate as



                                    ∗             r∗ − rb      Tresp     1      Tresp −3

                                   αLC−as =

                                                 |∇L(r+∗ )| ≈ 2T 2    2T

                                                                              =      T

                                                                                  4 delay

                                                                                          .                                (S29)

                                                                delay   delay



                                                                                                                           −3

In words, if the delay period is significantly longer than the response period, the critical learning rate scales as ∼ O(Tdelay ).

                                                                                                                 ′       1

It is worth noting that another candidate for the critical learning rate can be computed from the kink at r = Tresp +Tdelay ,

which provides the same scaling.



S3. Experimental details on empirical evaluations

S3.1. Simulating RNN models

In this section, we describe how we implemented the update rule for the leaky firing-rate RNN defined in Equation (1).

Since the experiments are conducted in discrete time, we use the forward Euler method to update the firing rates:





                                                 r(t + 1) = r(t) + αf (r(t), u(t))                                         (S30)



Here, r denotes the firing rate, f (·) corresponds to the update function defined in Equation (1), and α is the step size,

computed as α = ∆t/τ . The update function can be written more explicitly as:





                               r(t + 1) = (1 − α) r(t) + α tanh(W r(t) + W in u(t) + b + ϵ)                                (S31)



With this update rule, we can compute the firing rate at the next time step. The only remaining component is computing the

gradients from the predicted output ô(t) to the target output o∗ (t), as described in Sections S3.2 and S3.3.



                                                                  18


===== PDF PAGE 19 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



S3.2. Task details

Short-term memory is a fundamental cognitive process essential for mammalian survival. Several well-established studies

have proposed theories on memory maintenance that have deepened our understanding of short-term memory, as illustrated

in Fig. 1. However, while these theories focus solely on memory maintenance and response processes, they do not fully

explain the underlying mechanisms. This knowledge gap raises a critical question: Which mechanisms govern short-term

memory in the brain? To address this question, we investigate short-term memory through two key properties: memory

maintenance and information processing. Accordingly, we conduct experiments on two well-established neuroscience tasks:

the delayed activation and delayed cue-discrimination tasks. We determined these tasks because the first task exclusively

examines memory maintenance, while the second incorporates both information processing and the retention of input stimuli

to generate the relevant response. Furthermore, to enhance transparency and ensure the reproducibility of our experiments,

we provide a detailed outline of all task properties in this section.



S3.2.1. D ELAYED ACTIVATION TASK

The delayed activation task allows us to isolate the memory component by assuming that cue processing has already occurred.

In this setup, the task consists of three distinct periods: the delay period (Tdelay ), the reaction period (Tresp ), and the

optional post-reaction period (Tpost ). Since the cue period is omitted, the input remains zero throughout the trial, making

the task entirely dependent on the intrinsic dynamics of the recurrent model rather than external stimuli.

The expected ground truth responses, denoted as O∗ = {o∗1 , o∗2 , o∗3 , ..., o∗T }, are defined over the total duration T =

Tdelay + Tresp + Tpost as follows:



                                                               (

                                                                   1, if t ∈ Tresp

                                                       o∗t =                                                               (S32)

                                                                   0, otherwise



This task is inherently simpler than the delayed cue-discrimination task, as it isolates the challenge of maintaining information

in memory without requiring cue processing. By setting the input u to zero at all times, the model must rely solely on its

internal state dynamics to correctly generate the expected response during the reaction period. The optional post-reaction

period allows for additional investigation into how the network dynamics stabilize after completing the required response.



S3.2.2. D ELAYED C UE -D ISCRIMINATION TASK

In contrast to the delayed activation task, the delayed cue-discrimination task involves two input channels and two output

channels. It consists of four distinct periods: the cue period (Tin ), delay period (Tdelay ), reaction period (Tresp ), and an

optional post-reaction period (Tpost ). This task allows us to investigate both stimulus processing and memory components

simultaneously.

The input cue for the delayed cue-discrimination task, denoted as





                                       U = {(u11 , u21 ), (u12 , u22 ), (u13 , u23 ), ..., (u1T , u2T )}



is defined over the total duration T = Tin + Tdelay + Tresp + Tpost as follows:



                                                       (

                                                           (0, 1) or (1, 0), if t ∈ Tin

                                               ut =                                                                        (S33)

                                                           (0, 0),           otherwise



The expected ground truth outputs, denoted as





                                   O∗ = {(o∗1   ∗2     ∗1 ∗2       ∗1 ∗2            ∗1 ∗2

                                           1 , o1 ), (o2 , o2 ), (o3 , o3 ), ..., (oT , oT )}





are defined as:



                                                                     19


===== PDF PAGE 20 =====
                                  Dynamical phases of short-term memory mechanisms in RNNs



                                                              (

                                                               uTin , if t ∈ Tresp

                                                   o∗t =                                                                       (S34)

                                                               (0, 0), otherwise



This task requires the model to process the cue presented during the cue period, maintain it through the delay period, and

then generate the appropriate response during the reaction period. The optional post-reaction period allows for additional

investigation into how the network dynamics stabilize after completing the required response.



S3.3. Training details

To ensure the reproducibility of our experiments, we provide a comprehensive description of the training configurations

used in this study. All recurrent neural network (RNN) architectures were implemented using the PyTorch framework.

Unless stated otherwise, models were trained using the stochastic gradient descent (SGD) with the momentum value of

0.9 and weight decay value of 10−7 . Most of the experiments were conducted on computing systems equipped with an

Intel i9-10900X CPU and an Apple M2 CPU. To further enhance transparency and support future research, we will publicly

release our complete training pipeline on GitHub.

Training with long delay intervals, i.e., Tdelay ≫ Tresp , presents challenges when compared to shorter delay times due to

the model’s tendency to learn to always output 0. This issue arises from an inherent imbalance in the loss function: since the

model is expected to output 0 for the majority of the trial and only 1 during the response period, a naive mean-squared error

(MSE) loss would favor minimizing errors in the dominant interval, leading to trivial solutions where the model outputs 0 at

all times. This imbalance is aggravated when the total trial duration Tin + Tdelay + Tpost is significantly greater than Tresp .

To mitigate this issue, we trained all RNNs using a weighted MSE loss, where different time intervals were assigned

corresponding weights. The weight function was defined as follows:



                                                       (

                                                        1 − T10         , if t ∈ Tresp

                                               wM SE =    10

                                                                  total

                                                                                                                               (S35)

                                                         Ttotal ,         otherwise



This weighting scheme ensures that the loss function does not disproportionately favor the dominant 0 responses and

appropriately emphasizes the importance of correct responses during the reaction period.



S3.4. Details on large-scale experiments

In this study, we conducted several short-term memory experiments to investigate underlying memory mechanisms.

Specifically, we examined rank-2 RNNs trained on the delayed activation task, both with and without a post-reaction period

(Fig. 2, 3, and S1). To extend our observations to full-rank RNNs, we increased task complexity by training models on the

delayed cue-discrimination task, again with and without a post-reaction period (Fig. 4, S3, and S4). Additionally, to explore

the role of the time constant τ and memory-related components, we evaluated full-rank RNNs under various configurations

(Fig. S5 and S6). Further implementation and training details are provided in Sections S4 and S3.3. As a summary, the

configurations and number of total runs for each experiment are presented below:





                            Table S1. Large-scale experiment configurations and the number of total runs.



 RNN                     TASK                    L EARNING R ATE                         Tdelay              # S EEDS   # E XPERIMENTS

                                                                −3

 R ANK -2    D ELAYED ACT. W / WO Tpost              5 × 10                              30 ms                 100          1600

                                                          −3

 F ULL         C UE - DISC . WO / Tdelay         log[10        , 1] (20)      Tresp = lin[20, 400] ms (20)     20           8000

                                                        −3      −1

 F ULL        C UE - DISC . W / LONGER τ       log[10        , 10    ] (10)       lin[0, 800] ms (21)          20           4200

                                                        −3      −1

 F ULL          C UE - DISC . WO / Tpost       log[10        , 10    ] (15)       lin[0, 400] ms (21)          100          31500

 F ULL          C UE - DISC . WO / Tpost     log[10−1.6 , 10−0.5 ] (15)           lin[0, 400] ms (21)          100          31500

 F ULL          C UE - DISC . W / Tpost        log[10−3 , 10−1 ] (15)             lin[0, 400] ms (21)          20           6300







                                                                       20


===== PDF PAGE 21 =====
                               Dynamical phases of short-term memory mechanisms in RNNs



S3.4.1. D ETECTING LEARNED MECHANISMS SUBSERVING SHORT- TERM MEMORY IN RNN S

We designed two metrics—Reaction Accuracy (RA) and Reaction Reliability (RR)—to evaluate the performance of our

recurrent neural network (RNN) models. Reaction Accuracy quantifies the model’s ability to discriminate the input cue by

identifying the class corresponding to the maximum output channel at each time step, while Reaction Reliability assesses

the degree of signal distinction between the classes.

More formally, let O ∈ RN ×2 represent the model’s output vector over the reaction interval, and G ∈ RN ×1 denote the

ground truth labels over the same interval, where N is the total number of time steps.



Reaction Accuracy (RA): This metric assesses how accurately the model produces the correct response during the

response period (Tresp ). It is computed as follows:



                                                         N

                                                  1 X

                                         RA = 1 −       arg max(Otc ) − Gt                                            (S36)

                                                  N t=1      c





Here, arg maxc (Otc ) returns the index of the output channel with the highest activation at time step t, and Gt denotes the

ground truth class label at that time.



Reaction Reliability (RR): This metric complements Reaction Accuracy by not only evaluating whether the model selects

the correct response during the response period Tresp , but also by measuring how confidently it does so. It is computed as

follows:



                                                             N

                                                      1 X Ot,Gt

                                                 RR =                                                                 (S37)

                                                      N t=1 2c=1 Otc

                                                           P





Here, Ot,Gt denotes the model’s output corresponding to the ground truth class Gt at time step t, and the denominator

normalizes this value by the total output across both output channels at that time step.



Mechanism Discrimination Index (MDI): The two metrics, RA and RR, allow us to determine whether the model has

successfully learned the task. If a model fails to learn, we categorize its behavior as either ‘Unstable Training’ or ‘Final

Model Failure’, as illustrated in Fig. S3A-B and Fig. S4A. However, these metrics alone do not clearly distinguish between

limit cycles and slow-point manifolds (see Fig. S3A-B and Fig. S4C-D). Therefore, to reliably differentiate these two

mechanisms, we further analyze the frequency distributions of correlation coefficient matrices computed from the first two

principal components of the models’ firing rates, as shown in Fig. S3C.

Since limit cycles closely approximate slow-point manifolds during the trial period, it is challenging to distinguish them

based solely on firing rates observed within that interval. To overcome this limitation, we extend the analysis window by

concatenating the post-reaction period during inference, thereby revealing the underlying dynamical structure of the firing

rates, as illustrated in Fig. S4C-D. Next, we apply principal component analysis (PCA) to the firing rates and extract their

first two principal components (Fig. S4). We then compute the Pearson product-moment correlation coefficient matrix from

these principal components.

Due to the repetitive structure of limit cycles, their correlation coefficient matrices exhibit predominantly high-frequency

components. In contrast, slow-point manifolds produce correlation matrices characterized by consistently high correlations,

corresponding predominantly to low-frequency components. After calculating the frequency components, we define a

hyperparameter to establish a threshold for discrimination between low-frequency and high-frequency, and compute the

Mechanism Discrimination Index (MDI) as follows:



                                                              P SDlf

                                                   M DI =                                                             (S38)

                                                             P SDtotal



where P SDlf is the power spectral density of low-frequency components, and P SDtotal is the total power spectral density.

Using this approach, we reliably discriminate between limit cycles and slow-point manifolds, as demonstrated in Fig. S3C.



                                                             21


===== PDF PAGE 22 =====
                                Dynamical phases of short-term memory mechanisms in RNNs



As a summary, we defined four categories to classify the outcomes of RNN training:



   • Final Model Failure: An RNN is considered to have failed to converge if its mean accuracy and reliability have never

     previously reached or exceeded 0.8 (Fig. S4A).



   • Unstable Training: Training is classified as unstable if, after initially achieving accuracy and reliability values above

     0.8, the performance subsequently falls below 0.6 for more than 10% of the epochs following the initial success

     (Fig. S4B).



   • Limit Cycle: An RNN is classified as exhibiting a limit cycle if its mean accuracy and reliability during the final 10%

     of epochs are ≥ 0.8, and the Mechanism Discrimination Index (MDI) is less than 0.5 (Fig. S4C).



   • Ghost Point: An RNN is classified as exhibiting a ghost point if its mean accuracy and reliability during the final 10%

     of epochs are ≥ 0.8, and the Mechanism Discrimination Index (MDI) is greater than or equal to 0.5 (Fig. S4D).



The first two categories collectively constitute the “Not Learned” classification.



S3.4.2. P LOTTING THE SCALING LAWS

To investigate the scaling relationship between the learnable delay interval and the learning rate, we performed the following

analysis.

First, for each learning rate, we extracted the model’s performance across different delay intervals from the large-scale

experiments (Fig. 4B, E). We then fit a saturating function—either an exponential saturation or a sigmoid—to the performance

curves over delay (Fig. S3D, E). This yielded a cutoff delay value a∗ , representing the point at which performance saturates

or exhibits a sharp transition. Specifically, the exponential saturation fit was defined as:



                                                    (

                                                     0                    if x < x0

                                    f (x; x0 , α) =                                                                      (S39)

                                                     1 − exp(−α(x − x0 )) otherwise



The fits were applied to performance metrics (e.g., reaction accuracy or reliability) over delay intervals x, using

scipy.optimize.curve fit.

Next, we analyzed how the cutoff delay values a∗ scale with learning rate α. We performed a log-log linear regression of

the form:





                                                log(α) = β log(a∗ ) + log(A)                                             (S40)



The critical exponent β was estimated using scipy.stats.linregress and validated by an additional log-log fit via

curve fit. To estimate confidence intervals, we performed Monte Carlo sampling using the parameter covariance matrix.

The resulting fit and its 95% confidence interval were visualized on log-log axes, as shown in Fig. 4C, F and Fig. S3F.

This analysis enabled us to extract empirical scaling laws for slow-point manifolds and limit-cycles, which were then

compared to theoretical predictions.



S3.4.3. P LOTTING F IRING R ATES

To visualize firing rates, we collect the hidden states of the leaky firing-rate RNN during inference. To reveal the underlying

dynamical structure, we extend the trial by appending a post-reaction interval (Tpost ) that is nine times longer than the

original duration, defined as T = Tin + Tdelay + Tresp .

After collecting the full firing rate trajectory, we sort neurons based on the timing of the peak activation in their absolute

firing rates. Specifically, each neuron’s activity is scanned to identify the time step at which its firing rate reaches its

maximum value. Neurons that do not exceed a predefined activation threshold are pushed to the end of the ordering. This

procedure ensures that neurons are visualized in the order in which they become active, highlighting sequential structure in

the network’s dynamics.



                                                              22


===== PDF PAGE 23 =====
                               Dynamical phases of short-term memory mechanisms in RNNs



S4. Reproduction details

Figure 2: To investigate the emergent mechanisms—specifically, slow-point manifolds and limit cycles—we conducted

experiments using low-rank recurrent neural networks (RNNs) (Background). Given that a minimum of two dimensions is

required for the formation of limit cycles, we set the low-rank dimensionality to K = 2. The delayed activation task was

chosen as the training paradigm. The learning rate was initialized at α = 10−2 . Additionally, we set the time decay constant

to τ = 10 ms, the time step to ∆t = 5 ms, the delay interval to Tdelay = 150 ms, and the response interval to Tresp = 50

ms. The architecture was trained for 150, 000 epochs with a total of N = 100 neurons. All weights and biases, as described

in Eq. (2), were optimized throughout training. For this experiment, noise was set to ϵ = 0, and firing rates were initialized

from a multivariate Gaussian distribution with mean µr = 0 and standard deviation σr = 0.1. Training was performed using

stochastic gradient descent (SGD) with PyTorch’s default hyperparameters.



Figure 3: This figure highlights the impact of even slight changes in task configuration on network dynamics. To

demonstrate this, we trained identical RNNs with N = 100 neurons and a rank of K = 2, by increasing the post-reaction

period interval from Tpost = 0 ms to Tpost = 30 ms. We applied a similar configuration to Fig. 2A, except for setting

Tdelay = 30 ms, Tresp = 10 ms, and α = 10−3 for the experiments in Fig. S1A-B, training the networks for 106 epochs.

For the experiments in Fig. S1C, we set α = 5 × 10−3 and trained the networks for 500, 000 epochs while varying the delay

interval as Tdelay ∈ {30, 40, 50, 60, 70} ms. Moreover, SGD is used with the default hyperparameters of PyTorch.



Figure 4: In large-scale RNN experiments, we developed a primary training pipeline to systematically investigate the

effects of learning rate, delay interval length, and post-reaction interval. Apart from these variations, all other training

configurations in Fig. 4 were set as follows: number of neurons N = 100, noise initialization drawn from a Gaussian

distribution with mean µϵ = 0 and standard deviation σϵ = 10−3 , and firing rate initialization drawn from a Gaussian

distribution with mean µr = 0 and standard deviation σr = 10−1 . Additionally, task-related parameters were fixed, with

the cue interval set to Tin = 30 ms, the reaction interval to Tresp = 50 ms, the time decay constant to τ = 10 ms, and the

time step to ∆t = 5 ms. Since lower learning rates require longer training durations, we implemented an adaptive schedule

for the number of training epochs based on the learning rate. The number of epochs was determined using the following

equation:



                                                                          30

                                               num epochs = max(103 ,        )                                          (S41)

                                                                          α



The delay interval was gradually increased in increments of 20 ms, covering the range Tdelay ∈ [0, 420] ms. In our initial

experiments, learning rates were sampled from a logarithmic scale with equal spacing in the range α ∈ [10−3 , 10−1 ]. To

further investigate the effects of intermediate learning rates, we additionally sampled more values logarithmically within the

range α ∈ [10−1.6 , 10−0.5 ] (see Table S1 for details). Besides, Fig. 4C,F presents the estimated cutoff delay values, which

are described in detail in Section 2.5. Moreover, in Fig. H, I, we constructed a phase diagram of emergent mechanistic

phases derived from the results shown in Fig. 4C-D.



Figure S2: We analyze the emergence of the limit cycle model in the delayed activation task through analytical methods

(Supplementary 1.2). Figure S2A illustrates the vector field of the dynamical system, which is derived from Eq. (S15)

with r = 0.1. Additionally, Figure 4G presents two loss curves: the analytical curve is obtained from Eq. (S17), while

the numerical curve is computed using Eq. (S20), with parameters set to Tdelay = 60 ms, Tresp = 10 ms, and dt = 10−2 .

Finally, Figure S2B is constructed by plotting analytically derived scaling laws, with the response interval set to Tresp = 10

ms.



Figure S3: This figure builds on the results presented in Fig. 4 to illustrate the RA and MDI metrics. Additionally, it

highlights the scaling laws associated with slow-point manifolds observed in the large-scale RNN experiments.



Figure S4: We randomly sampled the example classes of dynamical systems from the large-scale RNN experiments.



Figure S5: In this experiment, we use the same training configuration as in Fig. 4, except for the delay intervals and the

value of τ . We set τ = 20 ms and sampled Tdelay from the range [0, 840] ms in increments of 40 ms. (See Table S1 for

more details.)



                                                             23


===== PDF PAGE 24 =====
                               Dynamical phases of short-term memory mechanisms in RNNs



Figure S6: In this figure, the only differences from the large-scale experiments are that the number of training epochs is

set to 3000, Tdelay = 0 ms, and the response interval Tresp is varied instead. This setup allows us to examine the importance

of the memory component. (See Table S1 for more details.)

The code to reproduce these figures is publicly available at https://github.com/fatihdinc/dynamical-phases-stm, the data

jointly with the code at https://doi.org/10.5281/zenodo.15529757.









                                                             24


===== PDF PAGE 25 =====
                       Dynamical phases of short-term memory mechanisms in RNNs



Figures and captions









                                                 25


===== PDF PAGE 26 =====
                                           Dynamical phases of short-term memory mechanisms in RNNs









     A        Training a rank-2 RNN      B                                      Epoch 40,000                 Epoch 67,000                Epoch 130,000

            on a delayed-activation task                                        (SP manifold)                 (Transition)                (Limit cycle)

                                                                                                                                                          Trial start

                                                latent variable(a.u.) Outputs









                                                                                    Tdelay                      Target                         Network

                  100                                                                           Tresp                                                     Response start

Normalized loss

function values









                                                                                                                                                          Trial end

                                               Activity of the second









                  10-1

                                                                                                                                                          Latent state

                                                                                                                                                          (during trial)

                  10-2

                                                                                                                                                          Latent state

                                                                                                                                                           (after trial)

                  10-3

                                                                                                                                                           Decision

                         0       100,000                                                                                                                   boundary

                   Number of training epochs                                                    Activity of the first latent variable (a.u.)





Figure S1. RNNs can switch between distinct short-term memory mechanisms during training. A To illustrate that different

mechanisms can be employed by dynamical systems to delay their responses, we trained a rank-2 RNN to perform the delayed activation

task. In this task, networks initialized at a given state (Methods) should delay their output by Tdelay . Parameters: N = 100 neurons,

τ = 10ms, ∆t = 5ms, Tdelay = 150ms, Tresp = 50ms, α = 10−2 for stochastic gradient descent using otherwise the default parameters

in PyTorch (Paszke et al., 2017). The dotted lines correspond to epochs, for which the latent dynamical systems are illustrated in Panel

(B). B During the training, two distinct mechanisms emerge in the RNN, which we probe by plotting the two-dimensional latent dynamical

systems. Left. Early in the training, the network lowers the loss values by designing a line of slow-points (referred to as SP manifold),

towards which other stats are attracted. The latent states after the trial concludes end up in a final attractive fixed-point. Middle. As

training progresses, the SP manifold slowly dissolves into a circular pattern, which we deem as a transient mechanism before the network

settles into the final solution. Right. After further training, a limit cycle emerges in the latent dynamical system. In this structure, even

after the trial concludes, latent states continue to evolve in a periodic manner. The shaded areas around the decision boundary correspond

to network outputs within 0.75 (outer green boundary) and 0.25 (outer red boundary).









                                                                                                        26


===== PDF PAGE 27 =====
                                                            Dynamical phases of short-term memory mechanisms in RNNs









                            A                                    output = 1       output = 0      B                  Tdelay = 60 and Tresp = 10

                                Second model variable (y)









                                                            1                                                              Analytical curve

                                                                                                                           Numerical data

                                                                                               Normalized loss

                                                                                               function values



                                                                                                                 1

                                                            0







                                                            -1

                                                                                                                 0

                                                                   -1         0        1                              0            0.01

                                                                 First model variable (x)                             Parameter values (r)



Figure S2. A theoretical scaling analysis of short-term memory mechanisms via toy models. A The illustration of the flow map

corresponding to the toy limit cycle model for r = 0.1. The red circle denotes the attractive limit cycle, the purple line corresponds to the

decision boundary of the output, and the green circle denotes the starting point of the state. B An example loss curve for the limit cycle

toy model, with analytical curve and empirical data points. Note the kink at the global minimum. C The different dependencies of the

effective learning rate for two types of mechanisms create a phase space as a function of delay and learning rate values. In general, there

are three main phases of short-term memory mechanisms for large Tdelay ≫ Tresp . For this figure, we picked Tresp = 10ms.









                                                                                               27


===== PDF PAGE 28 =====
                                                           Dynamical phases of short-term memory mechanisms in RNNs









             A                                                        B                                                              C

                                                   Memory                              1

                                                  mechanism









                                                                                                                                          Frequency (normalized)

                                                                                                                                                                   40

                                                                       Reaction accuracy

         Loss function values









                                0.1               Final model fails

                                                  Unstable learning

                                                  Limit cycle                                                                                                                        Limit cycle

                                                  SP manifold                                                                                                                        SP manifold







                                0                                                  0.5                                                                             0

                                      0                           1000                               0                      1000                                        0                              1

                                                               Number of epochs                                                                                         Mechanism discrimination index



             D                   1                                    E                          1                                   F

                                          Learning rates                                                        Learning rates

                                                                           developing SP manifolds

       failing to solve the task









                                               0.316                                                                 0.316                                                           Scaling of the

                                                                              Fraction of RNNs

           Fraction of RNNs









                                               0.019                                                                 0.019        Learning rates   10-1                              SP manifolds

                                               0.001                                                                 0.001





                                                                                                                                                   10-2

                                                                                                                                                                         β = 4.05 ± 0.10,

                                                                                                                                                                        R2 = 0.99, p<10-3

                                 0                                                               0                                                 10-3

                                      0              200         400                                     0         200           400                                30              100               300

                                                                                                             Delay (ms)





Figure S3. Details of the large-scale RNN experiment. A Different memory mechanisms exhibit distinct loss curves during training.

While limit cycles and slow-point manifolds successfully converge to local minima, the “Final Model Failure” and “Unstable Learning”

classes do not achieve stable convergence due to high learning rates. B As further illustrated, only the limit cycle and slow-point

manifold mechanisms achieve consistently high reaction accuracies. C The Mechanism Discrimination Index (MDI) (see Methods)

allows reliable differentiation between limit cycles and slow-point manifolds, even though their dynamics appear similar during the trial

period. D Lowering the learning rate enhances the model’s ability to learn tasks with longer delay intervals. The solid curve represents the

corresponding exponential saturation fit (see Methods). E Additionally, decreasing the learning rate increases the likelihood of models

adopting slow-point manifolds. F As predicted by analytical models, results from the large-scale RNN experiments exhibit a similar

                            −4       β         −5

power-law relationship (Tdelay   ≥ Tdelay ≥ Tdelay  ) for learning slow-point manifolds for large learning rates. However, for larger delays

(Tdelay > 100ms), these solutions preferentially suppressed, presumably in favor of the limit cycle based solutions.









                                                                                                              28


===== PDF PAGE 29 =====
                                                  Dynamical phases of short-term memory mechanisms in RNNs







                                                                                                0                  1                 Trial start

                                                                                                                                                    Latent state

 A                           Reaction metrics                 Network outputs                                                        Response          in trial

                                                                                            Absolute firing rates                       start       Latent state

                                                                                                                                     Trial end       after trial

                     1                                1

                                 Accuracy                                       100

                                                                 Output 1

 model faliure









                                 Reliability

 Class: Final









                                                                                                                       PC 2 (a.u.)

                                                                                Neuron ID

                                                                 Output 2

                                                                 Target







                     0                                0                             0

                         0                     1000       0       1         2               0         1        2

                         Training epochs                         Time (s)                           Time (s)                               PC 1 (a.u.)

 B

                     1                                1

                                                                                100

                                                                 Output 1

 Class: Unstable









                                                                 Output 2









                                                                                                                       PC 2 (a.u.)

                                                                                Neuron ID

    learning









                                                                 Target



                                 Accuracy

                                 Reliability

                     0                                0                             0

                         0                     1500       0       1         2               0         1        2

                         Training epochs                         Time (s)                           Time (s)                               PC 1 (a.u.)

 C                   1                                1

                                                                                100

 Class: Limit









                                                                                                                       PC 2 (a.u.)

                                                                                Neuron ID

    cycle









                                 Accuracy

                                 Reliability

                     0                                0                             0

                         0                     1000       0       1         2               0         1        2

                         Training epochs                        Time (s)                            Time (s)                               PC 1 (a.u.)



 D                   1                                1

                                                                                100

 Class: Slow-point









                                                                 Output 1

                                                                 Output 2

                                                                                                                       PC 2 (a.u.)

                                                                                Neuron ID

     manifold









                                                                 Target



                                 Accuracy

                                 Reliability

                     0                                0                            0

                         0                     3000       0       1         2               0         1        2

                         Training epochs                        Time (s)                            Time (s)                               PC 1 (a.u.)





Figure S4. The four main classes identified in the large-scale RNN experiment. This figure illustrates representative examples from

each of the four primary classes: A Final model failure, B Unstable learning, C Limit cycle, and D Slow-point manifold. We focused on

trained models from experiments with a delay interval of 180 ms, which was specifically selected because it exhibits all four classes, as

illustrated in Fig. 4B. The first column presents the reaction metrics, i.e., Reaction Accuracy and Reaction Reliability (see Methods). The

second column shows the network’s outputs alongside the corresponding ground truth signals. The third column displays the firing rates

of individual neurons. The final column illustrates the first two principal components derived from these firing rates. Training parameters

used for each representative example are as follows: A α = 0.1, seed = 93; B α ≈ 0.01931, seed = 41; C α = 0.1, seed = 82; and D

α = 0.01, seed = 85. Additional parameters shared across all models are Tin = 30 ms, Tdelay = 180 ms, Tresp = 50 ms, ∆t = 5 ms,

τ = 10 ms, σnoise = 0.001, σr = 0.1, and batch size per channel = 64 (see Methods).





                                                                                        29


===== PDF PAGE 30 =====
                                               Dynamical phases of short-term memory mechanisms in RNNs









     A                                                   B                                                        C

                                                                                       No learning          Limit cycle                                    SP manifold

                                      Memory

                                     mechanism                                 1                                                             10   -1









                                                                                                                      Learning rate (logscale)

                        0.1

 Loss function values









                                     Final model fails

                                                            Fraction of RNNs









                                     Unstable learning

                                     Limit cycle

                                     SP manifold                                                                                             10-2









                        0                                                      0                                                             10-3

                              0                      1000                          0   200        400     600   800                                    0          400      800

                                  Number of epochs                                           Delay (ms)                                                       Delay (ms)





Figure S5. RNN experiments with increased τ . In this figure, we examine the effect of increasing the time constant to τ = 20 ms while

keeping all other hyperparameters identical to those used in the large-scale delayed cue-discrimination task experiments (Fig. 4). These

experiments reveal that increasing τ does not alter the observed scaling laws. A As in Fig. S3, we observe similar loss curve patterns

across all classes under the larger τ setting. B Consistent with previous results, the distribution of dynamical classes across different

random seeds remains largely unchanged with the increased τ . C The phase diagram for τ = 20 ms shows scaling laws consistent with

those observed in the smaller τ regime.









                                                                                             30


===== PDF PAGE 31 =====
                                              Dynamical phases of short-term memory mechanisms in RNNs









 A                                                    B                                                           C

                                     Network                                         100

                                                          Learning rate (logscale)

   Loss function values









                                   performance

                                                                                                                                   10-1









                                                                                                                  Learning rates

                                    Not learned

                      10   1

                                                                                                                                              Scaling of the

                                    Correct

                                                                                                                                           no-solution boundary

                                                                                                                                   10-2

                                                                                                                                           β = 0.38 ± 0.02,

                    10-1                                                                                                                  R2 = 0.97, p<10-3

                                                                                     10-3                                          10-3

                               0   1000    2000   3000                                      0        200    400                               40     100          400

                                   Number of epochs                                                        Response window (ms)





Figure S6. Scaling laws disappear in fixed-response task experiments with RNNs. In this experiment, we remove the delay period

from the delayed cue-discrimination task to isolate the effect of memory and assess its role in scaling laws. As shown in the figure, the

removal of the delay component eliminates the previously observed scaling behavior, highlighting memory as a critical factor underlying

these laws. A As in previous tasks, we observe qualitatively similar loss curves between not learned and correct networks. B Phase

diagram showing the classification of not learned and correct networks in the fixed-response task. The x-axis represents the length of the

response interval, during which the model is required to generate a consistent output over time. Notably, removing the delay period (and

thus the memory requirement) leads to a substantial loss of scaling structure. C We compute the scaling law using the same methodology

as in Fig. 4C,F and Fig. S3F.









                                                                                                31

