# Bifurcation-Certified Piecewise-Linear Recurrent Cell

- ID: 865
- Canonical URL: https://synthcore.org/idea/865/bifurcation-certified-piecewise-linear-recurrent-cell
- API JSON: https://synthcore.org/api/idea/865.json
- API Markdown: https://synthcore.org/api/idea/865.md
- Verification status: failed_benchmark
- Source: [arXiv:2607.13519](https://arxiv.org/abs/2607.13519)
- Category: dynamics
- Solves: stability, accuracy, scalability
- ML areas: rnn, ssm, training-dynamics, regularization
- Math tags: dynamical-systems, bifurcations, control-theory, linear-algebra
- Ratings: usefulness 8/10; difficulty 5/10; novelty 6/10

## Idea description

Replace a standard recurrent update with a two-state absolute-value cell whose local dynamics are exactly piecewise affine. Train the coupling parameters while enforcing discrete-time Schur inequalities inside each activation quadrant, preventing exploding recurrent trajectories while retaining nonsmooth gating and richer dynamics than a globally contractive linear cell.

## Mathematical statement

The recurrent state is \(z_t=(x_t,y_t)^\top\), and the autonomous core is \(T(x,y)=(|x|+ay-1,\ x+c|y|-1)\). In a quadrant with \(s_x=\operatorname{sign}(x)\in\{-1,+1\}\) and \(s_y=\operatorname{sign}(y)\in\{-1,+1\}\), the Jacobian is \(J_{s_x,s_y}=\begin{bmatrix}s_x&a\\1&cs_y\end{bmatrix}\). Its trace and determinant are \(\tau=s_x+cs_y\) and \(\delta=s_xcs_y-a\). Both eigenvalues lie strictly inside the unit disk if and only if the Jury conditions \(1-\tau+\delta>0\), \(1+\tau+\delta>0\), and \(1-\delta>0\) hold. The Flip bifurcation surface, where an eigenvalue reaches \(-1\), is \(1+\tau+\delta=0\). A Border Collision occurs when a fixed point reaches \(x=0\) or \(y=0\), changing the active Jacobian.

## Key formulas

- $$z_{t+1}=T(z_t,u_t)=\begin{bmatrix}|x_t|+a y_t-1\\x_t+c|y_t|-1\end{bmatrix}+B u_t,$$
- $$J_{s_x,s_y}=\begin{bmatrix}s_x&a\\1&cs_y\end{bmatrix},\qquad \tau=s_x+cs_y,\qquad \delta=s_xcs_y-a,$$
- $$1-\tau+\delta>0,\qquad 1+\tau+\delta>0,\qquad 1-\delta>0,$$
- $$\text{Flip boundary: }1+\tau+\delta=0\iff (1+s_x)(1+cs_y)-a=0.$$

## Implementation notes

1. Integration point: use this cell as the recurrent transition in a small RNN or state-space model, with \(z_t\in\mathbb{R}^{2d}\) represented as \(d\) independent two-dimensional cells. Add input injection \(Bu_t\) and an output projection \(h_t=W_o z_t\). Generalize the fixed offset \(-1\) to a learned bias, but keep the absolute values and shared couplings \(a,c\) initially. 2. Pseudocode: for each batch and channel, compute `sx=sign(x.detach())`, `sy=sign(y.detach())`, and `z_next=[abs(x)+a*y-1, x+c*abs(y)-1]+B*u`. Compute `tau=sx+c*sy` and `delta=sx*c*sy-a`; add `lambda * sum(relu(eps-(1-tau+delta)) + relu(eps-(1+tau+delta)) + relu(eps-(1-delta)))` to the task loss. Optionally project \(a,c\) after each optimizer step into a precomputed safe region. 3. Computed from the paper: the exact map, quadrant Jacobians, Jury inequalities, and Flip surface. Estimated empirically: active-quadrant frequencies, spectral radius of every observed Jacobian, and distance from the borders \(x=0\) and \(y=0\). Use a smooth absolute value only if gradients at zero are problematic, but evaluate stability with the exact nonsmooth map. 4. First cheap experiment: compare this cell against tanh-RNN and vanilla linear RNN on sequential MNIST and copy-memory sequences with equal hidden-state dimension. Sweep \(a\) across the predicted Flip threshold while fixing \(c\) and each quadrant sign, and measure hidden-state norm and Jacobian spectral radius. The quantitative prediction is that divergence or sustained period-2 oscillation begins near \(1+\tau+\delta=0\), with the measured threshold within 10--20% of the analytic value; parameters satisfying all three Jury inequalities should show geometric perturbation decay away from borders.

## Verification

- Status: failed_benchmark
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: harms
- Verdict: Built the certified piecewise-linear recurrent cell with quadrant Jacobians, Jury penalty, CPU/CUDA fallback, mathematical sweeps, and a fixed-seed toy sequence task. The mechanism manifested: Jury classification had 0/20,000 mismatches, the predicted stable interval for the (--), c=0.5 quadrant was observed as a=-0.45 through -0.05, and spectral-radius crossings occurred at the predicted boundaries a=-0.5 and a=0. Stable cases decayed while unstable cases grew strongly; the certified model also outperformed the tanh-RNN on this toy task, although this secondary result is not evidence of general superiority.

### Mechanism check

- Verdict: Built the certified piecewise-linear recurrent cell with quadrant Jacobians, Jury penalty, CPU/CUDA fallback, mathematical sweeps, and a fixed-seed toy sequence task. The mechanism manifested: Jury classification had 0/20,000 mismatches, the predicted stable interval for the (--), c=0.5 quadrant was observed as a=-0.45 through -0.05, and spectral-radius crossings occurred at the predicted boundaries a=-0.5 and a=0. Stable cases decayed while unstable cases grew strongly; the certified model also outperformed the tanh-RNN on this toy task, although this secondary result is not evidence of general superiority.
- Confidence: 9/10
- Limitations: Only a small synthetic majority-bit sequence task was tested, not sequential MNIST or copy-memory. The perturbation sweep analyzes fixed active quadrants; full nonlinear border-collision statistics, FLOPs/speed, long-horizon robustness, and larger-scale generalization were not tested.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0081
- Paired wins: 0/8
- Benchmark verdict: idea worse (significant)

## Artifacts

- [bench_experiment.py](https://synthcore.org/code/161/bench_experiment.py)
- [bench_report.json](https://synthcore.org/code/161/bench_report.json)
- [bench_stdout.json](https://synthcore.org/code/161/bench_stdout.json)
- [experiment.py](https://synthcore.org/code/161/experiment.py)
- [report.md](https://synthcore.org/code/161/report.md)
- [report_bench_2026-08-30T182759.md](https://synthcore.org/code/161/report_bench_2026-08-30T182759.md)
- [results.json](https://synthcore.org/code/161/results.json)
- [Download all files as ZIP](https://synthcore.org/download/161)

## Disclaimer

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