{
 "artifacts": [
  {
   "name": "bench_phase_margin.py",
   "url": "https://synthcore.org/code/1211/bench_phase_margin.py"
  },
  {
   "name": "bench_report.json",
   "url": "https://synthcore.org/code/1211/bench_report.json"
  },
  {
   "name": "experiment.py",
   "url": "https://synthcore.org/code/1211/experiment.py"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1211/report.md"
  },
  {
   "name": "report_bench_2026-09-03T115720.md",
   "url": "https://synthcore.org/code/1211/report_bench_2026-09-03T115720.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1211/results.json"
  }
 ],
 "category": "dynamics",
 "description": "Build a continuous-time or discretized recurrent network whose interaction graph has trainable magnitudes and phase delays, then regularize the spectrum of the phase-corrected interaction matrix around each desired latent phase-locked state. The cosine-weighted composite matrix determines whether perturbations contract or grow, providing a computable stability margin instead of relying only on empirical exploding-gradient detection.",
 "download_zip": "https://synthcore.org/download/1211",
 "formulas_latex": [
  "$$\\dot\\theta_i=\\omega_i+K\\sum_j A_{ij}\\sin(\\theta_j-\\theta_i-\\alpha_{ij})$$",
  "$$C_{ij}=A_{ij}\\cos(\\psi_j-\\psi_i-\\alpha_{ij}),\\qquad L_C=\\operatorname{diag}(C\\mathbf 1)-C,\\qquad J=-K L_C$$",
  "$$\\operatorname{Re}\\lambda_k(L_C)\u003e0\\;(k\\ne\\mathrm{gauge}),\\qquad |1-\\eta K\\lambda_k(L_C)|\u003c1$$",
  "$$\\mathcal L_{\\mathrm{spec}}=\\operatorname{softplus}\\!\\left(\\gamma-\\min_{k\\ne\\mathrm{gauge}}\\operatorname{Re}\\lambda_k(L_C)\\right)+\\beta\\max_k\\left(|1-\\eta K\\lambda_k(L_C)|-1\\right)_+^2$$"
 ],
 "id": 3035,
 "implementation": "1. Integration point: use a phase-valued recurrent cell or neural ODE with hidden state \\(\\theta\\in\\mathbb R^n\\). Parameterize nonnegative edge magnitudes by \\(A_{ij}=\\operatorname{softplus}(a_{ij})\\), and learn delays \\(\\alpha_{ij}\\) modulo \\(2\\pi\\). Add an input-dependent frequency term \\(\\omega_i=W_i x_t+b_i\\). 2. Pseudocode: estimate a candidate locked state \\(\\psi\\) by averaging the latent phase trajectory after teacher forcing; compute \\(C_{ij}=A_{ij}\\cos(\\psi_j-\\psi_i-\\alpha_{ij})\\); form \\(L_C=\\operatorname{diag}(C\\mathbf 1)-C\\); estimate eigenvalues using a dense eigensolver for small models or Arnoldi/power iterations for sparse models; add \\(\\mathcal L_{\\mathrm{spec}}\\) to the task loss; backpropagate through the eigensolver or use a detached spectral estimate for a slower control update. At inference, choose \\(\\eta\\) below the largest value satisfying \\(\\max_k|1-\\eta K\\lambda_k|\u003c1\\). 3. Computed from the paper's mechanism: the cosine phase-delay composite matrix and its spectral stability test. Estimated empirically: the candidate locked state and basin volume. 4. First cheap experiment: train a 16-unit phase RNN on adding-machine sequences and compare a standard recurrent cell with the spectral-regularized cell at matched parameter count. Sweep \\(\\eta K\\), record hidden-state norms, gradient norms, and recovery after perturbing a locked trajectory. The quantitative prediction is a sharp instability boundary at \\(|1-\\eta K\\lambda_k|=1\\); for an approximately real spectrum, measured divergence should begin within 20% of \\(\\eta_c=2/(K\\lambda_{\\max}(L_C))\\). Increasing the minimum real eigenvalue by \\(\\gamma\\) should increase the perturbation-decay rate approximately as \\(K\\min_{k\\ne\\mathrm{gauge}}\\operatorname{Re}\\lambda_k(L_C)\\).",
 "math_summary": "For a phase network with node phases \\(\\theta_i\\), adjacency weights \\(A_{ij}\\ge 0\\), coupling strength \\(K\u003e0\\), natural frequencies \\(\\omega_i\\), and edge delay \\(\\alpha_{ij}\\), use \\(\\dot\\theta_i=\\omega_i+K\\sum_j A_{ij}\\sin(\\theta_j-\\theta_i-\\alpha_{ij})\\). A phase-locked state \\(\\theta_i^*(t)=\\Omega t+\\psi_i\\) has perturbation Jacobian \\(J=-K L_C\\), where \\(C_{ij}=A_{ij}\\cos(\\psi_j-\\psi_i-\\alpha_{ij})\\) and \\(L_C=\\operatorname{diag}(C\\mathbf 1)-C\\). The composite spectrum determines local stability: every non-gauge eigenvalue of \\(J\\) must have negative real part, equivalently \\(\\operatorname{Re}\\lambda_k(L_C)\u003e0\\). For a discrete Euler update with step size \\(\\eta\\), the local map is \\(\\delta\\theta_{t+1}=(I+\\eta J)\\delta\\theta_t\\), requiring \\(|1-\\eta K\\lambda_k(L_C)|\u003c1\\) for every mode.",
 "math_tags": [
  "dynamical-systems",
  "spectral-theory",
  "linear-algebra",
  "control-theory"
 ],
 "ml_areas": [
  "rnn",
  "ssm",
  "optimizer",
  "training-dynamics"
 ],
 "paper": {
  "arxiv_id": "2609.02047",
  "arxiv_url": "https://arxiv.org/abs/2609.02047",
  "summary_what_math_gives_to_ml": "The paper offers a nonstandard spectral mechanism in which a composite matrix combining network connectivity and heterogeneous phase delays predicts both linear stability and basin sizes of phase-locked states. This is transferable to phase-based recurrent or neural-ODE architectures by treating learned interactions as a graph with trainable phase offsets and constraining the spectrum of the corresponding cosine-weighted interaction matrix. The most direct implementation is a spectral-margin regularizer and initialization procedure for attracting latent memories or multiple dynamical modes. Its predictions are falsifiable: divergence should occur near the predicted eigenvalue boundary, while basin frequencies should change systematically when the composite spectrum is reshaped.",
  "title": "Phase-delays shape multistability and basin sizes in Kuramoto networks: analytical estimates from network structure",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 5,
  "novelty": 7,
  "usefulness": 8
 },
 "solves": [
  "stability",
  "generalization"
 ],
 "title": "Phase-Delay Spectral Margin for Attractor RNNs",
 "url": "https://synthcore.org/idea/3035/phase-delay-spectral-margin-for-attractor-rnns",
 "verification": {
  "benchmark": {
   "track": "dynamics",
   "model": "rnn_small",
   "n_seeds": 8,
   "metric_direction": "lower is better",
   "comparison": {
    "baseline_mean": 0.000254957890319929,
    "idea_mean": 0.00025879375971271656,
    "delta_mean": 0.000003835869392787572,
    "per_seed_diffs": [
     -0.000016625970602035522,
     -0.00017881821258924901,
     0.00002204588963650167,
     0.000015932804672047496,
     0.00005526881432160735,
     -0.00003233381721656769,
     0.000004499343049246818,
     0.00016071810387074947
    ],
    "idea_wins": 3,
    "n_pairs": 8,
    "p_value": 0.84895,
    "mde": 0.00007921439496717511,
    "mde_rel_pct": 31.069599323941087,
    "verdict": "no significant win",
    "system_worked": false
   },
   "baseline": {
    "best_cfg": {
     "lr": 0.006,
     "weight_decay": 0
    },
    "sweep": [
     {
      "cfg": {
       "lr": 0.0015,
       "weight_decay": 0
      },
      "mean": 0.0009279211371904239
     },
     {
      "cfg": {
       "lr": 0.003,
       "weight_decay": 0
      },
      "mean": 0.0005964032097836025
     },
     {
      "cfg": {
       "lr": 0.006,
       "weight_decay": 0
      },
      "mean": 0.0003292812507424969
     }
    ],
    "full": {
     "mean": 0.000254957890319929,
     "std": 0.00010644342536032148,
     "per_seed": [
      0.00032660356373526156,
      0.00046600779751315713,
      0.00021259563800413162,
      0.0003119180037174374,
      0.00017991565982811153,
      0.0002721373166423291,
      0.0001093827813747339,
      0.00016110236174426973
     ],
     "n": 8
    }
   },
   "idea": {
    "mean": 0.00025879375971271656,
    "std": 0.00006582941024778054,
    "per_seed": [
     0.00030997759313322604,
     0.0002871895849239081,
     0.00023464152764063329,
     0.0003278508083894849,
     0.00023518447414971888,
     0.0002398034994257614,
     0.00011388212442398071,
     0.0003218204656150192
    ],
    "n": 8
   },
   "mechanism_signature": {
    "confirmed": true,
    "observed_trained_model_mean_max_euler_amplification": 0.6608031913638115,
    "observed_trained_model_mean_min_real_eigenvalue": 3.3919921815395355,
    "predicted_boundary_amplification": {
     "0.8": 0.9999999999999996,
     "1.0": 0.9999999999999999,
     "1.2": 1.3999999999999986
    }
   },
   "custom_track": null
  },
  "mechanism_confirmed": true,
  "peer_reviewed": false,
  "practical_verdict": "inconclusive",
  "stage1_mechanism_check": {
   "worked": true,
   "confidence": 8,
   "verdict": "Built a phase-delay RNN with trainable nonnegative edge magnitudes, bounded phase delays, differentiable composite-Laplacian spectral regularization, and Euler stability diagnostics. The toy check reproduced the predicted boundary: amplification was 0.60 at 0.8ηc, 1.00 at ηc, and 1.40 at 1.2ηc. In the matched mini-run, the idea improved the minimum real spectral margin from 0.341 to 3.295, reduced maximum Euler amplification from 0.959 to 0.606, and reduced 12-step perturbation gain from 0.334 to 0.120, but task MSE worsened from 0.000172 to 0.00561; thus the stability effect is real, but task-performance benefit was not demonstrated.",
   "metrics": {
    "baseline": "task_mse=0.000172; min_real_eigenvalue=0.341; max_euler_amplification=0.959; 12_step_perturbation_gain=0.334",
    "idea": "task_mse=0.00561; min_real_eigenvalue=3.295; max_euler_amplification=0.606; 12_step_perturbation_gain=0.120"
   },
   "how_to_run": "python3 experiment.py",
   "files": [
    "experiment.py",
    "results.json"
   ],
   "limitations": "Only one small synthetic sequence task and one fixed random seed were tested; no adding-machine benchmark, multi-seed statistics, FLOP/speed comparison, long-horizon generalization, or larger attractor-RNN evaluation was performed. The perturbation test uses a short 12-step zero-input rollout, and the spectral penalty uses a dense eigensolver."
  },
  "status": "mech_ok_no_baseline",
  "status_label": "Mechanism confirmed, baseline not beaten",
  "updated_at": "2026-09-03T11:57:20",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)",
  "verification_axes": {
   "benchmark_mechanism": {
    "confirmed": true,
    "tested": true
   },
   "practical_benchmark": {
    "beats_baseline": false,
    "tested": true,
    "verdict": "inconclusive"
   },
   "toy_mechanism_gate": {
    "confirmed": true,
    "tested": true
   }
  }
 }
}
