# Lyapunov-sign-preserving neural time stepping

- ID: 2810
- Canonical URL: https://synthcore.org/idea/2810/lyapunov-sign-preserving-neural-time-stepping
- API JSON: https://synthcore.org/api/idea/2810.json
- API Markdown: https://synthcore.org/api/idea/2810.md
- Verification status: failed_benchmark
- Source: [arXiv:2608.29149](https://arxiv.org/abs/2608.29149)
- Category: dynamics
- Solves: stability, accuracy
- ML areas: ssm, rnn, world-model, diffusion-sampling
- Math tags: dynamical-systems, stochastic-processes, numerical-analysis, linear-algebra
- Ratings: usefulness 8/10; difficulty 5/10; novelty 7/10

## 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.

## 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}$.

## Key formulas

- $$dz_t=f_\theta(z_t,t)\,dt+G_\theta(z_t,t)\,dW_t,$$
- $$\lambda=\limsup_{T\to\infty}\frac{1}{T}\log\left\|D\varphi(T,\omega,z_0^\star)\right\|,\qquad \lambda_h=\limsup_{N\to\infty}\frac{1}{Nh}\log\left\|D\Phi_h^N(\omega,z_0^\star)\right\|,$$
- $$\widehat\lambda_h=\frac{1}{Nh}\sum_{k=0}^{N-1}\log\left\|J_kq_k\right\|,\qquad q_{k+1}=\frac{J_kq_k}{\|J_kq_k\|},$$
- $$|\lambda_h-\lambda|\le Ch^p\quad\Longrightarrow\quad \operatorname{sign}(\lambda_h)=\operatorname{sign}(\lambda)\ \text{if}\ h<\left(\frac{|\lambda|}{C}\right)^{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

- Status: failed_benchmark
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: harms
- Verdict: 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.

### Mechanism check

- Verdict: 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.
- Confidence: 9/10
- 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.

### 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_report.json](https://synthcore.org/code/1064/bench_report.json)
- [bench_stage2.py](https://synthcore.org/code/1064/bench_stage2.py)
- [lyapunov_controller.py](https://synthcore.org/code/1064/lyapunov_controller.py)
- [report.md](https://synthcore.org/code/1064/report.md)
- [report_bench_2026-09-01T234057.md](https://synthcore.org/code/1064/report_bench_2026-09-01T234057.md)
- [results.json](https://synthcore.org/code/1064/results.json)
- [Download all files as ZIP](https://synthcore.org/download/1064)

## Disclaimer

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