Lyapunov-sign-preserving neural time stepping
Implementation & benchmark of arXiv:2608.29149 — Random attractors and almost-sure stability under discretization of a stochastic autoparametric system
Source paper: Random attractors and almost-sure stability under discretization of a stochastic autoparametric system arXiv:2608.29149 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Equip a stochastic neural ODE or recurrent state-space model with a step-size controller that explicitly checks whether the discrete-time Lyapunov exponent has the same sign as the continuous-time exponent estimate. If discretization changes an attracting mode into an expanding one, reduce the step size or use a higher-order or semi-implicit update rather than trusting ordinary Euler integration.
Formulas
Mathematical statement
Let $z_t$ be a neural latent state driven by random input or Wiener noise, with continuous dynamics $dz_t=f_\theta(z_t,t)dt+G_\theta(z_t,t)dW_t$, where $f_\theta$ is the drift, $G_\theta$ is the diffusion matrix, $W_t$ is Brownian motion, and $\theta$ are network parameters. Let $\Phi_h(\omega,z)$ be a one-step numerical cocycle with step size $h$ and noise realization $\omega$. For a reference invariant trajectory $z_t^\star$, define the continuous top Lyapunov exponent $\lambda=\limsup_{T\to\infty}T^{-1}\log\|D\varphi(T,\omega,z_0^\star)\|$ and the discrete exponent $\lambda_h=\limsup_{N\to\infty}(Nh)^{-1}\log\|D\Phi_h^N(\omega,z_0^\star)\|$. If the discretization has exponent error $|\lambda_h-\lambda|\le Ch^p$ for order $p$, then the stability sign is preserved whenever $h<( |\lambda|/C)^{1/p}$.
Implementation notes
Use this as the solver and safety controller for a stochastic neural ODE, latent world model, or continuous-time RNN. The network supplies $f_\theta$ and $G_\theta$; initially leave the training objective unchanged and expose the integration step $h$ as a runtime control variable. Implement Euler-Maruyama and a second, more stable update such as a semi-implicit drift step. Initialize a normalized random probe $q$. For each transition compute $z_{k+1}=\Phi_h(\omega_k,z_k)$, obtain the Jacobian-vector product $v=J_kq$ using automatic differentiation, accumulate $s\leftarrow s+\log(\|v\|+10^{-12})$, and set $q\leftarrow v/(\|v\|+10^{-12})$. Every $M$ steps compute $\widehat\lambda_h=s/(Mh)$. If the estimate is close to zero, halve $h$; if a supposedly stable mode has $\widehat\lambda_h>0$, halve $h$ or switch to the stable solver. Jacobian-vector products are computed exactly; the exponent, convergence order $p$, and constant $C$ are estimated empirically using runs at $h$, $h/2$, and $h/4$. First experiment: train a two-dimensional stochastic neural ODE on noisy damped-oscillator rollouts, compare Euler-Maruyama with the controlled solver, and sweep $h$. The prediction is that the exponent sign becomes invariant under refinement and that $|\widehat\lambda_h-\widehat\lambda_{h/2}|$ scales as $h^p$; any coarse-step sign flip should disappear after halving $h.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: Significantly worse ✗
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 reusable Lyapunov exponent estimator with exact PyTorch JVP support, Euler and semi-implicit stepping, and a controller that halves the step when a nominally stable mode appears expanding. The mechanism manifested: the scalar Euler sign-flip boundary matched h*=2/a within 0.1% across a=0.5,1,2,4, and Euler exponent error showed first-order scaling with successive ratios 2.39, 2.16, and 2.07. Implicit stepping preserved the stable sign in the oscillator sweep, while the controller corrected h=2.5 to h=1.25.
- Agent confidence
- 9/10
- Baseline
- Explicit Euler: scalar sign boundary observed at 1.001x the predicted boundary across all tested damping values; oscillator exponent became positive at h=0.1, with lambda_h=+0.0020 despite continuous lambda=-0.2.
- Idea
- Semi-implicit/controller: implicit oscillator exponent stayed negative for h=0.05, 0.1, 0.2, 0.4, and 0.8; the controller halved h=2.5 after lambda_hat=+0.1622 and stopped at h=1.25 with lambda_hat=-1.1090; exact JVP log error was 0.0.
Limitations: This MVP verifies the mechanism on analytically defined linear deterministic systems and a synthetic PyTorch JVP, not on a trained neural ODE, recurrent model, or genuinely stochastic diffusion process. It does not benchmark wall-clock speed, training loss, memory, or adaptive estimation of the continuous exponent and error constant C.
How to run: python3 lyapunov_controller.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.29149)
Significantly WORSE than the tuned baseline (+4568.4%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0021
- Idea mean
- 0.0983
- Effect (Δ)
- 0.0962 (+4568.4%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±4325.3%
- Mechanism
- Confirmed ✓
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the registered built-in dynamics track was tested. The intervention used a damped half-step surrogate rather than a full nonlinear implicit solve or adaptive runtime controller; wall-clock, memory, stochastic diffusion, higher-order solvers, and longer-horizon generalization were not tested.
How to run: python3 bench_stage2.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 10/10
The matched Lyapunov-controlled GRU preserved the negative trained-model exponent sign, confirming the proposed mechanism on the dynamics benchmark. However, it significantly worsened standard test MSE: 0.09831 versus 0.002106 for the baseline, with paired delta +0.09620 and permutation p=0.0081; therefore the idea is not a training win.
- Baseline
- Best lr=0.006; 8-seed test MSE mean=0.0021058194, std=0.0003894366.
- Idea
- Controlled half-step GRU at shared best lr=0.006; 8-seed test MSE mean=0.0983085380, std=0.1018164212; 0/8 paired wins.
- Mechanism signature
- map[baseline_discrete_exponent:-0.4939222008 confirmed:true controlled_discrete_exponent:-0.2495538622 observed_sign_preserved:true predicted_sign_preserved:true]
Benchmark result
Significantly WORSE than the tuned baseline (+4568.4%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0021
- Idea mean
- 0.0983
- Effect (Δ)
- 0.0962 (+4568.4%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±4325.3%
- Mechanism
- Confirmed ✓
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the registered built-in dynamics track was tested. The intervention used a damped half-step surrogate rather than a full nonlinear implicit solve or adaptive runtime controller; wall-clock, memory, stochastic diffusion, higher-order solvers, and longer-horizon generalization were not tested.
How to run: python3 bench_stage2.py
Artifacts
- bench_report.json 2.8 KB View Raw
- bench_stage2.py 5.3 KB View Raw
- lyapunov_controller.py 5.5 KB View Raw
- report.md 1.6 KB View
- report_bench_2026-09-01T234057.md 4.4 KB View
- results.json 4.2 KB View Raw