# Fold-aware fast-slow neural state layer

- ID: 971
- Canonical URL: https://synthcore.org/idea/971/fold-aware-fast-slow-neural-state-layer
- API JSON: https://synthcore.org/api/idea/971.json
- API Markdown: https://synthcore.org/api/idea/971.md
- Verification status: unverified
- Source: [arXiv:2607.15692](https://arxiv.org/abs/2607.15692)
- Category: dynamics
- Solves: stability, accuracy
- ML areas: rnn, ssm, training-dynamics
- Math tags: dynamical-systems, bifurcations, linear-algebra
- Ratings: usefulness 6/10; difficulty 5/10; novelty 7/10

## Idea description

Replace a single recurrent or neural-ODE state update by a fast subsystem for the rapidly relaxing state and a slow subsystem for context, memory, or parameters. Constrain the learned algebraic critical manifold to remain normally hyperbolic during ordinary operation, while treating its folds as explicit, detectable transition surfaces that can generate controlled regime changes rather than numerical blow-up.

## Mathematical statement

The paper's layer problem freezes the slow variables P and S and evolves the fast variables T,U according to \(\dot T=U\), \(\dot U=T-P/(1-\rho\phi(T))\). Its critical manifold is defined by \(U=0\) and \(P=T(1-\rho\phi(T))\). The tangent map from T to P has derivative \(D(T)=1-\rho[\phi(T)-T\phi'(T)]\); folds occur at \(D(T)=0\), and reduced dynamics written in T coordinates become singular there. In a neural layer, P is a slow feature or learned context, T is the fast hidden state, U is its velocity, \(\rho\) is a learned or scheduled coupling, and \(\phi\) is a bounded differentiable neural function. The engineering rule is to enforce \(|D(T)|\geq\delta\) away from intentionally scheduled transitions, and to reduce the fast integration step when \(|D(T)|\) approaches \(\delta\).

## Key formulas

- $$\dot T=U,\qquad \dot U=T-\frac{P}{1-\rho\phi(T)}.$$
- $$\mathcal C_0=\left\{(P,S,T,U):U=0,\;P=T\bigl(1-\rho\phi(T)\bigr)\right\}.$$
- $$D(T)=\frac{\mathrm dP}{\mathrm dT}=1-\rho\left[\phi(T)-T\phi'(T)\right],\qquad \text{fold: }D(T)=0.$$
- $$T'=\frac{S}{D(T)}\quad\text{on a reduced branch, hence choose }|D(T)|\geq\delta\text{ for regular operation}.$$

## Implementation notes

1. Integration point: use this as the recurrent cell in a small RNN or as one layer of a neural ODE. Let x_k be the input, P_k=MLP_P(h_k,x_k) be the slow context, and let T_k,U_k be the fast hidden state. Parameterize phi(T)=sigmoid(a(T)) so that 0<phi<1, and use a positive rho with rho<1 for a first experiment. 2. Pseudocode: compute P; for j=1,...,m, evaluate d=1-rho*(phi(T)-T*phi_prime(T)); set U <- U + (dt/epsilon)*(T-P/(1-rho*phi(T))); set T <- T+dt*U; optionally add a slow update P <- P+dt_s*S; record |d|. Add the penalty lambda*relu(delta-|d|)^2 and clip or reduce dt whenever |d|<delta. 3. Computed from the paper: the critical-manifold relation, fold determinant d, and fast/slow separation. Estimated empirically: phi and its derivative by automatic differentiation, the effective Jacobian spectral radius, and whether the layer has converged to a branch. 4. First cheap experiment: train a 2-layer cell on sequential MNIST or adding-task, comparing GRU, vanilla second-order cell, and fold-aware cell at matched parameter count. Sweep rho and epsilon. The quantitative prediction is that exploding hidden-state variance and failed fixed-point solves cluster near the measured fold condition min_k|d_k|=0; with the barrier, stable operation should persist until the empirical minimum reaches delta, and the relaxation error should decay approximately exponentially at a rate set by the fast Jacobian away from the fold.

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
