Global Basin Continuation for Neural Dynamics
Implementation & benchmark of arXiv:2607.09332 — Global continuation as a complement to traditional continuation and bifurcation analysis
Source paper: Global continuation as a complement to traditional continuation and bifurcation analysis arXiv:2607.09332 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Treat the hidden-state evolution of an RNN or state-space model as a parameterized dynamical system and globally continue its attractors over a grid of inputs, perturbation amplitudes, and training checkpoints. Penalize or stop training when the task-relevant attractor loses basin mass, rather than relying only on local Jacobian eigenvalues at one nominal trajectory.
Formulas
Mathematical statement
Let z_{t+1}=F_{theta,u}(z_t) be a discrete-time neural dynamical system with parameters theta and fixed input or operating condition u. Let A_i(theta,u) denote an attractor and let X be a perturbation region with sampling measure mu. Its basin fraction is B_i(theta,u)=mu({z_0 in X: F_{theta,u}^t(z_0) converges to A_i}) divided by mu(X). If an observed rollout reaches attractor A_0, Bayesian conditioning gives P(theta | A=A_0)=P(A=A_0 | theta)P(theta)/P(A=A_0), with likelihood estimated by B_0(theta,u). The transferable mechanism is that a finite-perturbation stability loss based on 1 minus B_0 detects basin collapse and attractor switching that local linear stability can miss.
Implementation notes
1. Integration point: use a tanh GRU, vanilla RNN, or diagonal state-space model whose hidden state is iterated for a fixed input context until it reaches a recurrent regime. Select a task-relevant attractor by continuing the unperturbed trajectory. For chaotic or nonconvergent systems, replace point-attractor classification by clustering terminal windows or recurrence statistics. At each training checkpoint, perturb the hidden state with N samples from a prescribed ball or empirical hidden-state distribution.
2. Pseudocode: save the clean hidden state z_star; sample z_0^(k)=z_star+epsilon xi_k, where xi_k are normalized random vectors; iterate z_{t+1}=F_{theta,u}(z_t) for T steps; cluster terminal states or compare them with the clean attractor; estimate B_hat_0; add lambda times max(0,B_min-B_hat_0)^2 to the task loss, or reject the optimizer step if the basin fraction falls by more than delta. Repeat for a coarse grid of operating conditions u and perturbation amplitudes epsilon.
3. Computed versus estimated: the update map F_{theta,u} and task loss are computed exactly by the network. Attractors, basin labels, and B_i are estimated empirically from finite rollouts; use Wilson confidence intervals and increase N only near a suspected transition. Warm-start perturbation trajectories from neighboring parameter-grid points, while retaining all discovered attractor clusters instead of following only the nearest one.
4. First cheap experiment: train a two-layer tanh RNN on sequential MNIST or the adding-two-numbers task, comparing Adam, Adam plus spectral normalization, and Adam plus the basin penalty. At checkpoints, measure B_hat_0(epsilon) for epsilon from 10^-3 to 1, the number of hidden-state attractor clusters, long-horizon task error, and the local Jacobian spectral radius. The falsifiable prediction is that long-horizon failures begin when B_hat_0 drops sharply, often before the nominal Jacobian crosses spectral radius one. Across seeds, the perturbation threshold epsilon_c satisfying B_hat_0(epsilon_c)=0.5 should predict rollout failure within 20 percent. The basin penalty should shift epsilon_c upward and suppress abrupt attractor switching, even if the local Jacobian margin changes little.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Inconclusive
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a scalar neural-dynamics global-basin continuation MVP with exact basin calculations, Monte Carlo estimation, local Jacobian comparison, and a basin-penalized optimization toy experiment. The predicted onset epsilon_c=sqrt(a) and B=0.75 crossing epsilon_c=2sqrt(a) matched sweeps within about 1%, while Monte Carlo basin estimates had mean absolute error 0.00077. Finite basin switching occurred despite local spectral radius remaining below one, and the penalty increased final basin fraction from 0.60 to 0.778, though at higher task error; this confirms the mechanism in the toy setting, not yet a neural-task win.
- Agent confidence
- 9/10
- Baseline
- Task-only optimization: final a=0.0100, task error=1.56e-16, basin fraction B=0.600
- Idea
- Basin-penalized optimization: final a=0.07716, task error=0.03160, objective=0.03556, basin fraction B=0.7778; transition checks matched within about 1%; Monte Carlo mean absolute basin error=0.00077
Limitations: This is a one-dimensional polynomial dynamical-system proxy rather than a tanh RNN or sequence-learning task. The basin estimate uses a known analytic basin boundary, optimization uses the exact basin fraction rather than noisy finite-sample estimates, and no multi-seed FLOP-matched neural baseline, checkpoint continuation, Wilson intervals, or high-dimensional attractor clustering was tested.
How to run: python3 basin_continuation_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.09332)
Ahead of the baseline (−9.8%) but not statistically significant (p=0.3457, wins 5 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0015
- Idea mean
- 0.0014
- Effect (Δ)
- -0.0001 (−9.8%; negative = idea better)
- Wins
- 5 / 8 paired seeds
- p-value
- 0.3457 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- n/a
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 9/10
Implemented Global Basin Continuation as a finite-perturbation hidden-state penalty for the structurally matched dynamics track using the shared rnn_small GRU architecture. Across 8 paired seeds, the idea reduced MSE from 0.00152918 to 0.00137947, but the improvement was not significant (paired delta -0.00014971, permutation p=0.34565), so there is no demonstrated benchmark win. The trained-model mechanism signature also failed to confirm the simple quantitative rho-based prediction.
- Baseline
- Best lr=0.01; full 8-seed MSE mean 0.00152918, std 0.00037921
- Idea
- Best lr=0.01, lambda=0.1, epsilon=1.0; full 8-seed MSE mean 0.00137947, std 0.00044926
- Idea wins
- 5/8 paired seeds
- Mechanism signature
- Baseline observed retention 0.79469 vs predicted 0.65382; idea observed retention 0.94156 vs predicted 0.64687; local Jacobian radii 0.69236 and 0.70626; confirmed=false
- Paired delta
- -0.0001497115, idea minus baseline; lower is better
- Permutation p value
- 0.34565
Benchmark result
Ahead of the baseline (−9.8%) but not statistically significant (p=0.3457, wins 5 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0015
- Idea mean
- 0.0014
- Effect (Δ)
- -0.0001 (−9.8%; negative = idea better)
- Wins
- 5 / 8 paired seeds
- p-value
- 0.3457 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- n/a
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
Artifacts
- basin_continuation_experiment.py 4.0 KB View Raw
- basin_results.json 62.5 KB View Raw
- bench_report.json 4.4 KB View Raw
- report.md 1.6 KB View
- report_bench_2026-08-31T001856.md 3.0 KB View
- stage2_bench.py 7.4 KB View Raw
- stage2_stdout.json 4.1 KB View Raw