Graph-Certified Switching SSM
Implementation & benchmark of arXiv:2607.15055 — Robust Optimal Control of Arbitrarily Switched Systems: A Path-Complete Framework
Source paper: Robust Optimal Control of Arbitrarily Switched Systems: A Path-Complete Framework arXiv:2607.15055 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Turn a path-complete graph into a stability regularizer for a recurrent or state-space neural network whose update can switch among M learned operators. Maintain a neural quadratic or positive scalar certificate V_alpha for each graph node and penalize every graph edge that violates contraction under its corresponding operator. The resulting architecture is designed to remain stable even when the mode sequence is arbitrary rather than generated by a trained gate.
Formulas
Mathematical statement
The paper's construction associates functions V_alpha with nodes of a labeled graph G=(S,E) and requires inequalities along all labeled edges. For a recurrent update z^+=F_i(z), adapt the cost inequality to a contraction certificate by requiring V_alpha(z) >= rho^{-1}V_beta(F_i(z)) for every edge (alpha,beta,i), with 0<rho<1. Equivalently, V_beta(F_i(z))-rho V_alpha(z) <= 0. Here z is the recurrent hidden state, F_i is mode-i state transition, V_alpha(z)>=0 is a node-specific certificate, and rho is the desired per-step contraction factor. A reachability graph H over subsets A of graph nodes supplies a valid min-max envelope W(z)=min_A max_{alpha in A}V_alpha(z), with the paper's condition that every beta in a successor set B has a predecessor alpha in A carrying the same label i. For a simple and trainable certificate, use V_alpha(z)=z^T P_alpha z with P_alpha=L_alpha L_alpha^T+epsilon I, or a positive neural scalar V_alpha(z)=softplus(g_alpha(z))+epsilon||z||^2. The edge loss is the positive part of V_beta(F_i(z))-rho V_alpha(z).
Implementation notes
1. Integration point: modify a gated recurrent model, diagonal SSM, or small recurrent core. Let z_t be the hidden state and let each mode i have its own update F_i(z_t,x_t), for example F_i(z,x)=tanh(A_i z+B_i x+b_i). The gate may choose modes from inputs, but training must evaluate all modes because deployment permits arbitrary switching. Add one certificate head V_alpha(z) for each graph node. Share the recurrent parameters or certificate trunk where possible; use quadratic certificates first because they are cheap and interpretable. 2. Pseudocode: for a batch of hidden states z, compute z_i=F_i(z,x) for all i; for each edge (alpha,beta,i), compute e=V_beta(z_i)-rho*V_alpha(z); accumulate softplus(e/tau); add lambda_contract times this loss to the task loss. Parameterize P_alpha=L_alpha L_alpha^T+epsilon I when using V_alpha(z)=z^T P_alpha z. Optionally choose the active envelope W(z)=min_A max_alpha V_alpha(z) as an auxiliary regularizer, but do not use hard argmin during backpropagation; use softmin temperature annealing. 3. The graph edge enumeration, positivity parameterization, and contraction target rho are known exactly. Empirical quantities are the hidden-state samples; for stronger evidence evaluate the maximum edge violation on held-out states and on long random mode sequences. For linear F_i and quadratic V_alpha, replace sampled training with semidefinite constraints P_alpha-rho A_i^T P_beta A_i >= 0 whenever the edge exists. 4. First experiment: compare a 1-layer switching SSM and an unconstrained GRU on permuted sequential MNIST or a synthetic long-memory sequence, with M=4 update operators and random mode switching at every time step. Match parameter count and train both at equal FLOPs. Track task accuracy, hidden-state norm over 10,000 unrolled steps, gradient norm, edge violation rate, and performance under unseen switching distributions. Success is no exploding hidden state, lower long-horizon gradient variance, and equal or better accuracy under adversarially chosen mode sequences.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: Inconclusive
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 8/10
Built a graph-certified switching scalar SSM with quadratic certificate V(z)=z², all-mode self-edges, softplus contraction penalty, CUDA execution with fallback, and a reproducible mini-experiment. The mechanism checks passed: the observed contraction boundary was |a|=0.901 versus predicted sqrt(0.81)=0.900, worst-switching log norm matched the product prediction to numerical precision, and the quadratic violation slope was within 10.6% of the predicted boundary slope. In the tiny learning comparison, regularization reduced max mode magnitude from 0.495 to 0.391 and improved MSE negligibly (2.32133 to 2.32117); this is a stability signal, not a meaningful task-performance win.
- Agent confidence
- 8/10
- Baseline
- MSE 2.321325; max |a| 0.494540; edge violation rate 0; worst 1000-step log norm -704.127
- Idea
- MSE 2.321170; max |a| 0.390664; edge violation rate 0; worst 1000-step log norm -939.909
- Verification
- Boundary predicted 0.900 vs observed grid 0.901; worst-switching log norm predicted and observed 2.364704; boundary-slope relative error 10.6%
Limitations: Only a scalar linear recurrence and one-node graph were tested, rather than a multi-node reachability envelope or neural/quadratic matrix certificates. The task experiment was very small and both models learned stable modes, so long-horizon adversarial switching, accuracy generalization, parameter-matched GRU comparison, and statistically repeated runs were not tested.
How to run: python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.15055)
No significant difference vs. the tuned baseline (+11.6%, p=0.2319, wins 3 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- switching_rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.06
- Idea mean
- 0.067
- Effect (Δ)
- 0.0069 (+11.6%; negative = idea better)
- Wins
- 3 / 8 paired seeds
- p-value
- 0.2319 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±20.9%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The final run used a reduced 400-sample train/test split and 5 epochs because the initial larger implementation exceeded the 40-minute limit. It tested a one-node quadratic certificate rather than the full multi-node reachability-envelope construction, and did not evaluate long-horizon adversarial switching rollouts or compare against the canonical bench rnn_small GRU architecture.
How to run: python3 bench_experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 9/10
Implemented Graph-Certified Switching SSM on the structurally matched dynamics/control track using the same four-mode recurrent architecture for baseline and idea, with the all-mode quadratic contraction loss as the only intervention. The trained-model signature confirmed the observed maximum zero-input certificate ratio was 0.574 versus target rho=0.81, but test MSE worsened from 0.06002 to 0.06697, with paired delta +0.00695 and permutation p=0.23195. Therefore the stability signal was present, but there was no task-metric win.
- Baseline
- best lr=0.01; test MSE mean 0.0600216757, std 0.0151569244; per-seed [0.08692939, 0.06139367, 0.07089250, 0.05957052, 0.04860168, 0.06793582, 0.05194413, 0.03290570]
- Comparison
- delta_mean=+0.0069475737, idea_wins=3/8, permutation p_value=0.23195, verdict=no significant win
- Idea
- best lambda_contract=0.2 at lr=0.01; test MSE mean 0.0669692494, std 0.0127851227; per-seed [0.07059102, 0.05721509, 0.08217970, 0.06861463, 0.06553272, 0.06471398, 0.08505756, 0.04184929]
- Mechanism signature
- predicted contraction ratio <= 0.81; observed maximum zero-input ratio 0.5740312, observed mean ratio 0.1977006, confirmed=true across 8 trained models
Benchmark result
No significant difference vs. the tuned baseline (+11.6%, p=0.2319, wins 3 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- switching_rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.06
- Idea mean
- 0.067
- Effect (Δ)
- 0.0069 (+11.6%; negative = idea better)
- Wins
- 3 / 8 paired seeds
- p-value
- 0.2319 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±20.9%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The final run used a reduced 400-sample train/test split and 5 epochs because the initial larger implementation exceeded the 40-minute limit. It tested a one-node quadratic certificate rather than the full multi-node reachability-envelope construction, and did not evaluate long-horizon adversarial switching rollouts or compare against the canonical bench rnn_small GRU architecture.
How to run: python3 bench_experiment.py
Artifacts
- bench_experiment.py 4.3 KB View Raw
- bench_report.json 3.8 KB View Raw
- experiment.py 5.4 KB View Raw
- report.md 1.7 KB View
- report_bench_2026-08-31T113157.md 6.2 KB View
- results.json 1.3 KB View Raw