When a recurrent neural network learns a regular language, its continuous hidden vectors tend to group into clouds, one per state of the finite automaton it imitates. Extracting that automaton means deciding where one cloud ends and the next begins. Current methods draw those boundaries empirically, either with fitted classifier hyperplanes or with k-means, and they fail when the hidden dynamics are complicated. This proposal treats the boundary question as a question about dynamics. Take a word that loops back to the same automaton state, and consider the network's map from hidden state to hidden state after reading that word. If the network keeps two automaton states apart, this map has two fixed points. If it merges them, it has one. The point where one fixed point becomes two is a bifurcation, a parameter value where the qualitative behavior of a dynamical system changes. Near a bifurcation, Lyapunov-Schmidt reduction, a classical technique that collapses a large nonlinear equation onto the few directions where it is degenerate, gives an exact low-dimensional equation for the new fixed points. It also gives the direction in which they separate.
The plan is to build an automaton extractor that splits a state cloud only along that reduced direction, at the moment the reduced equation says a split has occurred. We will test it on a benchmark constructed from algebraic orbit finiteness. That result says that repeatedly applying operations such as complement, prefix closure, factor closure and Kleene star to any language yields only finitely many distinct languages. Each seed language therefore produces a closed family of related languages, between 14 and 50 of them, whose minimal automata and synchronization behavior can be computed exactly. Within such a family, extraction accuracy and state counts can be checked against ground truth rather than estimated.
Core Claim
Our claim is that refinement errors in neural automaton extraction are local bifurcation phenomena. Fix a trained network with hidden update $h_{t+1}=F(h_t,x_t;\lambda)$, where $\lambda$ is a continuation parameter (a training checkpoint index, or the weight of a discreteness penalty). Fix also a word $u$ that the current hypothesis automaton maps from a state $q$ back to itself. Write $F_u$ for the composition of $F$ along $u$. The fixed-point equation is
$$G(h,\lambda) = h - F_u(h;\lambda) = 0,$$
and a hidden-state cloud contains two true automaton states that the hypothesis has merged exactly when this equation has two nearby solutions. Generically, those solutions are born where the matrix $I - D_hF_u$ becomes singular. Let $\phi$ span its kernel, let $\psi$ span the kernel of its transpose, and let $\Phi(s,\lambda)$ be the correction on the complement given by the implicit function theorem. The full equation then reduces to the scalar bifurcation equation
$$g(s,\lambda) = \psi^{\top} G\big(h^{*} + s\phi + \Phi(s,\lambda),\lambda\big) = 0,$$
whose roots in $s$ correspond one-to-one with the network's distinct states near $h^{*}$.
This yields three concrete predictions that empirical partitioning cannot make. The split direction is $\phi$, not the normal of a hyperplane fitted to labeled points. The split time is the value $\lambda_c$ at which the smallest singular value of $I-D_hF_u$ crosses zero. The low-order coefficients of $g$ give the shape of the split, for example symmetric pitchfork versus fold. For a pitchfork the two new states separate like $\sqrt{\lambda-\lambda_c}$, which follows from the cubic normal form.
Where This Sits
Three lines of work extract automata from recurrent networks, and each motivates the gap. Extracting Automata from Recurrent Neural Networks Using Queries and Counterexamples couples Angluin's query-based learning algorithm with SVM partitions of hidden space, refining a partition whenever a counterexample exposes it as too coarse. It reaches over 99% fidelity on Tomita grammars, but it times out or explodes combinatorially when hidden dynamics are complex. Its hyperplanes carry no dynamical meaning. We keep its query loop and replace how and where it splits. An Empirical Evaluation of Rule Extraction from Recurrent Neural Networks clusters activations with k-means and then minimizes the result with Hopcroft's algorithm. Its success varies from 100% on some grammars to around 50% on others, depending heavily on the number of clusters. Our split criterion is meant to make that number an output rather than a hyperparameter. Learning minimal automata with recurrent neural networks forces discreteness during training with a softmax/hardmax state layer and a cross-entropy penalty. It recovers all Tomita grammars, but it is limited to roughly ten states, and its authors describe the collapse as heuristic. Its discreteness-penalty weight is a natural continuation parameter $\lambda$ for us.
A fourth relevant line is Spectral Regularization: an Inductive Bias for Sequence Modeling. It penalizes the nuclear norm of the Hankel matrix (the table of the model's outputs on prefix–suffix pairs), whose rank equals the minimal state count. That method constrains how many states a model has. It says nothing about which hidden directions separate them, and it explicitly leaves open what happens where the effective rank jumps. Our proposal studies exactly those jumps.
The reduction technique itself comes from Symmetry-Breaking Bifurcation in Nonlinear Schrödinger/Gross-Pitaevskii Equations and Symmetry Breaking and the Generation of Spin Ordered Magnetic States in Density Functional Theory Due to Dirac Exchange for a Hydrogen Molecule. Both use Lyapunov-Schmidt reduction to show that a symmetric state loses stability to a pair of asymmetric states as a parameter crosses a threshold. We reuse the computational recipe: kernel, complement correction, then a scalar reduced equation. Both papers also constrain the proposal. Their conclusions hold only near the critical point, and controlling the remainder terms requires an asymptotic regime. So we claim only local validity and apply the reduction one candidate split at a time.
Synchronization theory supplies the strongest test cases. A reset word sends every state of an automaton to a single state. Principal Ideal Languages and Synchronizing Automata shows that factor-closed ("ideal") languages are recognized by synchronizing automata and builds $(n+1)$-state examples. For such languages, the network's map along a reset word should be a global contraction with a unique fixed point. A margin of $1-\rho$, where $\rho$ is the spectral radius of $D_hF_w$ at that fixed point, then serves as a local certificate that the network has really learned to reset. A margin approaching zero predicts the failure before long-string tests reveal it.
Research Program
The first component is an orbit-suite benchmark. We take each of the seven Tomita grammars and a set of random regular languages as seeds, and enumerate their orbits under $\{p,c\}$ (prefix closure and complement) and $\{k,c,f\}$ (Kleene star, complement, factor closure). We use the pruning identities of Composition and orbits of language operations: finiteness and upper bounds, which bound these orbits at 14 and 50 respectively, with both bounds tight. We also include the paper's extremal 8-state automaton for $\{p,c\}$ and its multi-copy construction for $\{k,c,f\}$ as hard seeds. For every orbit member we compute the minimal automaton, whether it synchronizes, and its exact reset threshold.
The $\{p,c\}$ orbit is especially useful. Both operations act on a deterministic automaton by changing only which states accept, leaving transitions untouched. All 14 languages therefore share one transition graph and differ only in their accepting sets and in the state merges those sets induce. This gives a controlled experiment: the dynamics a network must learn are essentially fixed, while the number of states it must keep apart changes in known ways. Complement in particular never changes the minimal state count, which gives a free consistency check. Computing reset thresholds across whole orbits also produces a small empirical answer to an open question about how reset thresholds behave under closure operations. We treat that as a by-product, not the main result.
The second component is the extractor. We train GRUs, LSTMs and the softmax-state networks of Aichernig et al. on each orbit member. We then run Angluin-style extraction in which every refinement request is resolved as follows. We compute the composite map along the offending loop word, solve for its fixed point with Newton's method, and take the smallest singular pair of $I-D_hF_u$. When a continuation path is available (checkpoints, or penalty weights), we locate $\lambda_c$. We then fit the low-order coefficients of $g$ by evaluating the reduced equation along $\phi$, and split the cloud by the sign of the kernel coordinate $s$.
The third component is analysis. We will measure whether observed branch separations follow the predicted normal forms. We will also test whether singular-value crossings along training checkpoints line up with the moments at which the Hankel rank, estimated on held-out prefixes, jumps.
Baselines
The naive reference point is k-means followed by Hopcroft minimization, as in An Empirical Evaluation of Rule Extraction from Recurrent Neural Networks, with the number of clusters chosen by silhouette score from the same activation sample. Beating it means recovering the exact minimal automaton substantially more often on the $\{k,c,f\}$ orbits, where that paper's own success rate already fell to around 50% on some single grammars.
The strongest competitor is SVM-partition refinement inside the query loop from Extracting Automata from Recurrent Neural Networks Using Queries and Counterexamples, which reports over 99% fidelity to the trained network on Tomita grammars and random regular languages. We will run it on the identical trained networks, with the same membership-query budget, the same equivalence-query sampling and the same wall-clock limit, swapping only the refinement step. Fidelity alone leaves little room at 99%. Beating it therefore means matching fidelity while using fewer refinements and fewer timeouts, and recovering the ground-truth minimal state count on orbit members where the SVM version over-splits or fails to finish.
The third baseline is the trained-in discretization of Learning minimal automata with recurrent neural networks, which recovered all Tomita grammars and outperformed RPNI on its Bluetooth traces. We will give it the same training budget and compare exact recovery as target size grows past its reported limit of about ten states. The spectral regularizer is the fourth baseline, applied to the same architectures. We found no reported scalar result on Lacuna for spectral regularization on Tomita grammars, since only negative-log-likelihood curves are described, so it will be run fresh.
Two ablations isolate the key ingredient. The first splits along a random direction or along the top principal component of the cloud, which tests whether $\phi$ matters at all. The second uses only the linear Jacobian kernel, without the reduced equation, which tests whether the nonlinear part of the Lyapunov-Schmidt reduction adds anything.
Why not just…?
Why not just keep the SVM refinement, which already exceeds 99% fidelity? This is the real threat. On plain Tomita grammars it may be unbeatable on fidelity. The case for our method rests on the harder orbit members and on cost. Weiss et al. themselves report timeouts and state explosion when dynamics are complex. If our extractor does not reduce refinements or timeouts on the 50-member orbits, the dynamical view is not paying for itself, and we will report that outcome.
Why not just use the Jacobian's smallest singular vector and skip Lyapunov-Schmidt? The linear kernel gives the split direction. It does not tell whether the split is symmetric, how far apart the branches are, or whether a near-singularity is a genuine split or a fold that will vanish. The second ablation measures exactly this. If the linear version matches the full reduction, we will say the contribution is "kernel-direction refinement" and drop the stronger claim.
Why not just regularize the Hankel rank, or force discreteness during training? Both control how many states exist. Neither identifies which hidden directions separate them, or when a separation appears. The spectral method also suffers estimator variance, and forced discretization has been shown only up to about ten states. Neither replaces an extractor for an already-trained network. They are complementary, and running them as baselines on identical orbit suites will show whether they make post-hoc extraction unnecessary on these targets.
Proposed Experiments
The decisive comparison is exact minimal-automaton recovery rate, absolute state-count error, number of refinement steps and timeout rate across all orbit members, against the four baselines and two ablations above. We will also report fidelity to the network and accuracy on strings ten times longer than those seen in training.
Three checks would settle the core claim. In the first, for networks saved at many checkpoints, the smallest singular value of $I-D_hF_u$ should cross zero within a few checkpoints of the moment the extracted state count increases. Branch separation after the crossing should fit $\sqrt{\lambda-\lambda_c}$ when the fitted quadratic coefficient is near zero. In the second, on synchronizing orbit members (ideals and their complements), the contraction margin along the true reset word should predict which networks keep context-independent outputs after that word on long strings, scored by AUC against long-string error. In the third, extracted state counts for $L$ and its complement should agree exactly, and members of a $\{p,c\}$ orbit should yield extracted automata with a shared transition graph. Failing that check would mean the extractor is reading the readout rather than the dynamics.
A negative outcome is also informative. If singular-value crossings do not align with state splits, the bifurcation picture of state formation is wrong for trained networks, and empirical partitioning is the right tool after all.
References
- Extracting Automata from Recurrent Neural Networks Using Queries and Counterexamples
- An Empirical Evaluation of Rule Extraction from Recurrent Neural Networks
- Learning minimal automata with recurrent neural networks
- Spectral Regularization: an Inductive Bias for Sequence Modeling
- Symmetry-Breaking Bifurcation in Nonlinear Schrödinger/Gross-Pitaevskii Equations
- Symmetry Breaking and the Generation of Spin Ordered Magnetic States in Density Functional Theory Due to Dirac Exchange for a Hydrogen Molecule
- Principal Ideal Languages and Synchronizing Automata
- Composition and orbits of language operations: finiteness and upper bounds