PaperHub
7.3
/10
Poster4 位审稿人
最低4最高6标准差0.9
4
4
4
6
3.5
置信度
创新性3.3
质量2.8
清晰度2.8
重要性2.3
NeurIPS 2025

Mechanistic Interpretability of RNNs emulating Hidden Markov Models

OpenReviewPDF
提交: 2025-05-12更新: 2025-10-29

摘要

关键词
Mechanistic InterpretabilityRecurrent Neural NetworksHidden Markov ModelsStochastic ResonanceReverse-EngineeringBehavioral NeuroscienceComputational Neuroscience

评审与讨论

审稿意见
4

The paper reverse engineers RNNs trained to match emission probabilities of HMMs. They train the RNNs with Sinkhorn divergence to match the distribution of sequences instead of individual traces. They find that the RNNs switch between two stable regions corresponding to the two outputs that vary in probability. Switches occur when enough noise accumulates in the stable region to push the RNN state to a "kick-zone" that pushes the state through a deterministic transition region to the other stable region. In one example RNN, they isolate these computations to particular neurons, specifically two triplets of "kick-neurons" that drive the kick-zone to transition dynamics.

优缺点分析

Strengths: The paper is an interesting case study on reverse engineering RNNs implementing probabilistic computations, where most works in this vein have focused on deterministic tasks. The paper analyzes the population latent dynamics in-depth but also explores mechanistic implementation of these dynamics by single units.

Weaknesses: As noted by the authors, the HMMs used here are quite simple and thus it is not entirely clear how these insights transfer to more complex, realistic models. In addition, I feel that the analysis is still lacking in explaining the emulation of switching between discrete states and how these transition probabilities are embedded in the network solution. As such, I feel like the explanation of how the RNNs implement the HMMs is pretty incomplete.

问题

  1. If you were to infer HMM parameters from outputs from the trained RNNs, would you recover the original HMM transition and emission probabilities? I would find this result to strengthen the evidence that the HMMs are successfully embedded in the RNNs beyond the summary statistics that are currently used.
  2. How are the transition probabilities implemented by the RNNs? Is there a way to determine the current discrete state of the RNN?
  3. For the mechanistic analysis, how consistent are the results of the existence "kick-neurons", etc. across the individual RNNs trained to match the two-state HMM?

局限性

yes

最终评判理由

The paper introduces a new way of training RNNs to match stochastic models and identifies an interesting mechanism in RNNs for implementing switches between discrete states when driven by noise. It remains unclear to me how these results generalize to more complex HMM structures, since the main text HMMs have a very specific (and arguably problematic) structure, and the new rebuttal results are only described in brief since the authors can't share plots. Still, the paper seems fairly well-done and provides some new methods and ideas that I think are worth sharing.

格式问题

None

作者回复

We thank the reviewer for the positive and constructive feedback on the generalizability and the underlying mechanisms of the RNNs. In response, we have made substantial new experiments to address these points.

Summary:

  1. Revised Introduction and added Contributions.
  2. Fitted additional RNNs to more complex HMM structures in Appendix B.3 showing the general applicability of our findings.
  3. Added fitting of HMMs in Appendix A.3 as additional performance metrics.
  4. Fitted additional RNNs to 2-state HMMs with different transition probabilities.
  5. Revised Conclusion to include discussion on transition probabilities.
  6. Added further analyses in response to the other reviewers’ feedback (other responses).

Weaknesses:
We would like to clarify that the goal of our work is not to provide a comprehensive account of all possible HMM variants. Instead, we focus on a more specific question, which is currently unanswered in the literature: Can RNNs, in principle, reproduce the behavior of HMMs, and if so, through what mechanisms? Addressing this required the development of a new training regime and several different analysis pipelines, since existing methods primarily target deterministic tasks and do not naturally extend to modeling stochastic, discrete dynamics.

The mechanism we identify, amounts to a novel solution to the general problem of generating stochastic transitions between discrete states. Notably, the RNNs do not implement an intuitive solution based on multiple attractors (energy wells) and symmetric transitions between them, which would show a direct one-to-one mapping with the discrete states of the underlying HMMs. On the contrary, the RNNs converge to a solution implementing rotational dynamics that even with a single attractor creates clusters and asymmetric transitions between them (different trajectories from cluster “A to B” vs. “B to A”). We are not aware of any work suggesting such a mechanism to generate stochastic discrete behaviors in RNNs, and we thus believe that identifying this mechanism, even in simple HMMs, amounts to an important contribution that will guide future experiments and analyses of biological networks during complex behaviors.

To show a wider applicability of our findings, we have added analyses of RNNs trained on HMMs with different graph structures (App B.3), which demonstrate that the same mechanisms emerge. In particular, we consider 3 new classes of HMMs:

  1. Fully-connected: 3-state HMM, where each state is mainly associated with a different output.
  2. Cyclic: 4-state HMMs, with closed-chain transitions and 2 or 3 outputs emitted.
  3. Linear-chain: 3- to 5-state HMMs where each hidden state emits with a high probability one of the 3 outputs or a mixture of them.

Unfortunately, we are not allowed to show the new related additional plots, which demonstrate that all RNNs exhibit the global and local dynamics described in the manuscript. Preliminary analyses also reveal analogous connectivity structure at the single neuronal level. In models 1, 2, 3, which have 3 outputs, we observe 3 cluster regions in the RNN state space and two sets of rotational trajectories, each implementing the transitions between pairs of clusters, analogous to those described in the manuscript. We thus hypothesize that the identified mechanism acts as a “dynamical primitive”, reusable in a modular fashion to emulate more complex HMM structures.

We now revised the Introduction and added a new Contributions (Sec 1) to clarify these objectives and their novelty (full version in answer to reviewer FrtZ):

This work [...] :

  1. *A training paradigm for stochastic RNNs (Sections 3.1-3.2, Appendix A.2): unlike previous work focused on deterministic tasks, [...].*
  2. Emulation of HMM statistics (Section 3.2, Appendix A.3, Figures 10-11): we show [...].
  3. A novel mechanism for RNNs with discrete stochastic outputs
    1. Global dynamics (Section 4.1, Figures 3-4): We reveal how training induces rotational dynamics and orbital trajectories.
    2. Local dynamics (Section 4.2, Figure 5): We identify three functional zones: clusters, kick-zones, and transitions, each with distinct dynamical signatures.
    3. Connectivity and single neurons (Section 5, Figures 6-7): We uncover structured connectivity between “noise-integrating populations” and "kick neurons" that trigger state transitions.
    4. Computational principle (Section 6, Figure 8): We show how the mechanism resembles self-induced stochastic resonance.

Our findings reveal a coherent mechanism: local dynamical features like clusters and kick-zones give rise to global rotational dynamics, producing discrete outputs. The network’s connectivity reveals how individual neurons instantiate these dynamics. Together, they show that RNNs discover a general computational motif that combines slow noise integration with fast transitions. Preliminary results [...] approximate more complex discrete latent structures.

For the HMMs described in the original manuscript, in our opinion the description of the mechanism is more “complete” than “incomplete”. Specifically, we do precisely describe the mechanism at various levels of description and how these relate to each other (see contribution list above). In particular, we would argue that none of the results explained in Section 3 of Contributions could be a priori predicted.

Nonetheless, the reviewer raises an important point about how RNNs implement transition probabilities. To address this point, we trained RNNs on 2-state HMMs with varying transition probabilities and an analysis (Appendix) on how output dimensions align with the principal component plane of the orbits. We respond to this point in detail under Question 2.

Questions:

  1. Fit quality. This point allowed us to elaborate on additional metrics for evaluating RNN fits. Beyond the performance measures in Section 3.2 (i.e., Euclidean distances, transition matrices, observation frequencies and volatilities), Appendix A.3 now includes a “closed-loop” analysis:

    • Firstly, we generate 10k-timestep sequences from both fitted RNNs and ground-truth HMMs, then fit HMMs (with 2–10 states) to estimate the optimal number of states using Bayesian Information Criterion (BIC). For the entire set of RNNs analyzed in the initial submission (fitted to different HMM ground-truths), these fits converge to an HMM structure with 2 hidden states. This finding highlights a problem of non-identifiability.
    • Secondly, to sidestep the issue of non-identifiability, we fit HMMs to simulated HMM sequences and RNNs fit to them using the ground-truth number of states, to infer the transition and emission probability matrices. Critically, we observe that the parameters retrieved from RNN- and HMM-generated sequences are very similar between them and they closely match the ground-truth.

    These findings further strengthen the argument that the statistical properties of sequences generated by RNNs match those of the target HMMs.

  2. Transition probabilities & discrete states. We address these interesting questions in the Conclusion of the manuscript. In simpler HMMs (e.g., 2-state), where a clear 1-to-1 mapping exists between cluster regions in RNN state space and HMM states, transition probabilities are implemented via the rate of transitions between these clusters. As shown in Fig. 4(b), the RNN learns to adjust these rates to match the ground-truth transition probability, a result confirmed across 2-state models with varying transition matrices. We hypothesize that this mechanism relies on the stochastic resonance regime (Section 6), where noise and structured connectivity induce quasi-periodic dynamics that drive switching between these clusters at specific rates. In more complex HMMs (e.g., 5-state), where ground-truth states are similar and a clear cluster-to-state mapping breaks down, the output layer plays a larger role. In the Appendix, we show that the alignment of output dimensions with the orbit’s principal component plane degrades as the number of HMM states increases. This misalignment likely leads to more uniform output distributions that enable the emulation of more complex HMM structures and their transition probabilities. 

    Regarding the second part of your question: analyses of neuronal activation profiles (Fig. 16) and ablation studies (Fig. 5) that uncovered kick-neurons also revealed units — likely belonging to noise-integrating populations, Fig. 6 — with activity tuned to specific cluster regions. These neurons could serve as markers of specific cluster regions and that their activation values could be employed to determine the current discrete state of the RNN.

  3. Consistency across RNNs. To answer this question, we have extended our analyses of the connectivity structure presented in the original manuscript and added the results as Appendix A.7. In the new analyses we show how the structured connectivity discovered in the RNN trained on 2-state HMM generalizes to: RNN trained on 2-state HMM (different random seed) and the whole range of RNNs presented in the initial submission (3, 4 and 5-states). In all cases, we identified the same mechanism of kick-neurons and noise-integrating populations. Further preliminary evidence on the newly introduced HMM classes (i.e., fully-connected, cyclic and linear-chains) suggests the presence of kick-neurons and noise-integrating populations also in these cases.

We would like to thank you for your review. We have addressed your concerns, please let us know if you have any others in order for your score to change.

评论

Thank you for the response! In particular, the clarifications to reviewer FrtZ on the motivation for the work were very helpful.

I also appreciate the experiment with fitting new HMMs to RNN-generated and ground truth observation sequences. I have a few further questions about the observed non-identifiability.

  1. What exactly were the two-state HMMs that the fits converged to? Did each state correspond to one of the outputs (of the two that varied in probability)?
  2. How do you know if the RNNs were implementing the "true" n-state HMMs vs these inferred 2-state HMMs, and does it affect your interpretation of the mechanisms?
评论

We thank the reviewer for their prompt response and are glad to hear that our clarifications were helpful.

To address the reviewer's questions, we provide below a table summarizing the estimated transition and emission probabilities for 2-states HMM fitted on RNN-generated sequences and HMM ground-truth sequences (4 models described in the initial submission). As shown in the table, the estimated transition and emission probabilities are very similar between HMMs fitted on RNN-generated and HMM ground-truth sequences.

StatesTrans. HMM fit on RNNTrans. HMM fit on HMMEmis. HMM fit on RNNEmis. HMM fit on HMM
2(.9.1.1.9)\begin{pmatrix} .9 & .1 \\\\ .1 & .9 \end{pmatrix}(.9.1.1.9)\begin{pmatrix} .9 & .1 \\\\ .1 & .9 \end{pmatrix}(.90.1.10.9)\begin{pmatrix} .9 & \sim0 & .1 \\\\ .1 & \sim0 & .9 \end{pmatrix}(.90.1.10.9)\begin{pmatrix} .9 & \sim0 & .1 \\\\ .1 & \sim0 & .9 \end{pmatrix}
3(.8.2.2.8)\begin{pmatrix} .8 & .2 \\\\ .2 & .8 \end{pmatrix}(.7.3.3.7)\begin{pmatrix} .7 & .3 \\\\ .3 & .7 \end{pmatrix}(.90.1.10.9)\begin{pmatrix} .9 & \sim0 & .1 \\\\ .1 & \sim0 & .9 \end{pmatrix}(.90.1.10.9)\begin{pmatrix} .9 & \sim0 & .1 \\\\ .1 & \sim0 & .9 \end{pmatrix}
4(.7.3.3.7)\begin{pmatrix} .7 & .3 \\\\ .3 & .7 \end{pmatrix}(.7.3.4.6)\begin{pmatrix} .7 & .3 \\\\ .4 & .6 \end{pmatrix}(.80.2.10.9)\begin{pmatrix} .8 & \sim0 & .2 \\\\ .1 & \sim0 & .9 \end{pmatrix}(.80.2.10.9)\begin{pmatrix} .8 & \sim0 & .2 \\\\ .1 & \sim0 & .9 \end{pmatrix}
5(.7.3.3.7)\begin{pmatrix} .7 & .3 \\\\ .3 & .7 \end{pmatrix}(.7.3.3.7)\begin{pmatrix} .7 & .3 \\\\ .3 & .7 \end{pmatrix}(.90.1.10.9)\begin{pmatrix} .9 & \sim0 & .1 \\\\ .1 & \sim0 & .9 \end{pmatrix}(.90.1.10.9)\begin{pmatrix} .9 & \sim0 & .1 \\\\ .1 & \sim0 & .9 \end{pmatrix}

Notably, the fitted HMMs do not converge to latent states directly corresponding to the two outputs. Instead, each HMM state captures a mixture of outputs, as is also the case in the ground-truth HMMs. 

However, we believe that this analysis is affected by non-identifiability issues, which limit its utility in assessing differences between these models. We suspect that these issues arise from the specific design of the above ground-truth HMMs, which were the main focus of the original submission. This issue underscores the value of the additional HMM architectures we included in the revised manuscript (fully-connected, cyclic and 3-output linear-chains), where latent states of the ground-truth HMM become more clearly distinguishable.

While the above approach based on fitting HMM to the RNNs may not reveal all differences among the 4 models, and slight deviations from the ground-truth HMM cannot be fully ruled out, we want to emphasize that the fitted RNNs match the output statistics of the HMMs across all tested metrics, and that these metrics reveal clear differences between the 4 HMMs above. We added these metrics to Appendix A.3 (alongside the previously reported squared differences between RNN and ground-truth HMM output transition matrices), in particular observation volatilities and transition matrices of successive emissions. Observation volatilities measure how frequently outputs change over time, while transition matrices capture the empirical probabilities of switching between outputs. These metrics show that the 2,3,4, and 5-state HMMs in the original submission have different output statistics, and that the RNN fits capture these differences. This finding is further supported by the new analysis on the alignment of output dimensions with the orbit’s principal component plane (see also our Answer to question 2).

StatesObs. Vol. RNNObs. Vol. HMMOut. Trans. Mat. RNNOut. Trans. Mat. HMM
2.06±.03.06 \pm .03.07±.03.07 \pm .03(.940.06.470.51.060.94)\begin{pmatrix} .94 & \sim0 & .06 \\\\ .47 & \sim0 & .51 \\\\ .06 & \sim0 & .94 \end{pmatrix}(.940.05.480.51.050.94)\begin{pmatrix} .94 & \sim0 & .05 \\\\ .48 & \sim0 & .51 \\\\ .05 & \sim0 & .94 \end{pmatrix}
3.26±.06.26 \pm .06.25±.05.25 \pm .05(.730.27.510.49.270.73)\begin{pmatrix} .73 & \sim0 & .27 \\\\ .51 & \sim0 & .49 \\\\ .27 & \sim0 & .73 \end{pmatrix}(.750.24.470.52.240.75)\begin{pmatrix} .75 & \sim0 & .24 \\\\ .47 & \sim0 & .52 \\\\ .24 & \sim0 & .75 \end{pmatrix}
4.31±.06.31 \pm .06.30±.06.30 \pm .06(.690.29.520.48.300.70)\begin{pmatrix} .69 & \sim0 & .29 \\\\ .52 & \sim0 & .48 \\\\ .30 & \sim0 & .70 \end{pmatrix}(.700.28.510.48.290.70)\begin{pmatrix} .70 & \sim0 & .28 \\\\ .51 & \sim0 & .48 \\\\ .29 & \sim0 & .70 \end{pmatrix}
5.33±.06.33 \pm .06.31±.06.31 \pm .06(.650.34.510.47.330.66)\begin{pmatrix} .65 & \sim0 & .34 \\\\ .51 & \sim0 & .47 \\\\ .33 & \sim0 & .66 \end{pmatrix}(.690.29.510.48.300.68)\begin{pmatrix} .69 & \sim0 & .29 \\\\ .51 & \sim0 & .48 \\\\ .30 & \sim0 & .68 \end{pmatrix}

Importantly, our aim is not to enforce a direct correspondence between RNN and HMM latent spaces, but only to align their output statistics. This alignment allows us to reverse-engineer RNN internal dynamics and uncover potentially novel (continuous) latent mechanisms generating the observed (discrete) behaviors. The revised manuscript now emphasizes this perspective more clearly.

We thank the reviewer once again for the insightful comments and questions.

评论

Thanks for the detailed response!

I am inclined to agree with you that the structure of the ground truth HMMs used in the main text might have led to the non-identifiability issues, and I feel like this might weaken the paper a bit. Specifically, I think answering how transitions between more than two states can be implemented is important, because that isn't a very obvious generalization (to me). In the main text, it's not clear if this has been answered as the ground truth HMMs can be well-approximated by 2-state HMMs, and the RNNs similarly seem to switch between only two clusters. I understand that the new experiments with alternative HMM structures might get at this question, so I think the paper would be clearer and stronger if (some of) those results were in the main text.

Despite this reservation, the rebuttal has made the contributions of the work much clearer to me so I will increase my score to 4.

评论

We thank the reviewer for their thoughtful comment and for the revision of their score.

We agree that answering how transitions between more than two states can be implemented is very important. To address precisely this concern, we introduced a set of new experiments involving alternative HMM architectures that require transitions among three or more hidden states and produce more than two distinct outputs. In particular:

  • Fully-connected: 3-state HMM, where each state is mainly associated with a different output.
  • Cyclic: two variations of 4-state HMMs, where either 2 or 3 outputs are emitted.
  • Linear-chain: 3- to 5-state HMMs where each hidden state emits with a high probability one of the 3 outputs or a mixture of them.

(Detailed transition and emission probability matrices for the new models can be found in the answer to reviewer FrtZ).

Compared to the original models, which involved two output classes and exhibited two associated cluster regions in the RNN state space, these newer models (involving a third output) consistently exhibit a third, distinct cluster region corresponding to that additional output. Despite this increase in complexity, the core dynamical motifs identified in the manuscript persist and exhibit a compositional structure. Specifically, the same global and local mechanisms observed in simpler models are now reused and combined across the state space, forming modular components that collectively emulate the more complex target HMM dynamics. In particular, the global dynamics of the RNN remain organized in orbital trajectories connecting pairs of cluster regions. For example, in the fully-connected 3-state HMM, three orbits link the three clusters with asymmetric transitions (i.e., trajectories differ depending on direction). Each of these orbits mirror the single orbital structure described in the original models and preserve the same local structure observed in simpler models, comprising distinct cluster regions, kick-zones, and transition regions. Further, preliminary single-neuron analyses indicate that the underlying connectivity conserves structural organization analogous to those found in the original models.

These findings suggest that the previously identified 2-state dynamical motif functions as a dynamical primitive, a composable building block that the RNN systematically reuses to implement more complex latent dynamics. In models with additional outputs, each pair of clusters is connected by its own closed orbit with rotational and asymmetric transitions, leading to a global state space organized as a compositional assembly of multiple such orbits. Rather than introducing new mechanisms, the RNN seems to generalize by replicating and combining this core motif across multiple regions.

In light of this, and in agreement with the reviewer’s suggestion, we have now integrated key results and interpretations from these new experiments into the main text of the manuscript, rather than limiting them to the Appendix. Additionally, to more explicitly frame this generalization in the paper, we are happy to revise:

  • Figure 1 to display the RNN dynamics for the fully-connected 3-state HMM, where the compositional reuse of the orbit-based motif becomes immediately evident.
  • Figure 2 to highlight the identified mechanism as a modular and reusable dynamical primitive.
  • Introduction and Conclusion explanations.

We believe that these changes further strengthen the generality and significance of our results.

审稿意见
4

This work shows how RNNs can learn the stochastic dynamics of 4 different HMMs where the transition graph between hidden states is a line (the number of hidden states ranges from 2 to 5). The authors show that trained RNNs can reproduce to stochastic state transitions of these HMMs. Examining the projections onto the first two PCs of network activity, they find that the latent dynamics of the RNNs always produce “noise-sustained limit cycles” that are reminiscent of self-sustained stochastic resonance. Then, they examine single-neuron activity and perform targeted perturbation experiments identifying groups of neurons with different causal roles in these “noise-sustained limit cycles”.

优缺点分析

Strengths

The modeling setup the authors consider in this work is simple and clearly presented; its rationale is convincing. The text is well organized and the logic of the arguments are easy to follow. Overall, the text is well written.

I find the insights provided by this work on how RNNs can produce dynamics that are seemingly far away from standard RNN dynamics valuable.

On an algorithmic level, I find it impressive that they can effectively train RNNs using a loss function that compares probability distributions estimated through 30,000 randomly generated sequences.

Weaknesses

  1. The theoretical analysis of the latent dynamics of the trained RNNs appears to contain an important self-contradiction, and the theoretical arguments the authors present are sometimes incomprehensible.
    1. There is a contradiction between the first and the second paragraph of Section 4.1. In the first paragraph the author say that, in the absence of stochastic inputs, the latent dynamics of the RNNs suggest that there is a unique stable fixed point and no oscillatory dynamics; oscillatory dynamics (what the authors call “limit cycles”) only appear when stochastic inputs are added. This is coherent with Section 6, where the authors claim that this behavior is reminiscent of self-induced stochastic resonance. However, in the second paragraph of Section 4.1, the authors claim that oscillatory dynamics appear because the RNNs go through a Hopf bifurcation. This seems to contradict the explanation of the first paragraph. There are two other issues with the authors’ “Hopf bifurcation” explanation. First, in Muratov et al. (2005), the paper the authors refer to when introducing the notion of noise-induced stochastic resonance (SISR), Muratov et al. write explicitly than SISR is a phenomenon that appears before the Hopf bifurcation. Second, I do not understand the analysis presented in Appendix A.6. I have never heard of input-dependent stability analysis (the input being stochastic in this case) and I am not convinced by this approach. (Related to this point, I do not understand what is the y-axis on Fig. 4(c).)
    2. I could not follow Appendix B, despite spending a fair amount of time trying to understand the arguments. This could simply be due to poor writing. For example, δh(1)\delta h^{(1)} appears on line 484 without having been previously defined. It seems that a clear definition of what δh(1)\delta h^{(1)} and δh(2)\delta h^{(2)} is missing.
  2. On the methodological and theoretical sides, I cannot tell whether this work is original or not. The authors do not say explicitly in what aspects their methods or theoretical analyses are original.
  3. Some words with a precise meaning in dynamical systems are used with a much weaker meaning in the text. For example, the use of the term “limit cycle” when describing the latent dynamics of the RNNs is abusive. The dynamics of the latent variable only resemble that of a noisy limit cycle.
  4. The authors mentioned some preliminary results on HMMs with more diverse transition graphs but do not show them.
  5. The presentations of some figures could be improved.

问题

Weakness 1.1 above is the most important weakness of this work. Addressing this point satisfactorily, either by adding/updating current explanations or by completely removing all reference to the “Hopf bifurcation” explanation throughout the text, could change my rating from "reject" to "weak accept".

Regarding weakness 1.2, can the authors fix Appendix B and explain, in a self-contained manner, what δh(1)\delta h^{(1)} and δh(2)\delta h^{(2)} are? I also do not understand what allows the authors to write "without loss of generality" on l. 479. Shouldn't the input be inside the nonlinearity ϕ\phi? Clarifying these points would also positively affect my final rating.

Can the authors address weaknesses 2, 3, and 4?

Regarding weakness 5, here are some suggestions:

  • Fig 3: add legends for each rows of panels
  • Fig. 14: add titles, and legend to each rows
  • Fig 15: The labeling of the panels is confusing. In addition, a better choice of colors for the lines in the bottom panels would improve readability.

局限性

yes.

最终评判理由

Following the discussion period with the authors, I have changed my rating from 2 to 4. The reason my rating was 2, originally, was because the author used mathematical terms in a way that was imprecise and misleading, which I found inacceptable. The authors have now corrected and clarified the terminology they use and their mathematical arguments; to me, these changes are satisfactory and, in line with what I wrote in my original review, I am updating my rating to 4.

格式问题

No concerns.

作者回复

Thank you for the careful assessment of our manuscript. Your feedback proved invaluable in refining our work. Below, we provide a summary of the revisions we’ve made to address each of your points.

Summary:

  • Removed all references to the Hopf bifurcation and rephrased the relevant sections to describe the RNN dynamics in terms of rotational dynamics
  • Clarified the distinction between the analysis of the trained RNN and the one of the RNN during training
  • Revised the Appendix to clarify and align with the manuscript's notation
  • Added a novel contributions section to the introduction.
  • Corrected the use of the term limit cycle throughout the manuscript
  • Trained additional RNNs to show the generality of our findings with more complex HMM structures
  • Improved formatting of several figures following reviewer’s comments
  • Added further analyses in response to the other reviewers' feedback.

Weaknesses:

  • 1.1: We apologize for the confusion in our original explanation regarding the dynamics of the trained RNNs. The confusion stems from an unclear distinction between the dynamics during training and those observed after training with fixed weights. At fixed weights the removal of the input noise results in a loss of oscillatory/rotational dynamics and leads to a convergence of trajectories to the stable fixed point. During training, when input noise is always provided, over training steps we observe a transition which leads the RNN to produce closed orbits. In the manuscript, we referred to this transition at training time as a Hopf bifurcation. However we agree with the reviewer that making this analogy leads to a lack of descriptive clarity. In order to fully pursue this analogy we would have to go through an extensive formal proof, which is outside the scope of the current manuscript. We have thus decided to remove references to a Hopf-bifurcation from the paper. In addition, instead of referring to “limit cycles” we use the more accurate term "rotational/orbital dynamics" to describe the onset of these oscillations and report the emergence of the associated purely imaginary eigenvalues (Fig. 4(c)) during training. To clear up the difference between the analysis of the trained, fixed weights RNNs (1st paragraph sec 4.1) and the training time analysis (2nd paragraph sec 4.1), we now divide section 4.1. into two subsections:

    • Emergence of Orbital Dynamics under Stochastic Input:

      We investigate [...]. When initialized from random hidden states, and without external input, activity converged to a single stable fixed point, with no evidence for separate attractors that might be expected to represent the discrete latent states of the target HMMs. However, the latent dynamics change markedly for RNNs receiving stochastic (Gaussian) inputs, to a regime where the fixed point becomes the center of noise-sustained rotational dynamics. The stochastic input pushes [...] As the number of HMM hidden states increases, the RNNs do not develop additional slow regions along the closed orbits. Instead, they approximate the [...] without requiring additional dynamical structure.

    • Onset of Orbital Dynamics during Training:

      Across training epochs, we observe a qualitative shift in the RNN latent dynamics (see Fig. 4(a)). Initially, all solutions converge to a single fixed point. As the RNN is incentivized to reach both output states, it passes through a transitional phase, leading to a closed orbits solution that cycles between the two output states. Further evidence for the onset of this rotational behavior is provided by the emergence of the purely imaginary eigenvalues of the RNN Jacobian matrix after Möbius-transformation (Appendix A.6). As training [...]. Figure 4(c) shows a marked increase in both the number of eigenvalues near the imaginary axis and the count of unstable eigenvalues, indicating the precise epoch at which the transition occurs, which also corresponds to a double-descent of the loss curve [Eisenmann et al. ('23)] (Appendix A.5). This behavior is functionally significant, as the rotational trajectories enable quasi-periodic behavior that encodes the temporal dynamics of the target HMM (depicted in Fig. 6(c)). As shown in Figure 3, the radius of the orbit depends linearly on input variance. This relationship [...]. Under unbiased Gaussian noise, the first-order perturbation averages out, while the second-order term — scaling linearly with input variance — dominates post training transition, revealing how variance impacts the RNN dynamics (Fig. 4(d)). The network leverages this variance to move along the orbit and converges over training [...] input noise.

    We have also revised the Abstract and Conclusion accordingly. Regarding Appendix A.6 and Figure 4(c), the plot's eigenvalues were already computed using the Jacobian of the noise-free dynamics, as such we fixed the appendix by removing the input dependency to reflect this fact. For what concerns the axis of Figure 4(c) we now specify that the y-axis refers to the percentage of eigenvalues.

  • 1.2: We appreciate the reviewer’s comments on Appendix B, and we agree that the notation and explanations were insufficiently clear in some areas. We originally adopted the RNN formulation of Soon Hoe Lim ('21). In light of your feedback, we now align it more closely with the formulation and algorithm used in the manuscript, ht+1=ϕ(ht)W_hhT+xtW_inTh'_{t+1} = \phi(h'_t)W\_{hh}^T + x_tW\_{in}^T where W_hhW\_{hh} is now outside the activation function, and h_th'\_{t} represents the pre-activation hidden state. This should resolve the concern about the loss of generality, as we can recover the formulation used in other sections by setting ht=ϕ(ht)h_t = \phi(h’_t). In spite of this revised form, most of the calculations remain the same. The difference is that now, At=D_ϕ(hto)W_hhTA_t = D\_\phi(h_t^{'o})W\_{hh}^T and the derivative of the activation is computed on the pre-activations. As the actual estimation algorithm was not derived from this solution, the empirical results remain unchanged. We have also made explicit that the δh\delta h of the first part of the calculations is referred to as δh(1)\delta h^{(1)} in the second part, and we have reported the steps to derive δh(2)\delta h^{(2)} more clearly.

  • 2: To clarify the originality and contributions of our work, we have revised the Introduction by adding a Contributions paragraph: This work makes three novel contributions to understand how RNNs can implement discrete, probabilistic computations:

    • A training paradigm for stochastic RNNs (Sec 3.1-3.2, App A.2): unlike previous work focused on deterministic tasks, we introduce a training method combining noise-driven RNNs with Sinkhorn divergence optimization, enabling learning of the stochastic behaviors typical of HMMs.
    • Emulation of HMM statistics (Sec 4.1, Fig 3-4): we show that vanilla RNNs accurately emulate HMM emission statistics across the discrete - continuous spectrum.
    • A novel mechanism for RNNs with discrete stochastic outputs
      • Global dynamics (Sec 4.1, Fig 3-4): We reveal how training induces rotational dynamics and orbital trajectories.
      • Local dynamics (Sec 4.2, Fig 5): We identify three functional zones: clusters, kick-zones, and transitions, each with distinct dynamical signatures.
      • Connectivity and single neurons (Sec 5, Fig 6-7): We uncover structured connectivity between “noise-integrating populations” and "kick neurons" that trigger state transitions.
      • Computational principle (Sec 6, Fig 8): We show how the mechanism resembles self-induced stochastic resonance.

    Our findings reveal a coherent mechanism: local dynamical features like clusters and kick-zones give rise to global rotational dynamics, producing discrete outputs. The network’s connectivity reveals how individual neurons instantiate these dynamics. Together, they show that RNNs discover a general computational motif that combines slow noise integration with fast transitions. Preliminary results on more complex HMMs (Appendix B.3) suggest that the identified mechanism may act as a reusable “dynamical primitive,” which RNNs combine in a modular fashion to govern transitions between specific state pairs and approximate more complex discrete latent structures.

    Overall, this work offers a novel interpretation of how RNNs can generate stochastic transitions between discrete states, supporting the broader goal of reverse-engineering neural dynamics.

  • 3: We followed the reviewer’s suggestions and reworked the use of the terms “limit cycle” and “bifurcation” throughout the text.

  • 4: In the revised submission, we now show a wider applicability of our findings, we have added analyses of RNNs trained on HMMs with different graph structures (Appendix B.3), which demonstrate that the same mechanisms emerge:

    • Fully-connected: 3-state HMM, where each state is mainly associated with a different output.
    • Cyclic: 4-state HMMs, with closed-chain transitions
    • Linear-chain: 3- to 5-state HMMs where each hidden state emits with a high probability one of the 3 outputs or a mixture of them

    Unfortunately, we are not allowed to show the new related plots, which demonstrate that all RNNs exhibit the global and local dynamics described in the manuscript. In models 1, 2, 3, which have 3 outputs, we observe 3 “cluster regions” in the RNN state space and two sets of rotational trajectories, each implementing the transitions between pairs of clusters, analogous to those described in the manuscript. We thus hypothesize that the identified mechanism acts as a “dynamical primitive”, reusable in a modular fashion to emulate more complex HMM structures.

  • 5: We followed the suggestions of the reviewer to improve the presentation of the figures.

We would like to thank you for your review. We have addressed your concerns, please let us know if you have any others in order for your score to change.

评论

I thank the authors for their well-written anwers. Could the authors provide more details on what the mean by "We have also made explicit that the δh\delta h of the first part of the calculations is referred to as δh(1)\delta h^{(1)} in the second part, and we have reported the steps to derive δh(2)\delta h^{(2)}more clearly."? I'm not asking for the full derivation here, but I would appreciate a more detailed explanation of how they intend to modify ll. 486–487; I am not able to make sense of these two lines as they are written and their rebuttal does not provide enough information for me to be sure that I will understand them in the revised version.

评论

We thank the reviewer for their prompt response and want to ensure that our explanations in Appendix B are clear. We believe the confusion surrounding the definitions of δht(1)\delta h_t^{(1)} and δht(2)\delta h_t^{(2)} arises from an underspecification of the analysis steps, as well as from the evolving meaning of the term δht\delta h_t throughout the derivation. To address this, we provide below an overview of the goals of the Appendix B analysis and the clarifications introduced to better define δht(1)\delta h_t^{(1)} and δht(2)\delta h_t^{(2)}.

Overview of the Analysis:

Our primary goal is to understand how noise affects the stable dynamics of the system. To explore this, we investigate the first- and second-order effects of noise on the dynamics using a perturbative approach. Specifically:

First-Order Impact: We start by deriving the perturbation at the first-order: δht=δht(1)+O(σ2)\delta h_{t}=\delta h_t^{(1)} + O(\sigma^2)

We show that δht(1)\delta h_t^{(1)} depends on the noise from previous time steps (lines 483-484), effectively describing it as a convolution of the noise.

δht(1)=ϵs=0txsWinT(k=s+1t+1Ak)=ϵs=0txsWinTMt,s\delta h_t^{(1)} = \epsilon \sum_{s=0}^{t} x_s W_{\text{in}}^T \left( \prod_{k=s+1}^{t+1} A_k \right) = \epsilon \sum_{s=0}^{t} x_s W_{\text{in}}^T M_{t,s}

However, since the noise is unbiased (standard Gaussian), the first-order term vanishes in expectation. This means that the RNN cannot rely on first-order effects for learning, regardless of the values of WhhW_{hh} and WinW_{in}. This is expected given the unbiased RNN and the zero-mean noise.

Second-Order Impact: Since the first-order analysis is inconclusive, we expand the perturbation to include the second-order term: δht=δht(1)+δht(2)+O(σ3)\delta h_t= \delta h_t^{(1)} + \delta h_t^{(2)} + O(\sigma^3)

Here, we observe that δht(2)\delta h_t^{(2)} captures interactions between the noise at previous time steps (lines 488-489 - updated in the revised manuscript).

δht(2)=ϵ22s=0ti=1r[(δhs(1))i22ϕizi2(h^s0)]eiMt,s\delta h_t^{(2)} = \frac{\epsilon^2}{2} \sum_{s=0}^{t} \sum_{i=1}^r \left[ \left( \delta h_s^{(1)} \right)_i^2 \cdot \frac{\partial^2 \phi_i}{\partial z_i^2} \left( \hat{h}_s^0 \right) \right] e_i \cdot M _{t,s}

The second-order term generally depends on the covariance structure of the noise, however, since we are working with isotropic Gaussian noise, this term scales linearly with respect to the input noise variance, σ2\sigma^2 (lines 488-489). Moreover, because σ2>0\sigma^2 > 0, δht(2)\delta h_t^{(2)} does not vanish in expectation (at least for some values of WhhW_{hh} and WinW_{in}, unlike the first-order term). This allows the network to rely on the second-order term for learning, even if it cannot directly use the first-order effects. Indeed, E[δht(2)]\mathbb{E}[\delta h_t^{(2)}] becomes significant as soon as the orbital trajectories emerge during training (see Fig. 4(d)). This suggests that the RNN has learned a set of weights that enables a non-zero expected contribution of the noise variance to the dynamics.

Revisions in Appendix B:

In particular, to address your question, we have revised lines 484-486 in the Appendix as follows: 

"Given the unbiased nature of the Gaussian noise provided as input, we observe that the perturbation at the first-order, as previously defined: δht=δht(1)+O(σ2)\delta h_t = \delta h_t^{(1)} + O(\sigma^2), vanishes in expectation (E[δh]=0\mathbb{E}[\delta h] = 0). Therefore, the RNN noise-integration mechanism must rely on higher- order terms.

Hence, we refine the approximation of the perturbation by deriving the second-order term (δht(2)\delta h_t^{(2)}) and expanding δht\delta h_t to include this component: δht=δht(1)+δht(2)+O(σ3)\delta h_t = \delta h_t^{(1)} + \delta h_t^{(2)} + O(\sigma^3)  where δht(1)\delta h_t^{(1)} is the first-order term and δht(2)\delta h_t^{(2)} is the second-order term."

We thank the reviewer once again for the valuable feedback, which has helped us further improve the manuscript. We hope that our revisions have addressed all of your concerns and that you will consider reflecting this in your final evaluation.

评论

I thank the reviewer for the clarifications on Appendix B and I think that there revision plan is good. Since the authors have thoroughly addressed my concerns about the mathematical clarity of their paper - weaknesses 1 and 3 in my review - I will increase my score to 4.

评论

We thank the reviewer once again for the time they invested in reviewing our manuscript. Their feedbacks have been invaluable to further refine and strengthen our work.

审稿意见
4

In this work, the authors train Gaussian noise-driven RNNs with deterministic and continuous dynamics to behave like stochastic discrete HMMs of a specific class. RNNs are trained directly on the outputs of the HMMs with varying number of hidden states with a distributional loss function. Analyses of trained RNNs show a transition from input-free fixed point to noise-sustained limit cycle globally, with distinct clusters corresponding to the output states of the HMM. Locally, there appears to be 3 distinct types of “zones” that are biased to be within vs. move across the clusters. Finally, the authors identify and causally test single neuron mechanisms that, coupled with the noise input, appear to be responsible for kicking the system state into one of the clusters corresponding to the discrete HMM outputs.

优缺点分析

Strengths

  • it’s in my opinion an interesting investigation into the equivalence of two popular classes of dynamics, RNNs and HMMs, and the mechanisms that enable the former to behave like the latter, i.e., stochastic discrete dynamics
  • the analyses are thorough, covering multiple “levels” of investigation from population dynamics to single neuron mechanisms, as well as causal perturbations
  • the writing and presentation are in general clear and crisp

Weaknesses

  • the findings, while interesting, are based on a very narrow family of HMMs with a specific transition and emission probability structure, and thus unclear how generalizable the insights are (e.g., results in 4.1)
  • the writing is very clear at the sentence level. But structurally, it was difficult to understand and follow the whole picture. Given the density of results and a lack of high-level signpost (perhaps at the end of the intro), it read to me like a list of disparate findings.
  • I’m ultimately not sure what the implication or significance of these results are. I suppose it’s not a given that RNNs can be trained to behave like HMMs. But even accepting that this is a novel finding, in addition to the in-depth investigation into its mechanisms, the fact that it’s a purely modeling study employing a very narrow class of HMMs leaves me wondering what this means for brain circuits.

问题

  1. Is it not relevant to discuss HMMs, stochastic RNNs, and “hybrids” like switching LDS in the related works section? Similarly, perhaps a brief mention of the relationship between HMMs and linear Gaussian systems (stochastic linear RNNs) may be instructive?
  2. What’s the rational for using the specific class of HMMs defined in eq 1? The overall motivation for this is not clear, as well as specific choices, e.g., why reduce the generality of the HMM model, e.g., by limiting the transition matrix to being band-diagonal? (line 76) What happens when these assumptions are violated?
  3. what happens if the middle output class (O2) is removed?
  4. observed state labels in Fig1d shows O1,2,3, whereas everywhere else in text is labeled as 0-2?
  5. line 82: I’m confused what is meant by “the same 0 to 2 continuum is partitioned…” Does this refer to the latent state, which increases with M and is hence further partitioned, or the observation space, which seems to be always 3 discrete states?
  6. Based on the schematic shown in Figure 2, how is the system different from the normal bistable / double well potential?
  7. could you please clarify how Fig 3 row iii shows less skewed distribution as HMM state increase?
  8. I’m not sure about the generality of the SISR claim: does this not depend on the exact structure of the transition and emission matrices? The current setup, even in the 5-hidden state HMM, has a strong preference for the two extreme output classes, both through high-probability transitions into the 1st and last hidden state, and the fact that the middle output state O2 always has very low probability. Do all these findings hold for flatter distributions?
  9. there is some discussion of stochastic dynamics in the brain in the conclusion section, but it’s not at all clear to me how that relates to the current study. Is the idea that brain circuits can be well-modeled by continuous dynamics RNNs, but behavior has been observed through methods such as MoSeq to be composed of discrete set of syllables, so we need to find the equivalence? This is briefly described as the motivation of the study in the introduction, which is informative, but I think much more can be said throughout the paper to concretely relate the current findings to that overarching idea / goal, though I understand that this is difficult to do with a purely computational modeling study.

局限性

In my opinion, there is an inadequate discussion of the setup and assumptions underlying the current study, in particular the narrow range of HMMs used and therefore possible observed behaviors.

最终评判理由

The work is technically solid and showcases interesting and in-depth mechanistic analyses of the learned RNN. Originally restricted to a narrow class of HMMs, but later expanded during revision, with apparently similar conclusions.

格式问题

none

作者回复

Thank you for the helpful feedback. We have substantially revised the manuscript and added new experiments to address your comments.

Summary:

  1. Revised Introduction and Conclusion and added Contributions.
  2. Fitted additional RNNs to more complex HMM structures (App B.3) showing a wider applicability of our findings.
  3. Expanded the Related Work section to include suggested references.
  4. Added a paragraph to Conclusion clarifying how the RNN dynamics differs from the N-well potential landscape.
  5. Clarified the rationale for our HMM design choices in Section 3.1.
  6. Added further analyses in response to the other reviewer's feedback (other responses)

Weaknesses:
We would like to clarify that the goal of our work is not to provide a comprehensive account of all possible HMM variants. Instead, we focus on a more general question: Can RNNs, in principle, reproduce the behavior of HMMs, and if so, through what mechanisms? This question is motivated by work in computational neuroscience, where training and reverse-engineering RNNs has proven to be an effective approach for uncovering how neural circuits, both artificial and biological, implement computations. In several cases, this methodology has led to mechanistic hypotheses that were subsequently tested through experiments (e.g., Sussillo et al. '15 or Hennequin et al. '14).

In our case, the computations of interest involve stochastic transitions between discrete states, a common motif in models of naturalistic behavior (e.g., Calhoun et al. '19). Studying these computations required the development of new training and analysis pipelines, since existing methods primarily target deterministic tasks and do not naturally extend to modeling stochastic, discrete dynamics. To make this motivation more explicit, we revised the Introduction, Conclusion, and added a Contributions section that outlines our goals and coherent narrative.

Introduction and Contributions:
Machine […] experiments. Hidden Markov Models (HMMs) can capture natural, unconstrained behaviors as sequences of elemental motifs [46], but their discrete state representation may oversimplify the continuous complexity of neural processes. On the other hand, Recurrent Neural Networks (RNNs) provide a powerful approach to model the dynamics of large neural populations and to generate hypotheses about the underlying computations [10, 47]. Despite their potential, RNNs are mostly applied to deterministic, highly-constrained and input-driven tasks, and evidence for their ability to model stochastic, discrete state transitions like HMMs remains limited.

RNNs […] them. Understanding whether RNNs can use continuous dynamics to generate stochastic transitions between discrete states would help bridge this conceptual gap and reduce the need for strong assumptions about the structure of the latent space. To address this question, we develop a training approach to directly fit RNNs to HMMs, and then reverse-engineer the trained RNNs to uncover the computations they implement. This strategy may ultimately lead to testable hypotheses about how biological neural circuits may implement discrete behavioral modes through continuous internal dynamics.

This work makes three novel contributions to understand how RNNs can implement discrete, probabilistic computations:

  1. A training paradigm for stochastic RNNs (Sec 3.1-2, App A.2): unlike previous work focused on deterministic tasks, we introduce a training method combining noise-driven RNNs with Sinkhorn divergence optimization, enabling learning of the stochastic behaviors typical of HMMs.
  2. Emulation of HMM statistics (Sec 3.2, App A.3, Fig 10-11): we show that RNNs accurately emulate HMM emission statistics across the discrete - continuous spectrum.
  3. A novel mechanism for RNNs with discrete stochastic outputs
    1. Global dynamics (Sec 4.1, Fig 3-4): We reveal how training induces rotational dynamics and orbital trajectories.
    2. Local dynamics (Sec 4.2, Fig 5): We identify three functional zones: clusters, kick-zones, and transitions, each with distinct dynamical signatures.
    3. Connectivity and single neurons (Sec 5, Fig 6-7): We uncover structured connectivity between “noise-integrating populations” and "kick neurons" that trigger state transitions.
    4. Computational principle (Sec 6, Fig 8): We show how the mechanism resembles self-induced stochastic resonance.

Our findings reveal a coherent mechanism across levels of description: local dynamical features like clusters and kick-zones give rise to global rotational dynamics, producing discrete outputs. The network’s connectivity reveals how individual neurons instantiate these dynamics. Together, these contributions show that RNNs discover a general computational motif that combines slow noise integration with fast transitions. Preliminary results on more complex HMMs (App B.3) suggest that the identified mechanism may act as a reusable “dynamical primitive”, which RNNs combine in a modular fashion (Contributions 3.1–4) to govern transitions between specific state pairs and approximate more complex discrete latent structures.

Overall, this work offers a novel interpretation of how RNNs can generate stochastic transitions between discrete states, contributing to the broader goal of reverse-engineering neural dynamics. These results lay the groundwork for scaling to more complex HMM structures and investigating whether similar dynamical motifs underlie biological computations in naturalistic behavior.

To show a wider applicability of our findings, we have added analyses of RNNs trained on HMMs with different graph structures (App B.3), which demonstrate that the same mechanisms emerge. In particular, we consider 3 new classes of HMMs:

  1. Fully-connected: 3-state HMM, where each state is mainly associated with a different output.
  2. Cyclic: 4-state HMMs, with closed-chain transitions and 2 or 3 outputs emitted.
  3. Linear-chain: 3- to 5-state HMMs where each hidden state emits with a high probability one of the 3 outputs or a mixture of them.

Unfortunately, we are not allowed to show the new related additional plots, which demonstrate that all RNNs exhibit the global and local dynamics described in the manuscript. Preliminary analyses also reveal analogous connectivity structure at the single neuronal level. In models 1, 2, 3, which have 3 outputs, we observe 3 cluster regions in the RNN state space and two sets of rotational trajectories, each implementing the transitions between pairs of clusters, analogous to those described in the manuscript. We thus hypothesize that the identified mechanism acts as a “dynamical primitive”, reusable in a modular fashion to emulate more complex HMM structures.

Questions:

  1. Thank you for these relevant references, we have expanded the Related Work section to include a discussion on stochastic RNNs, sLDS and linear Gaussian systems.
  2. We used band-diagonal HMMs to systematically vary discreteness while preserving interpretability (clarified in Sec 3.1). To test generality, we added experiments (App B.3) with fully connected, cyclic, and linear-chain HMMs. Despite differing structures, all trained RNNs show the same global and local dynamics described in the main text.
  3. We trained additional RNNs without O2 and, given its very low emission probability in the original HMMs, found that its removal has no effect on the latent states or dynamics.
  4. We have corrected inconsistent labeling (O1,2,3 vs 0,1,2) to O1,O2,O3.
  5. Here we refer to the fact that as the number of hidden states increases, the discrete jump between states 1 and 2 (in emission distributions of the 2-states) gets divided by intermediate states with interpolating emission probabilities between O1 and O3 (clarified in Sec 3.1).
  6. This is a key question that we now address in the Conclusion. We initially expected the RNNs to implement a solution via a double well potential (or N-well potential for N-state HMM), with transitions between wells driven by the noisy input. However, the identified mechanism differs in several ways from such a solution. First, trained RNNs consistently have only a fixed point (Fig 3(i)). Nonetheless, they generate “clusters” of activity characterized by specific emission distributions (Fig 3(ii)). Second, transitions between these clusters are “asymmetric” (different trajectories from cluster "A to B" vs "B to A"), while in an N-well potential, transitions could occur across the same path in both directions.
  7. In Fig. 3(iii), trajectories are colored by sampled output (while Fig 3(ii) uses the dominant logit), illustrating how output labels intermix more as HMM state count increases. However, we agree with the reviewer that this can be better evidenced. Hence, we now quantify in the Appendix how the alignment of output dimensions with the principal component plane of the orbits systematically degrades as the number of HMM states increases, which leads to a more uniform output distribution.
  8. As described above, we now also include HMMs with different graph structures. Preliminary analyses of these RNNs show analogous dynamics as those described in the initial submission. Further, we clarified how RNNs implement the “continuous” transition between two “extreme” states in the 5-state HMMs (analyses on alignment of pc-plane/output dimensions, Question 7). Together, these basic mechanisms seem to be suited to capture the dynamics of a broad class of HMMs, beyond the examples we present in the manuscript.
  9. The reviewer correctly points out the motivation for our manuscript, which we now discuss more clearly in the Introduction and Conclusion.

We would like to thank you for your review. We have addressed your concerns, please let us know if you have any others in order for your score to change.

评论

I thank the authors for the response, and especially the new experiments with different HMM models. Given that these new analyses are included in the revised manuscript, I believe the increased breadth much better evidence the claims of the paper, and therefore increase my score.

I understand that figures cannot be included during revisions this year, but could the authors perhaps briefly describe the global and local mechanisms for the 3 other classes of HMMs modeled?

评论

We thank the reviewer for their positive feedback and for the revision of their score.

We are happy to provide further details on the newly introduced HMM architectures and the corresponding RNN models. As outlined in our response above, Appendix B.3 presents additional analyses demonstrating that the same global and local mechanisms identified in the original manuscript emerge consistently across three additional HMM classes:

  • Fully-connected: 3-state HMM, where each state is mainly associated with a different output. In particular:
    • Transitions: \\begin{bmatrix} 0.95 & 0.025 & 0.025 \\\\ 0.025 & 0.95 & 0.025 \\\\ 0.025 & 0.025 & 0.95 \\end{bmatrix}
    • Emissions: \\begin{bmatrix} 0.98 & 0.01 & 0.01 \\\\ 0.01 & 0.98 & 0.01 \\\\ 0.01 & 0.01 & 0.98 \\end{bmatrix}
  • Cyclic: two variations of 4-state HMMs, where either 2 or 3 outputs are emitted. In particular:
    • Transitions: \\begin{bmatrix} 0.95 & 0.025 & 0.0 & 0.025 \\\\ 0.025 & 0.95 & 0.025 & 0.0 \\\\ 0.0 & 0.025 & 0.95 & 0.025 \\\\ 0.025 & 0.0 & 0.025 & 0.95 \\\\ \\end{bmatrix}
      • 2-Outputs Emissions: \\begin{bmatrix} 1 & 0 \\\\ 0.6 & 0.4 \\\\ 0 & 1 \\\\ 0.4 & 0.6 \\end{bmatrix}
      • 3-Outputs Emissions: \\begin{bmatrix} 0.9 & 0.1 & 0.0 \\\\ 0.1 & 0.9 & 0.0 \\\\ 0.0 & 0.1 & 0.9 \\\\ 0.0 & 0.9 & 0.1 \\end{bmatrix}
  • Linear-chain: 3- to 5-state HMMs where each hidden state emits with a high probability one of the 3 outputs or a mixture of them. Due to space constraints, we omit the explicit transition and emission matrices for these models here.

Compared to the original models, which involved two output classes and exhibited two associated cluster regions in the RNN state space, these newer models (involving a third output) consistently exhibit a third, distinct cluster region corresponding to that additional output.

Despite this increase in complexity, the core dynamical motifs identified in the manuscript persist and exhibit a compositional structure. Specifically, the same global and local mechanisms observed in simpler models are now reused and combined across multiple regions of the state space, forming modular components that collectively emulate the more complex target HMM dynamics. In particular:

  • Global dynamics remain organized in orbital trajectories linking pairs of cluster regions. For example, in the RNN trained on the fully-connected 3-state HMM, we observe three distinct orbits, each connecting a pair of clusters (3 clusters - 3 orbits) with rotational dynamics and asymmetric transitions (i.e., trajectories differ depending on direction). These orbits mirror the single orbital structure described in the original models.
  • Local dynamics associated with each orbit continue to exhibit three distinct functional zones: cluster regions, kick-zones, and transition regions, each with characteristic dynamical signatures as described in the manuscript.
  • Preliminary analyses at the single-neuron level suggest that the underlying connectivity patterns conserve structural motifs similar to those identified in the original manuscript.

These findings indicate that, in the presence of more complex HMMs with additional hidden states and outputs, the previously described 2-state dynamical motif is reused and composed modularly. Each pair of clusters is connected via its own closed orbit, characterized by rotational dynamics and asymmetric transitions. As a result, the global structure of the RNN state space becomes a compositional assembly of multiple such orbits, each encoding transitions between specific cluster pairs. This modular organization mirrors the underlying HMM structure and highlights the flexibility of the identified dynamical mechanism in scaling to more complex latent dynamics.

In agreement with the reviewer (and also noted by reviewer Qvyv), we find that these additional analyses significantly broaden and reinforce the claims made in the manuscript. Therefore, rather than limiting this content to the Appendix, we have now integrated key results and interpretations from this section into the main text of the manuscript.

评论

Thank you for the detailed explanation—glad to hear that these new results will be included in the main text.

评论

We thank the reviewer once again for the time and care they devoted to evaluating our manuscript, as well as for the invaluable feedback that helped us refine it further. If the reviewer has further comments, we are happy to address them; otherwise, if they feel that the above revisions have further clarified and strengthened the work, we would of course be happy to see this acknowledged in the final score.

审稿意见
6

The authors describe their efforts to train and then reverse engineer vanilla RNNs to reproduce the probabilistic dynamics of an HMM. The authors utilize a range of mathematical techniques from nonlinear dynamics, perturbation theory, dimensionality reduction, machine learning, and computational neuroscience to describe in detail the mechanisms that the trained RNNs deploy and the training dynamics that they display.

优缺点分析

This paper is exceptional in every regard. It is surprisingly easy to read despite being extremely dense. The authors were both careful and complete in both their experiments and their analysis. The paper addresses an interesting and important question regarding the learning of a stochastic process by an RNN, and the analyses in Sections 4-6 were a feast of methods and details that were seamlessly integrated into a mechanistic description of the RNN dynamics from the population, connectivity, and single-neuron levels. The ease and simplicity of paper belies a mountain of work both in the analysis and the writing.

问题

None.

局限性

yes

格式问题

None

作者回复

We thank the reviewer for the time they invested reviewing our manuscript and the very positive feedback.

评论

While the other reviewers brought up some excellent, and critical, points that I missed, the authors have responded well to all comments and I stand by my original score.

评论

We thank the reviewer once again for their positive comments on our work, we are pleased to hear that they found it valuable.

最终决定

This paper shows that a certain class of Hidden Markov Models (HMMs) can be well approximated by recurrent neural networks (RNNs). This represents a novel and important contribution to the literature due to the popularity of HMMs for the analysis of behavior and neural responses, and the fact that the brain itself must implement such discrete latent states via a system with continuous valued units (like RNNs). I have some concerns about the validity of the paper's claims about the existent of limit cycles, which should (at least in classical dynamical systems theory) be identified with specific a manifold of the deterministic dynamical system, and not dependent on the presence of stochastic inputs. (That is, it isn't enough to simply examine the distribution of points in PC projections of the noisy high-dimensional trajectories to claim the existence of a limit cycle; rather, one would need to show that nearby trajectories of the (deterministic) system approach this trajectory in the limit t-> infinity.) So I would urge the authors to either make these claims more rigorous (using the dynamics of the deterministic system) or else remove them from the paper. (I would say the same for claims about a Hopf bifurcation). Nevertheless, the reviewers were unanimous in their assessment that the paper makes a worthwhile contribution to the literature and should be accepted. Congratulations! Please be sure to address all reviewer comments and criticisms in the final manuscript.