{
 "artifacts": [
  {
   "name": "bench_report.json",
   "url": "https://synthcore.org/code/1064/bench_report.json"
  },
  {
   "name": "bench_stage2.py",
   "url": "https://synthcore.org/code/1064/bench_stage2.py"
  },
  {
   "name": "lyapunov_controller.py",
   "url": "https://synthcore.org/code/1064/lyapunov_controller.py"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1064/report.md"
  },
  {
   "name": "report_bench_2026-09-01T234057.md",
   "url": "https://synthcore.org/code/1064/report_bench_2026-09-01T234057.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1064/results.json"
  }
 ],
 "category": "dynamics",
 "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.",
 "download_zip": "https://synthcore.org/download/1064",
 "formulas_latex": [
  "$$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\u003c\\left(\\frac{|\\lambda|}{C}\\right)^{1/p}.$$"
 ],
 "id": 2810,
 "implementation": "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\u003e0$, 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.",
 "math_summary": "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\u003c( |\\lambda|/C)^{1/p}$.",
 "math_tags": [
  "dynamical-systems",
  "stochastic-processes",
  "numerical-analysis",
  "linear-algebra"
 ],
 "ml_areas": [
  "ssm",
  "rnn",
  "world-model",
  "diffusion-sampling"
 ],
 "paper": {
  "arxiv_id": "2608.29149",
  "arxiv_url": "https://arxiv.org/abs/2608.29149",
  "summary_what_math_gives_to_ml": "The paper provides a transferable numerical-dynamics mechanism: a discretization of a stochastic continuous-time system can preserve both its random attractor and the sign of the almost-sure Lyapunov exponent of a distinguished invariant solution. This is stronger than ordinary numerical convergence because it preserves qualitative stability classification, not merely finite-time trajectories. The most promising neural-network use is a structure-aware discretization and stability monitor for stochastic neural ODEs, recurrent state-space models, or diffusion-like latent dynamics, with the step size restricted until the discrete Lyapunov classification agrees with the continuous-time estimate.",
  "title": "Random attractors and almost-sure stability under discretization of a stochastic autoparametric system",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 5,
  "novelty": 7,
  "usefulness": 8
 },
 "solves": [
  "stability",
  "accuracy"
 ],
 "title": "Lyapunov-sign-preserving neural time stepping",
 "url": "https://synthcore.org/idea/2810/lyapunov-sign-preserving-neural-time-stepping",
 "verification": {
  "benchmark": {
   "track": "dynamics",
   "model": "rnn_small",
   "n_seeds": 8,
   "metric_direction": "lower is better",
   "comparison": {
    "baseline_mean": 0.002105819425196387,
    "idea_mean": 0.09830853797029704,
    "delta_mean": 0.09620271854510065,
    "per_seed_diffs": [
     0.010664481902495027,
     0.016849139123223722,
     0.3257576616015285,
     0.032322008861228824,
     0.17319187824614346,
     0.023258724249899387,
     0.06720193568617105,
     0.12037591869011521
    ],
    "idea_wins": 0,
    "n_pairs": 8,
    "p_value": 0.0081,
    "mde": 0.09108405536558592,
    "mde_rel_pct": 4325.3497558125855,
    "verdict": "idea worse (significant)",
    "system_worked": false
   },
   "baseline": {
    "best_cfg": {
     "lr": 0.006
    },
    "sweep": [
     {
      "cfg": {
       "lr": 0.001
      },
      "mean": 0.004298779065720737
     },
     {
      "cfg": {
       "lr": 0.003
      },
      "mean": 0.0034615940821822733
     },
     {
      "cfg": {
       "lr": 0.006
      },
      "mean": 0.0018282315868418664
     }
    ],
    "full": {
     "mean": 0.002105819425196387,
     "std": 0.000389436566226016,
     "per_seed": [
      0.002004395006224513,
      0.001437882543541491,
      0.0015748648438602686,
      0.002295783953741193,
      0.0024020641576498747,
      0.0024898042902350426,
      0.0020851334556937218,
      0.0025566271506249905
     ],
     "n": 8
    }
   },
   "idea": {
    "mean": 0.09830853797029704,
    "std": 0.10181642123035443,
    "per_seed": [
     0.01266887690871954,
     0.018287021666765213,
     0.3273325264453888,
     0.034617792814970016,
     0.17559394240379333,
     0.02574852854013443,
     0.06928706914186478,
     0.1229325458407402
    ],
    "n": 8
   },
   "mechanism_signature": {
    "idea_sweep": [
     {
      "cfg": {
       "lr": 0.001
      },
      "mean": 0.731351688504219
     },
     {
      "cfg": {
       "lr": 0.003
      },
      "mean": 0.5189185738563538
     },
     {
      "cfg": {
       "lr": 0.006
      },
      "mean": 0.09822655445896089
     }
    ],
    "mechanism_signature": {
     "baseline_discrete_exponent": -0.49392220080763893,
     "confirmed": true,
     "controlled_discrete_exponent": -0.24955386218263162,
     "observed_sign_preserved": true,
     "predicted_sign_preserved": true,
     "trained_baseline_mse": 0.002604018896818161,
     "trained_idea_mse": 0.38107627630233765
    },
    "protocol": "8 paired seeds; baseline and idea share lr union; standard test MSE.",
    "track_justification": "Controlled pendulum rollout is the built-in stability/control/Lyapunov match."
   },
   "custom_track": null
  },
  "mechanism_confirmed": false,
  "peer_reviewed": false,
  "practical_verdict": "harms",
  "stage1_mechanism_check": {
   "worked": true,
   "confidence": 9,
   "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.",
   "metrics": {
    "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."
   },
   "how_to_run": "python3 lyapunov_controller.py",
   "files": [
    "lyapunov_controller.py",
    "results.json",
    "run_output.txt"
   ],
   "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."
  },
  "status": "failed_benchmark",
  "status_label": "Failed on benchmark",
  "updated_at": "2026-09-01T23:40:57",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)"
 }
}
