Forward-Invariant STL Hidden-State Tubes
Implementation & benchmark of arXiv:2607.19196 — STL-GCS: A Planner-Controller Framework for Signal Temporal Logic via Graphs of Time-varying Convex Sets
Source paper: STL-GCS: A Planner-Controller Framework for Signal Temporal Logic via Graphs of Time-varying Convex Sets arXiv:2607.19196 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Augment a neural state-space model or neural ODE with a low-dimensional control residual that keeps its hidden state inside a sequence of time-varying convex sets encoding temporal requirements. At each integration step, solve a small quadratic program that minimally changes the network dynamics while enforcing an inward-pointing condition on every active convex-set face, producing robustly constrained long-horizon rollouts.
Formulas
Mathematical statement
Let the learned latent dynamics be $\dot h=f_\theta(h,y,t)+G_\theta(h,y,t)u$, with hidden state $h\in\mathbb{R}^r$, network parameters $\theta$, and correction $u\in\mathbb{R}^m$. Represent the STL requirement at time $t$ by the moving polytope $C(t)=\{h:A(t)h\le b(t)\}$, where row $a_i(t)^\top$ of $A(t)$ and scalar $b_i(t)$ define one convex predicate. For slack $s_i(h,t)=a_i(t)^\top h-b_i(t)$, impose the moving-boundary inward condition $a_i(t)^\top[f_\theta+G_\theta u]+\dot a_i(t)^\top h-\dot b_i(t)\le-\kappa\max(0,s_i)$, where $\kappa>0$ is the desired correction rate. This implies exponential decay of positive violations, $V_i(t)\le V_i(0)e^{-\kappa t}$, when $V_i=\max(0,s_i)$ and the constraints remain feasible. A robustness margin $\delta$ is implemented by shrinking the set boundary to $b_i-\delta\|a_i\|_2$.
Implementation notes
1. Integration point: use a GRU, structured state-space model, or neural ODE with latent state $h$. Add a residual input channel $u$ and parameterize $G_\theta$ as a small learned matrix, an identity map on selected latent coordinates, or a bounded linear head. Define STL predicates on decoded outputs $\hat y=D_\theta(h)$; for a linear decoder, pull output half-spaces back into latent half-spaces, while for a nonlinear decoder use its local Jacobian. 2. Pseudocode: at time $t$, compute $f_\theta$, evaluate the active polytope faces, estimate $\dot A$ and $\dot b$ by analytic differentiation or finite differences, construct the displayed inequalities, solve the minimum-norm QP, and integrate $h_{k+1}=h_k+\Delta t(f_\theta+G_\theta u^*)$. Initially stop gradients through the QP; later use an implicit differentiable QP layer. 3. Taken from the paper's mechanism are time-indexed convex STL sets and forward-invariance constraints. Estimated quantities are the learned dynamics, control map, moving-set derivatives, and actual robustness margin. 4. First experiment: train a two-layer GRU on Lorenz-63 or pendulum next-state prediction with the requirement that position remain in a safe interval during $[2,4]$ and enter a target interval during $[6,8]$. Compare unconstrained rollout, penalty-only training, and QP correction. Sweep $\kappa$, input bounds, and integration step. The prediction is a feasibility boundary: when available control authority exceeds the maximum outward boundary velocity, violations should vanish; below it, QP infeasibility or persistent violation should occur. In feasible runs, plot $\log V_i(t)$ and test whether its slope is approximately $-\kappa$ within 20 percent. Also test whether the robust STL violation rate approaches zero and whether long-horizon prediction error is lower than for the unconstrained model.
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 9/10
Built and numerically verified the scalar minimum-norm QP correction for a robust moving-boundary STL tube. All three mechanism predictions were confirmed: the safe-set authority threshold was U*=0.30 versus 0.30 observed, violation log-slopes matched -kappa within 0.21%, and the initial violation feasibility boundary was U*=d+kappa*s0=1.50 versus 1.50 observed. The corrected rollout reduced violation fraction from 0.8666 uncontrolled to 0 with U=0.5, demonstrating the mechanism in the toy setting.
- Agent confidence
- 9/10
- Baseline
- Uncontrolled violation fraction 0.8666267.
- Idea
- Corrected U=0.5 violation fraction 0.0; authority threshold predicted/observed 0.30; decay slope relative errors for kappa={0.5,1,2,4} were {0.025%,0.050%,0.100%,0.201%}; initial violation authority boundary predicted/observed 1.50; moving-boundary slack slope predicted/observed 0.30.
Limitations: This is an exact 1D toy QP, not a learned GRU/neural ODE or general multidimensional polytope solver. It does not test training effects, prediction accuracy, temporal operators beyond a moving half-space, QP cost, nonlinear decoders, disturbances, or model mismatch.
How to run: python3 toy_stl_tube.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.19196)
Significantly WORSE than the tuned baseline (+33629.1%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0
- Idea mean
- 0.0077
- Effect (Δ)
- 0.0077 (+33629.1%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±19956.7%
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Tested only the registered built-in dynamics track, scalar output tube, one fixed bound/margin/authority setting with three learning rates, 10 training epochs, and inference-time correction. Did not test multidimensional polytopes, moving time-dependent faces, nonlinear decoders, differentiable QP layers, longer training, alternative control authority, or STL temporal operators beyond the static robust interval tube.
How to run: python3 bench_stl_tube.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 Forward-Invariant STL Hidden-State Tube intervention on the structurally matched dynamics track using the shared rnn_small GRU, with a scalar minimum-norm residual and robust output tube. The full 8-seed paired benchmark found the idea significantly worse: baseline MSE 2.282289e-05 versus idea MSE 0.007697958, paired delta +0.007675135, permutation p=0.0081. The trained-model mechanism prediction was not confirmed because authority saturation left 416 post-correction violations out of 1331 raw violations.
- Baseline
- dynamics/rnn_small; best lr=0.006; full 8-seed test MSE mean=2.282289460708853e-05, std=2.305330446600017e-06
- Idea
- TubeRNN with bound=1.4, margin=0.1, authority=1.0; best lr=0.003; full 8-seed test MSE mean=0.007697957786149345, std=0.005095428561230907; paired delta=0.007675134891542257; permutation p=0.0081
Benchmark result
Significantly WORSE than the tuned baseline (+33629.1%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Dynamics forecasting
- Model
- rnn_small
- Paired seeds
- 8
- Baseline mean
- 0
- Idea mean
- 0.0077
- Effect (Δ)
- 0.0077 (+33629.1%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±19956.7%
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Tested only the registered built-in dynamics track, scalar output tube, one fixed bound/margin/authority setting with three learning rates, 10 training epochs, and inference-time correction. Did not test multidimensional polytopes, moving time-dependent faces, nonlinear decoders, differentiable QP layers, longer training, alternative control authority, or STL temporal operators beyond the static robust interval tube.
How to run: python3 bench_stl_tube.py
Artifacts
- bench_report.json 4.8 KB View Raw
- bench_stl_tube.py 6.8 KB View Raw
- report.md 1.4 KB View
- report_bench_2026-08-30T205841.md 4.0 KB View
- results.json 4.0 KB View Raw
- toy_stl_tube.py 5.1 KB View Raw