Robust CBF Safety Layer for Neural Policies
Implementation & benchmark of arXiv:2608.10872 — Robust Safety Filtering for Input-Constrained Underactuated Linear Systems
Source paper: Robust Safety Filtering for Input-Constrained Underactuated Linear Systems arXiv:2608.10872 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Attach a robust high-order control-barrier-function safety layer after a neural policy for a learned or known control-affine plant. The network proposes a nominal action, while a small online projection modifies it only enough to satisfy input bounds and barrier inequalities under an estimated disturbance and an explicit transient error bound.
Formulas
Mathematical statement
Consider plant dynamics \(\dot{x}=f(x)+g(x)u+Ew\), where \(x\) is the state, \(u\) is the neural control action, \(w\) is an unknown disturbance, and \(E\) maps disturbances into the state. Let \(h(x)\ge 0\) define the safe set and let its relative degree be \(r\). Define \(\psi_0=h\) and \(\psi_i=\dot{\psi}_{i-1}+\alpha_i(\psi_{i-1})\), where each \(\alpha_i\) is an extended class-\(\mathcal K\) function. At the final level enforce \(\dot{\psi}_{r-1}\ge -\alpha_r(\psi_{r-1})\). If a disturbance observer supplies \(\hat{w}\) and a bound \(\lVert w-\hat{w}\rVert\le \varepsilon(t)\), replace the unknown disturbance contribution by its worst-case support function. For scalar input, each robust condition becomes an upper or lower bound on \(u\). Intersecting all bounds with the actuator interval yields \(I=[u_-,u_+]\). Forward invariance is guaranteed whenever \(I\) is nonempty, and \(M=u_+-u_-\) is the feasibility margin.
Implementation notes
1. Integration point: use a neural policy \(u_{\mathrm{NN}}=\pi_\theta(o_t)\) in an RL agent, model-predictive learned controller, or differentiable simulator. Maintain a known linearized model \(\dot{x}=Ax+Bu+Ew\), or identify \(A,B,E\) from data, and execute the safety layer after the network. Maintain a disturbance observer, such as \(\dot{\hat{w}}=-L(\hat{x}-x)\), and use a conservative bound \(\varepsilon_t=\varepsilon_0\exp(-\lambda t)+\varepsilon_\infty\). 2. Pseudocode: compute \(\hat{w}_t,\varepsilon_t\); evaluate \(h,\psi_1,\ldots,\psi_r\); convert every robust barrier condition into a scalar lower or upper bound on \(u\); intersect those bounds with \([u_{\min},u_{\max}]\); if \(u_-\le u_+\), project \(u_{\mathrm{NN}}\) onto the interval; otherwise execute a predefined emergency action. Log \(M_t\) and the intervention \(u_{\mathrm{safe}}-u_{\mathrm{NN}}\). 3. The CBF recursion and interval projection are computed analytically. Observer gains, disturbance bounds, and model error are estimated from calibration rollouts. 4. First cheap experiment: train an MLP policy on a two-dimensional double integrator or cart-pole with bounded force and position barriers. Compare vanilla action clipping, an ordinary CBF filter, and this robust filter under bounded injected disturbances. The predicted signature is that violations remain absent while the measured disturbance error is below \(\varepsilon_t\) and \(M_t>0\). Failures should begin near the analytically predicted \(M=0\) boundary or when the disturbance exceeds the bound. Across a disturbance sweep, the measured feasibility threshold should match the computed threshold within 10 percent.
Verification
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 9/10
Built a robust relative-degree-2 CBF safety layer with actuator intersection, nominal-action projection, disturbance-margin tightening, and emergency fallback. The toy math checks confirmed all three mechanism predictions: bound shifts were exactly lower +epsilon and upper -epsilon, feasibility margin scaled as M(epsilon)=M(0)-2epsilon with observed slope -2.00 versus predicted -2, and the empty-interval threshold was observed at epsilon=4.0 versus predicted 4.0. In closed-loop testing, robust CBF eliminated violations through disturbance amplitude 0.6 and outperformed ordinary CBF at 0.6-1.0, but safety degraded once the stated disturbance bound was exceeded; this is a real but conditional effect, not an unconditional guarantee.
- Agent confidence
- 9/10
- Baseline
- Vanilla action clipping: maximum position violation 0.0092 at disturbance 0.0, rising to 0.4590 at amplitude 0.8 and 0.4226 at amplitude 1.0. Ordinary non-robust CBF had zero violation through amplitude 0.5, then 0.0120 at 0.6, 0.1025 at 0.8, and 0.1910 at 1.0.
- Idea
- Robust CBF with epsilon=0.35: zero violation through amplitude 0.6, then 0.0561 at 0.8 and 0.1119 at 1.0. Algebraic margin slope was -2.0000 versus predicted -2; critical uncertainty was 4.0 observed versus 4.0 predicted; bound shifts matched +/-epsilon exactly.
Limitations: The neural policy is represented by a fixed bounded PD surrogate rather than a trained MLP or RL agent. The plant is a known double integrator, the disturbance estimate is fixed at zero, Euler integration is used, and emergency behavior is only a closest-endpoint fallback. No learned-model uncertainty, observer dynamics, multi-input projection, formal discretization correction, or hardware timing benchmark was tested.
How to run: python3 robust_cbf_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.10872)
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
The custom benchmark is supervised state-to-expert-action regression rather than closed-loop reinforcement learning. It uses a known two-state pendulum surrogate, fixed disturbance-bound settings, scalar action, and does not measure runtime, multi-input quadratic programming, learned model uncertainty, observer estimation error, or long-horizon closed-loop safety under disturbances.
How to run: python3 robust_cbf_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
Built an end-to-end robust relative-degree-2 CBF projection after a neural pendulum policy, including actuator bounds, disturbance-margin tightening, and emergency fallback. The baseline mean test MSE was 0.00199788 versus 0.05749530 for the best robust-CBF setting; paired delta was +0.05549742 with permutation p=0.0081, so the idea was significantly worse. The mechanism signature nevertheless confirmed the predicted margin slope (-2.0) and lower-bound shift (+1.0 per epsilon) from trained models.
- Baseline
- mean MSE=0.0019978795608039945, best lr=0.006, epochs=15
- Idea
- mean MSE=0.05749530019238591, best lr=0.003, epsilon=0.25, epochs=15; delta=+0.05549742063158192; p=0.0081; 0/8 paired wins
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
The custom benchmark is supervised state-to-expert-action regression rather than closed-loop reinforcement learning. It uses a known two-state pendulum surrogate, fixed disturbance-bound settings, scalar action, and does not measure runtime, multi-input quadratic programming, learned model uncertainty, observer estimation error, or long-horizon closed-loop safety under disturbances.
How to run: python3 robust_cbf_bench.py
Artifacts
- bench_report.json 2.9 KB View Raw
- report.md 2.0 KB View
- report_bench_2026-09-01T100233.md 4.8 KB View
- results.json 6.3 KB View Raw
- robust_cbf_bench.py 5.5 KB View Raw
- robust_cbf_experiment.py 4.5 KB View Raw