Data-driven invariant hidden-state ellipsoid
Implementation & benchmark of arXiv:2608.23412 — Data-Driven Synthesis of Robust Positively Invariant Sets: From State Feedback to Output Feedback
Source paper: Data-Driven Synthesis of Robust Positively Invariant Sets: From State Feedback to Output Feedback arXiv:2608.23412 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Constrain a recurrent or state-space neural network to keep its hidden state inside an ellipsoid that is robustly invariant under bounded feature inputs, hidden-state perturbations, and model mismatch estimated from offline trajectories. The ellipsoid and a stabilizing recurrent gain are fitted from data through an SDP-inspired certificate, then used either as a training regularizer or as a projection layer at inference time.
Formulas
Mathematical statement
Let the hidden dynamics be approximated on collected trajectories by $h_{k+1}=Ah_k+Bz_k+e_k$, where $h_k\in\mathbb{R}^d$ is the hidden state, $z_k$ is the network input or feature, $A$ and $B$ are fitted linear maps, and $e_k$ is the residual. Bound the residual and input by ellipsoids $\mathcal{E}_e=\{e:e^TQ_e^{-1}e\leq1\}$ and $\mathcal{E}_z=\{z:z^TQ_z^{-1}z\leq1\}$. For a recurrent feedback parameterization $z_k=Kh_k+\xi_k$, with bounded exogenous disturbance $\xi_k$, the closed-loop matrix is $F=A+BK$. An ellipsoid $\mathcal{E}(P)=\{h:h^TP^{-1}h\leq1\}$ is robust positively invariant if $F\mathcal{E}(P)\oplus\mathcal{E}_e\oplus B\mathcal{E}_\xi\subseteq\mathcal{E}(P)$. A sufficient condition uses multipliers $\alpha_i>0$, $\sum_i\alpha_i\leq1$: $FPF^T/\alpha_0+Q_e/\alpha_1+BQ_\xi B^T/\alpha_2\preceq P$. The key quantitative signature is the contraction factor $q=\sqrt{\lambda_{\max}(P^{-1/2}FPF^TP^{-1/2})}<1$ and a disturbance radius proportional to $1/(1-q)$.
Implementation notes
1. Integration point: use a GRU-free residual RNN or linear state-space block, for example $h_{t+1}=\phi(W_hh_t+W_zz_t+b)$, and begin with the linearized or residual version $h_{t+1}=Ah_t+Bz_t+e_t$. Collect hidden trajectories from a normally trained baseline over calibration sequences. Fit $A,B$ by ridge regression and compute residuals $e_t=h_{t+1}-Ah_t-Bz_t$. Estimate $Q_e$ as an inflated covariance ellipsoid or a diagonal ellipsoid containing 99 percent of residuals; estimate $Q_\xi$ from the feature distribution. 2. Pseudocode: fit $A,B$; initialize $P\succ0$, $K$, and positive multipliers $\alpha_i$; solve an SDP or alternating convex program minimizing $\log\det P$ subject to $FPF^T/\alpha_0+Q_e/\alpha_1+BQ_\xi B^T/\alpha_2\preceq P$, with $F=A+BK$ and a norm bound on $K$; freeze the resulting $P,K$ for the first experiment. During training add $\lambda\max(0,h_t^TP^{-1}h_t-1)^2$ to the task loss. At inference optionally project $h_t$ to $\mathcal{E}(P)$ using $h_t\leftarrow h_t/\max(1,\sqrt{h_t^TP^{-1}h_t})$. 3. Computed from the paper's mechanism: the invariant-set inclusion and SDP certificate. Estimated empirically: $A,B$, residual ellipsoid $Q_e$, feature bound $Q_\xi$, and nonlinear approximation error. For nonlinear activations, enlarge $Q_e$ using held-out Jacobian and residual errors; the guarantee is empirical unless a global Lipschitz bound is supplied. 4. First cheap experiment: train a small tanh RNN on sequential MNIST, permuted MNIST, or a synthetic long-horizon copy task, comparing the baseline, ellipsoid regularization, and projection. Sweep input-noise scale and recurrent spectral scale. Measure $q$, ellipsoid violation rate, hidden norm, gradient norm, and loss after 1,000 to 10,000 recurrent steps. The predicted signature is a sharp degradation when $q$ crosses one: for $q<1$, violations and hidden energy remain bounded and the disturbance-induced radius follows approximately $1/(1-q)$; for $q>1$, hidden norms grow exponentially at a rate close to $\log q$. The estimated transition should agree with the observed divergence boundary within approximately 20 percent.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
Stage 2 · Practical benchmark result: Significantly worse ✗
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 reproducible data-driven linear hidden-state ellipsoid MVP with ridge dynamics fitting, residual-radius estimation, contraction-factor calculation, projection, and quantitative sweeps. The mechanism manifested: the observed instability boundary was q≈1.01 versus predicted q=1, the disturbance radius matched sigma/(1-q) with 0.062% mean relative error, and unstable growth rates matched log(q) for q=1.01 and 1.10. Projection reduced ellipsoid violations from 96.3% to 0% under a 1e-10 numerical tolerance, although this is a projection safety effect rather than a learned task-performance win.
- Agent confidence
- 8/10
- Baseline
- Unprojected unstable rollout: q=1.1234, raw ellipsoid violation rate=96.33%, maximum normalized energy=4.11e15
- Idea
- Projected rollout: same q=1.1234, violation rate=0% with tolerance 1e-10, maximum normalized energy≈1.0; fitted A relative error=2.20%; scalar radius mean relative error=0.062%; observed boundary q=1.01 vs predicted 1.0
Limitations: The experiment is a low-dimensional linear toy, not a trained nonlinear RNN or sequential task. No SDP optimization of P,K, task loss, training regularizer, FLOP/speed comparison, or formal robust-invariance certificate was tested; P was conservatively initialized rather than solved from the full matrix inequality.
How to run: python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.23412)
Significantly WORSE than the tuned baseline (+45469.6%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0005
- Idea mean
- 0.2484
- Effect (Δ)
- 0.2479 (+45469.6%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the small registered dynamics track was tested. The implementation used empirical covariance fitting and barrier/projection rather than a full SDP solution for P and K; larger models, longer horizons, formal robust-invariance certification, speed/FLOP measurements, and alternative ellipsoid estimators were not tested.
How to run: python3 stage2_bench.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 10/10
Implemented the data-driven hidden-state ellipsoid intervention on the registered dynamics track with the shared rnn_small architecture. The tuned baseline significantly outperformed the best idea configuration: baseline MSE 0.00054517 versus idea MSE 0.24843272, paired delta +0.24788754, permutation p=0.0081. The trained-model signature was not confirmed because normalized ellipsoid violation was 100% and maximum energy was 22.335 rather than the predicted bound of 1.
- Baseline
- lr=0.01; mean test MSE=0.0005451723; std=0.0002036184
- Idea
- lr=0.01, lambda=0.01; mean test MSE=0.2484327164; std=0.1289024479; delta=+0.2478875441; p=0.0081; wins=0
Benchmark result
Significantly WORSE than the tuned baseline (+45469.6%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0.0005
- Idea mean
- 0.2484
- Effect (Δ)
- 0.2479 (+45469.6%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the small registered dynamics track was tested. The implementation used empirical covariance fitting and barrier/projection rather than a full SDP solution for P and K; larger models, longer horizons, formal robust-invariance certification, speed/FLOP measurements, and alternative ellipsoid estimators were not tested.
How to run: python3 stage2_bench.py
Artifacts
- bench_report.json 6.4 KB View Raw
- experiment.py 4.6 KB View Raw
- report.md 1.6 KB View
- report_bench_2026-09-03T000340.md 5.0 KB View
- results.json 5.2 KB View Raw
- stage2_bench.py 5.3 KB View Raw