△ Mechanism confirmed, baseline not beaten 2026

SOS Backup Shield for Learned Policies

Implementation & benchmark of arXiv:2608.27916 — Backup Control Barrier Function Synthesis using Sum-of-Squares Reachability

Usefulness7/10
Difficulty7/10
Novelty7/10

Source paper: Backup Control Barrier Function Synthesis using Sum-of-Squares Reachability arXiv:2608.27916 ⓘ · analyzed Sep 1, 2026

AI-generated research hypothesis, automatically tested. Not peer-reviewed.

Idea description

Wrap a neural policy with a backup controller synthesized by finite-horizon SOS backward reachability. The neural policy is used whenever it remains inside the certified feasible region; otherwise, a time-indexed backup controller drives the state into a terminal-safe set while respecting actuator limits.

Formulas

$$\dot{x}=f(x)+g(x)u,\qquad \mathcal{B}_t=\{x\in\mathcal{X}:V(t,x)\leq1\},$$
$$\frac{d}{dt}V(t,x(t))=\partial_tV(t,x)+\nabla_xV(t,x)^\top\left[f(x)+g(x)k_b(t,x)\right]\leq0\quad\text{for }x\in\mathcal{B}_t,$$
$$\mathcal{B}_T\subseteq\mathcal{S}_{\mathrm{term}},\qquad -\dot V(t,x)=\sigma_0(t,x)+\sum_{i=1}^{r}\sigma_i(t,x)q_i(x),\quad \sigma_i\in\Sigma[x,t],$$
$$u(x)=\begin{cases}\pi_\theta(x),&\displaystyle\max_{u\in\mathcal{U}}\nabla h(x)^\top[f(x)+g(x)u]+\alpha(h(x))\geq0,\\ k_b(\tau(x),x),&\text{otherwise},\end{cases}$$

Mathematical statement

Assume a polynomial or locally polynomial control-affine plant $\dot{x}=f(x)+g(x)u$, state domain $\mathcal{X}$, and polytope input set $\mathcal{U}$. Let $V(t,x)$ be a polynomial certificate and define the time-dependent sublevel sets $\mathcal{B}_t=\{x:V(t,x)\leq1\}$. A backup feedback $k_b(t,x)$ must satisfy $k_b(t,x)\in\mathcal{U}$ and $\partial_tV+\nabla_xV^\top[f(x)+g(x)k_b(t,x)]\leq0$ on $\mathcal{B}_t$, so trajectories starting in $\mathcal{B}_0$ remain in the evolving tube. The terminal condition $\mathcal{B}_T\subseteq\mathcal{S}_{\mathrm{term}}$ guarantees arrival in a pre-certified safe set. Each nonnegativity condition is imposed over a semialgebraic domain using SOS multipliers, for example $-\dot V=\sigma_0+\sum_i\sigma_iq_i$ where $q_i(x)\geq0$ define the domain and $\sigma_i$ are sum-of-squares polynomials. A learned policy $\pi_\theta(x)$ is accepted only when a barrier feasibility margin is nonnegative; otherwise the controller switches to $k_b$.

Implementation notes

1. Exact integration point: place the shield after the neural policy forward pass in a continuous-control RL agent, learned robot controller, or neural world-model rollout. Let $x$ be the state, $\pi_\theta(x)$ the nominal action, and $h(x)\geq0$ a known instantaneous safety function. Fit polynomial approximations $\hat f,\hat g$ to the dynamics on a compact operating box, or use a polynomial simulator. Choose a terminal safe set $\mathcal{S}_{\mathrm{term}}$ with a simple certified controller and solve an offline SOS program for polynomial $V(t,x)$ and polynomial backup feedback $k_b(t,x)$ over horizon $T$. 2. Pseudocode: at each step compute $u_\pi=\pi_\theta(x)$ and the margin $m=\nabla h(x)^\top[\hat f(x)+\hat g(x)u_\pi]+\alpha(h(x))$. If $m\geq0$ and $V(0,x)\leq1$, execute $u_\pi$; otherwise compute remaining backup time $\tau$ and execute the saturated $k_b(\tau,x)$. During SOS synthesis enforce $-\partial_tV-\nabla V^\top(\hat f+\hat gk_b)\geq0$, input-polytope constraints, and terminal inclusion through SOS multipliers. 3. Computed from the paper: the certificate, backup controller, and certified sublevel geometry. Estimated empirically: dynamics approximation error, actual derivative of $V$, barrier margin, certificate violations under the true simulator, and certified-set volume. Add a robustness margin $\varepsilon$ by requiring the derivative to be at most $-\varepsilon\|x\|^2$ when model error is bounded. 4. First cheap experiment: use a 2-D Dubins car or torque-limited pendulum and compare PPO or SAC with no shield, a hand-designed backup controller, and the SOS shield. Train policies identically and test 1,000 random initial states near the safety boundary. The falsifiable prediction is that every rollout initialized inside the certified $\mathcal{B}_0$ remains safe and reaches $\mathcal{S}_{\mathrm{term}}$ under backup control, subject to the measured model-error margin. Outside $\mathcal{B}_0$, failure probability should rise sharply. The main quantitative signature is a certified-set volume larger than the original terminal backup set, empirical safety violations below the robustness tolerance, and a switch boundary matching the predicted contour $V(0,x)=1$ within 10-20%.

Verification

Mechanism confirmed, baseline not beaten

Stage 1 · Toy mechanism gate: Passed ✓

Stage 2 · Mechanism transferred to benchmark: Confirmed ✓

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 finite-horizon backup shield prototype for a torque-limited double integrator using an explicit quadratic Lyapunov/SOS-style certificate and saturated PD backup controller. The mechanism manifested: the dissipation identity error was 1.1e-16, observed decay bound 0.759653 versus predicted 0.759653, certificate area scaled exactly as terminal_radius^2 (ratios 0.25, 1, 4, 9), and reachable volume increased monotonically with horizon. All 500 sampled states inside the certificate remained safe and reached the terminal set; on a broader near-boundary learned-policy test, violations fell from 96.2% baseline to 22.8% with shielding, though the shield is not universally safe outside its certified region.

Agent confidence
8/10
Baseline
Near-boundary nominal policy: violation rate 0.962; mean violation 14.9417
Idea
Near-boundary shielded policy: violation rate 0.228; mean violation 0.08638; mean switches 628.568. Certified-set audit: 500/500 safe and 500/500 terminal. Dissipation observed/predicted: 0.759653/0.759653. Certificate-area ratios for terminal radii 0.03/0.06/0.12/0.18: 0.25/1/4/9, exactly predicted.

Limitations: This is an analytic quadratic certificate toy, not a full numerical SOS synthesis or neural RL training experiment. The shield comparison uses a fixed noisy proxy policy, simplified barrier logic, nominal exact dynamics, and sampled initial states; model uncertainty, disturbances, high-dimensional plants, PPO/SAC training, and formal terminal-set certification were not tested.

How to run: python3 sos_backup_shield.py

Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.27916)

Significantly WORSE than the tuned baseline (+2777.8%, p=0.0081, wins 0 / 8 paired seeds).

Benchmark
Robust_cbf_pendulum_policy
Model
local_mlp_tiny
Paired seeds
8
Baseline mean
0.002
Idea mean
0.0575
Effect (Δ)
0.0555 (+2777.8%; negative = idea better)
Wins
0 / 8 paired seeds
p-value
0.0081 (permutation test, 20 000 shuffles)
Smallest detectable effect
±392.0%
Mechanism
Confirmed ✓
Practical effect
Hurts
Baseline tuning
swept over 3 configs
Limitations:

The registered track is a small supervised action-regression proxy rather than PPO/SAC or long-horizon closed-loop RL. Disturbance/model-mismatch stress tests, formal numerical SOS optimization, and the built-in dynamics track were not tested.

How to run: python3 /home/maxwelhelp/all/math2nn/bench/custom_tracks/robust_cbf_pendulum_policy.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

The SOS-style backup shield was evaluated on the registered robust_cbf_pendulum_policy dynamics track with matched MLP systems. The certificate check and trained-model mechanism signature passed, but the shield significantly worsened standard task MSE: paired delta +0.05549742063158192 and permutation p=0.0081.

Baseline
8-seed MSE mean 0.0019978795608039945; tuned lr=0.006, eps=0.0, epochs=15.
Idea
8-seed MSE mean 0.05749530019238591; selected lr=0.003, eps=0.25, epochs=15; paired delta +0.05549742063158192; p=0.0081; 0/8 wins.
Mechanism signature
Confirmed: observed margin slope -2.0 and lower-bound shift +1.0 per epsilon on trained models.

Benchmark result

Significantly WORSE than the tuned baseline (+2777.8%, p=0.0081, wins 0 / 8 paired seeds).

Benchmark
Robust_cbf_pendulum_policy
Model
local_mlp_tiny
Paired seeds
8
Baseline mean
0.002
Idea mean
0.0575
Effect (Δ)
0.0555 (+2777.8%; negative = idea better)
Wins
0 / 8 paired seeds
p-value
0.0081 (permutation test, 20 000 shuffles)
Smallest detectable effect
±392.0%
Mechanism
Confirmed ✓
Practical effect
Hurts
Baseline tuning
swept over 3 configs
Limitations:

The registered track is a small supervised action-regression proxy rather than PPO/SAC or long-horizon closed-loop RL. Disturbance/model-mismatch stress tests, formal numerical SOS optimization, and the built-in dynamics track were not tested.

How to run: python3 /home/maxwelhelp/all/math2nn/bench/custom_tracks/robust_cbf_pendulum_policy.py

Artifacts

Implementation overview ⬇ Download all as ZIP 6 files · code, reports and structured results