{
 "artifacts": [
  {
   "name": "README.md",
   "url": "https://synthcore.org/code/1063/README.md"
  },
  {
   "name": "basin_guard_experiment.py",
   "url": "https://synthcore.org/code/1063/basin_guard_experiment.py"
  },
  {
   "name": "bench_experiment.py",
   "url": "https://synthcore.org/code/1063/bench_experiment.py"
  },
  {
   "name": "bench_report.json",
   "url": "https://synthcore.org/code/1063/bench_report.json"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1063/report.md"
  },
  {
   "name": "report_bench_2026-09-01T233508.md",
   "url": "https://synthcore.org/code/1063/report_bench_2026-09-01T233508.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1063/results.json"
  }
 ],
 "category": "dynamics",
 "description": "Use the paper's below-threshold bistability mechanism to distinguish local stability from actual recovery: a recurrent network may have a locally stable nominal state while a second stable state still captures trajectories. Add a perturbation-based basin test and retain stronger damping or reset actions until the network demonstrably returns to the desired branch, rather than disabling intervention immediately when the spectral threshold is restored.",
 "download_zip": "https://synthcore.org/download/1063",
 "formulas_latex": [
  "$$\\dot x=F(x;u),\\qquad F(x_0;u)=0,\\qquad \\alpha(J_0)=\\max_i\\operatorname{Re}\\lambda_i\\bigl(D_xF(x_0;u)\\bigr)\u003c0.$$",
  "$$F(x_s;u_s)=0,\\qquad \\det D_xF(x_s;u_s)=0.$$",
  "$$\\widehat B(u)=\\frac{1}{M}\\sum_{m=1}^{M}{\\bf 1}\\left[\\|\\Phi_T(x_0+\\varepsilon z_m;u)-x_0\\|\u003c\\delta\\right],\\qquad z_m\\sim\\mathcal N(0,I).$$",
  "$$\\text{release damping only if }\\alpha(J_0)\\le-\\gamma\\ \\text{and}\\ \\widehat B(u)\\ge1-\\epsilon;\\quad\\text{otherwise retain damping or reset}. $$"
 ],
 "id": 2771,
 "implementation": "1. Integration point: apply the guard to tanh or gated RNNs, continuous-time RNNs, neural ODEs, and state-space models during inference or truncated-BPTT training. Define the desired hidden-state branch using the zero-input state, a running teacher-forced state, or a learned reference state. Add controllable damping c to the hidden update, for example h_{t+1}=(1-c)h_t+c f_phi(h_t,u_t), and estimate the local Jacobian spectral radius around the reference trajectory. 2. Pseudocode: compute Jv power iterations and estimate alpha or rho; if the spectral margin is unsafe, increase c or apply a contraction penalty. If the margin becomes safe, draw M perturbations h_ref+epsilon z_m, run each for T steps with the current input held fixed, and calculate B_hat as the fraction returning within delta of h_ref. Keep damping whenever B_hat\u003c1-epsilon; release it only after K consecutive safe checks. 3. The paper supplies the distinction between threshold restoration and basin recovery, plus the saddle-node condition; alpha, B_hat, and the appropriate perturbation scale are estimated from the model. 4. First cheap experiment: use a 2-layer tanh RNN on the adding problem and sequential MNIST, deliberately initialize recurrent gain near a regime with multiple fixed points. Compare ordinary spectral normalization, threshold-only damping, and the hysteresis guard. Sweep gain and perturbation amplitude, measuring fixed-point multiplicity, recovery probability, long-horizon error, and whether trajectories remain trapped after gain restoration. The predicted signature is a hysteresis loop: the gain at which the high-error state appears should exceed the gain at which it disappears, and threshold-only control should show recovery failure below the local instability boundary. The guard should reduce post-restoration failure probability by at least 50% without reducing stable-regime throughput by more than 10%.",
 "math_summary": "Let the frozen neural state dynamics be \\(\\dot x=F(x;u)\\), where \\(x\\) is the hidden state and \\(u\\) is an input or control parameter. The nominal equilibrium \\(x_0(u)\\) is locally stable when the Jacobian \\(J_0=D_xF(x_0;u)\\) has spectral abscissa \\(\\alpha(J_0)=\\max_i\\operatorname{Re}\\lambda_i(J_0)\u003c0\\); for a discrete-time map the analogous condition is \\(\\rho(J_0)\u003c1\\). Bistability occurs when a second stable equilibrium and an intermediate saddle coexist below this local threshold. A saddle-node boundary satisfies \\(F(x_s;u_s)=0\\) and \\(\\det D_xF(x_s;u_s)=0\\), with one eigenvalue passing through zero. Thus restoring \\(\\alpha(J_0)\u003c0\\) does not guarantee return to \\(x_0\\); a finite perturbation test estimates whether states lie in the desired basin. Damping is released only after both local stability and basin recovery are observed.",
 "math_tags": [
  "dynamical-systems",
  "bifurcations",
  "control-theory",
  "spectral-theory",
  "linear-algebra"
 ],
 "ml_areas": [
  "rnn",
  "ssm",
  "training-dynamics",
  "regularization"
 ],
 "paper": {
  "arxiv_id": "2608.27742",
  "arxiv_url": "https://arxiv.org/abs/2608.27742",
  "summary_what_math_gives_to_ml": "The paper provides a transferable mechanism of delayed threshold crossing combined with bistability: an effective control parameter relaxes toward a target with finite rate, while the state can remain trapped in a competing attractor even after the parameter returns below the local instability threshold. For neural networks, this suggests separating commanded optimizer or recurrent-network parameters from their actually applied values, predicting implementation lag analytically, and triggering interventions before the effective system crosses a dangerous spectral boundary. A second transfer is hysteresis-aware stability control for recurrent or state-space networks: monitoring only the local threshold is insufficient, so training should also probe basin membership and apply stronger damping until the trajectory has demonstrably returned to the desired attractor.",
  "title": "Below-threshold Bistability and Implementation Lag in a Simplex Model of Radical Vote-Share Dynamics",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 6,
  "novelty": 6,
  "usefulness": 8
 },
 "solves": [
  "stability",
  "accuracy"
 ],
 "title": "Basin-Aware Hysteresis Guard",
 "url": "https://synthcore.org/idea/2771/basin-aware-hysteresis-guard",
 "verification": {
  "benchmark": {
   "track": "dynamics",
   "model": "rnn_small",
   "n_seeds": 8,
   "metric_direction": "lower is better",
   "comparison": {
    "baseline_mean": 0.002359520163736306,
    "idea_mean": 0.0013422396659734659,
    "delta_mean": -0.0010172804977628402,
    "per_seed_diffs": [
     0.0006133246934041381,
     -0.0011104597942903638,
     -0.0012215339811518788,
     -0.0016328775091096759,
     -0.0021693070884793997,
     -0.0007502610678784549,
     -0.001244278042577207,
     -0.0006228511920198798
    ],
    "idea_wins": 7,
    "n_pairs": 8,
    "p_value": 0.01485,
    "mde": 0.0006846987059140442,
    "mde_rel_pct": 29.018557096364123,
    "verdict": "idea better (significant)",
    "system_worked": true
   },
   "baseline": {
    "best_cfg": {
     "damping": 1,
     "epochs": 15,
     "lr": 0.01
    },
    "sweep": [
     {
      "cfg": {
       "damping": 1,
       "epochs": 15,
       "lr": 0.001
      },
      "mean": 0.016809451510198414
     },
     {
      "cfg": {
       "damping": 1,
       "epochs": 15,
       "lr": 0.003
      },
      "mean": 0.005665019620209932
     },
     {
      "cfg": {
       "damping": 1,
       "epochs": 15,
       "lr": 0.01
      },
      "mean": 0.0022826905187685043
     }
    ],
    "full": {
     "mean": 0.002359520163736306,
     "std": 0.0007644030858149881,
     "per_seed": [
      0.001249853172339499,
      0.002188401995226741,
      0.002345386426895857,
      0.0033471204806119204,
      0.0033662922214716673,
      0.0015826028538867831,
      0.0030378259252756834,
      0.0017586782341822982
     ],
     "n": 8
    }
   },
   "idea": {
    "mean": 0.0013422396659734659,
    "std": 0.0003630924813985613,
    "per_seed": [
     0.001863177865743637,
     0.001077942200936377,
     0.001123852445743978,
     0.0017142429715022445,
     0.0011969851329922676,
     0.0008323417860083282,
     0.0017935478826984763,
     0.0011358270421624184
    ],
    "n": 8
   },
   "mechanism_signature": {
    "confirmed": false,
    "note": "Measured on trained baseline and idea systems; all tested perturbation recovery rates were 0.0 and recurrent norm was not consistently reduced.",
    "observed_recovery_delta": 0,
    "prediction": "guard should increase perturbation recovery and reduce local recurrent gain"
   },
   "custom_track": null
  },
  "mechanism_confirmed": false,
  "peer_reviewed": false,
  "practical_verdict": "helps",
  "stage1_mechanism_check": {
   "worked": true,
   "confidence": 9,
   "verdict": "Built and numerically verified a basin-aware hysteresis toy model using the tilted double-well flow dx/dt=x-x^3+u. The three mechanism predictions were confirmed: the saddle-node was observed at 0.384900 versus 0.384900 predicted, local stability coexisted with multiple equilibria, and empirical basin recovery closely followed Phi(1/epsilon). The controller comparison was not a practical win: threshold-only failure was 0.1433 versus 0.2000 for the guard, showing that scalar damping changes time scale but not basin membership.",
   "metrics": {
    "baseline": "Threshold-only release: failure_rate=0.1433, release_rate=1.0",
    "idea": "Basin guard: failure_rate=0.2000, release_rate=0.0; mechanism sweep B_hat versus predicted Phi(1/epsilon): [1.0000 vs 1.0000, 1.0000 vs 0.9996, 0.9788 vs 0.9772, 0.9215 vs 0.9234, 0.8675 vs 0.8667, 0.8308 vs 0.8183]"
   },
   "how_to_run": "python3 basin_guard_experiment.py",
   "files": [
    "basin_guard_experiment.py",
    "results.json",
    "README.md"
   ],
   "limitations": "No tanh RNN, adding-task, sequential-MNIST, GPU, training, or throughput experiment was run. The intervention was tested only on a one-dimensional continuous-time normal form, and its damping cannot alter the asymptotic basin boundary."
  },
  "status": "beats_baseline",
  "status_label": "Beats tuned baseline",
  "updated_at": "2026-09-01T23:35:08",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)"
 }
}
