A robot's safety filter checks every command the controller wants to send and changes it when that command could lead to a crash. The filters that come with proofs are slow. The full predictive control barrier function filter, an online optimization that looks ahead several steps to keep the system inside a safe region, takes about 176 ms per step on a lane-keeping car. A neural network trained to imitate it runs in about 3 ms, but its proof only says the car ends up near the safe set, not inside it (Approximate Predictive Control Barrier Functions using Neural Networks).
Language-model cascades already settle this kind of trade-off in practice. A small model answers the easy queries and hands the hard ones to a large model. Those cascades decide when to hand off using calibrated confidence scores, and their guarantees are statistical. We propose a cascade for safety filters in which the handoff rule is itself part of a proof. The fast neural filter acts alone wherever an offline certificate shows its error cannot matter. The slow exact filter is called early enough that its answer arrives before the system could reach states where the fast filter's error does matter. The result is a filter that runs at roughly neural-network cost in most states and keeps the exact filter's hard safety guarantee across the whole closed loop.
Core Claim
The new ingredient is a deferral rule that accounts for how long the expensive tier takes to answer. In current cascades the large model is assumed to answer instantly, and the deferral threshold comes from confidence (Gatekeeper, Calibrated Deferral Routing for Cost-Efficient Guardrails). In a control loop running at 10–100 Hz, a 176 ms solve spans many control steps. Deferring "when uncertain" is therefore unsafe even if the uncertainty estimate is perfect, because the system keeps moving while the heavy tier computes.
We use three quantities. Let $h$ be the exact predictive safety value, with $h(x) \ge 0$ meaning state $x$ is safe. Let $\hat h$ be the neural approximation, certified offline to satisfy $|\hat h - h| \le \epsilon_h$ on the operating domain. Let $c$ be a certified bound on how fast $h$ can change along any admissible closed-loop trajectory, which follows from Lipschitz constants of the dynamics and of $h$. If the heavy solver needs at most $T_L$ seconds, the fast tier is allowed to act alone only while
$$\hat h(x) \;\ge\; \epsilon_h + c\,T_L + \delta,$$
where $\delta \ge 0$ is a tunable slack. Escalation is triggered as soon as the inequality fails. The form of the threshold follows directly from the definitions: $h$ cannot fall by more than $cT_L$ during one solve, and $\hat h$ overestimates $h$ by at most $\epsilon_h$. So at the moment the exact answer arrives, the true state still has $h \ge 0$.
The claim to be proven and tested is that the combined system, which switches among a fast mode, a pending mode and an exact mode, keeps the safe set forward invariant. We further claim that it calls the expensive tier on only a small fraction of steps, and that it is strictly less conservative than the obvious alternative of tightening the neural filter by $\epsilon_h$ everywhere.
Relation to Prior Work
The closest formal work is Bridging Efficiency and Safety: Formal Verification of Neural Networks with Early Exits. It verifies a single image classifier with internal exits. Its robustness property only counts counterexamples that are consistent with the exit path, and it shows tractability when nearby inputs take the same exit path. It supplies a useful idea, namely verifying a computation whose path depends on the input, but it covers only one feedforward pass with no dynamics and no time. In our setting the "exit path" unfolds over time, and the expensive branch has latency. That latency is exactly what the earlier work's setting cannot express.
Two papers supply the components we reuse:
- The fast tier. The neural predictive barrier filter of Approximate Predictive Control Barrier Functions using Neural Networks gives us the fast tier and its error bound $\epsilon_h$. We do not change how it is trained. We change where it is trusted.
- The certification machinery. Certifiable Reachability Learning Using a New Lipschitz Continuous Value Function builds a reach-avoid value function that is Lipschitz by construction. It certifies safe sets with second-order cone programs (a class of convex optimization problems) at about 10 Hz online, and reports a success rate of 1.0 from certified initial states on a 12-dimensional drone and a 10-dimensional highway task. It supplies both the Lipschitz certification we use to bound $c$ and $\epsilon_h$, and a second candidate for the exact tier. That paper also notes that long-horizon certificates become conservative. Our cascade sidesteps this, because the fast tier only ever needs a certificate over the short window $T_L$.
The language-model cascade literature motivates the architecture and constrains the design:
- RouteLLM shows that skewed difficulty lets a router call the strong model rarely.
- C3PO adds conformal cost guarantees under the assumption that calibration and deployment data are exchangeable.
- Calibrated Deferral Routing for Cost-Efficient Guardrails shows that raw confidence is badly miscalibrated, with expected calibration error of 6–28% before calibration.
All three treat the handoff as a statistical event and the expensive model as instantaneous. We replace both assumptions. The handoff is a certified level-set test, and the latency is part of the proof.
For unknown dynamics, the Gaussian-process error bounds in Control Barrier Functions for Unknown Nonlinear Systems using Gaussian Processes and Formal Verification of Unknown Dynamical Systems via Gaussian Process Regression constrain the extension. A learned-dynamics error enters $c$ as an additive term. The guarantee then becomes probabilistic at the confidence level of the Gaussian-process bound, and we will state it that way.
Research Program
The work has four parts.
Proof of invariance. We prove forward invariance for the three-mode switched system under bounded disturbances. This includes the handover back from the exact tier to the fast tier, using hysteresis so the system does not chatter between modes. We also need the exact tier's backup-trajectory feasibility to carry across the pending window.
Offline certification of the trigger. We certify $\epsilon_h$ and $c$ offline using Lipschitz bounds and cone programs, following Certifiable Reachability Learning. To keep $c T_L$ small, we certify a local rate bound $c(x)$ over cells rather than one global constant. This is where most of the permissiveness will come from.
Independent check of the closed loop. As a check that does not rely on our own proof, we abstract the closed-loop cascade on the low-dimensional benchmark into an interval Markov decision process, a discrete model whose transition probabilities are known only up to intervals. We verify the reach-avoid specification with IntervalMDP.jl, using noise partitioning as in Formal Abstraction of General Stochastic Systems via Noise Partitioning. The cascade's mode becomes part of the abstract state.
Measurement. We measure how the escalation rate depends on $T_L$, $\epsilon_h$ and $\delta$. This tells a practitioner how good the neural approximation must be before the cascade pays off.
Baselines
The naive reference is the exact predictive filter run on every step. On the kinematic lane-keeping car it takes about 176 ms per step versus about 3 ms for the neural filter, the 58x figure reported in Approximate Predictive Control Barrier Functions using Neural Networks.
- Exact filter, offline. Run without time limits, it defines the permissiveness ceiling: how often and how much it modifies the nominal command.
- Exact filter, real time. Run at the actual control rate, it must hold its last command between solves. This is how it would really be deployed, and it is where its guarantee can break.
We run both on identical initial-state sets, disturbance sequences and solver settings.
The strongest existing method is the neural filter alone, exactly as published. Its proof gives convergence to a neighborhood of the safe set. To beat it, we must show zero constraint violations where it shows nonzero violation frequency or depth under adversarially chosen disturbances, at a mean per-step cost within a small multiple of 3 ms. The paper reports no violation rate, so we will measure one ourselves.
A second strong competitor is the neural filter with every constraint tightened by $\epsilon_h$. This variant is also provably safe and needs no expensive tier. On the higher-dimensional tasks we add the Lipschitz cone-program filter of Certifiable Reachability Learning, with its reported 1.0 success rate inside its certified set at 10 Hz. Here the comparison is the size of the certified initial set and task success outside it.
Two ablations isolate the key ingredient. The first keeps the cascade but sets $T_L = 0$ in the trigger, i.e. it ignores latency. The second replaces the certified trigger with a calibrated-confidence trigger on ensemble disagreement of $\hat h$, tuned with isotonic regression as in Calibrated Deferral Routing, to the same escalation rate. All learned components get the same training data and the same hyperparameter budget.
Why not just…?
Why not just run the neural filter alone and accept a small neighborhood? For many applications that may be acceptable. The published guarantee permits violations of size tied to $\epsilon_h$, and on a car near a lane edge or a drone near a gate, that neighborhood is the crash. The adversarial-disturbance experiment will show whether those violations actually occur. If the neural filter never violates even under worst-case search, the cascade's value shrinks to a guarantee on paper, and we will report that.
Why not just tighten the neural filter by $\epsilon_h$? This is the real threat, because it is safe and costs nothing extra. Its weakness is that it gives up permissiveness everywhere, including in the narrow-margin states where performance matters most. The cascade gives up nothing there, because the exact tier takes over. The decisive measurement is task performance and intervention size near constraint boundaries at matched safety. If tightening loses less than about the escalation cost, we conclude the cascade is unnecessary at that $\epsilon_h$. We then report the $\epsilon_h$ crossover point instead of claiming a general win.
Why not just defer on calibrated confidence, as language-model cascades do? Calibration fixes average reliability, not worst-case behavior. Even a perfectly calibrated trigger ignores the distance the system travels during the 176 ms solve. The confidence-trigger ablation, matched in escalation rate, should show violations concentrated exactly in the states that were entered during pending solves.
Why not just run the exact solver asynchronously at a lower rate all the time? This is the latency-honest version of the naive baseline, and we include it. It pays the full solver cost continuously, and it gives no guarantee between solves unless the same rate bound $c\,T_L$ is used. That rate bound is exactly the ingredient we are adding.
Proposed Experiments
We will run three systems, from simple to hard.
Kinematic lane-keeping car. This system comes from Approximate Predictive Control Barrier Functions using Neural Networks, which used 10.9 million synthetic training points. We reuse its neural filter and exact filter directly. Its low dimension also permits the independent interval-model verification of the full cascade.
Highway take-over (10-dimensional) and Crazyflie drone overtaking (12-dimensional), in simulation. Both come from Certifiable Reachability Learning. Here the exact tier is the cone-program certificate and the fast tier is a distilled network.
We record five metrics:
- constraint-violation count and depth under random disturbances and under adversarially optimized disturbances;
- mean and worst-case per-step compute;
- the fraction of steps that escalate;
- the size of filter interventions relative to the offline exact filter;
- task success.
We sweep $T_L$ by artificially delaying the solver, and sweep $\epsilon_h$ by training networks of different size.
There are three decisive checks.
- Under adversarial disturbances, the cascade with the latency-aware trigger records zero violations wherever the theory says it should. The $T_L = 0$ ablation and the confidence-trigger ablation should both record violations, which would show the latency term is necessary rather than decorative.
- At matched safety, the cascade is more permissive than the $\epsilon_h$-tightened filter. It should also escalate on a small enough fraction of steps that its mean cost stays near the neural filter's 3 ms rather than the solver's 176 ms.
- On the lane-keeping car, the interval-model verification of the closed-loop cascade agrees with the analytic invariance proof.
A failure of the third check would point to a gap in the switched-mode argument, most likely at the handback from the exact tier to the fast tier.
References
- Approximate Predictive Control Barrier Functions using Neural Networks: A Computationally Cheap and Permissive Safety Filter
- Gatekeeper: Improving Model Cascades Through Confidence Tuning
- Calibrated Deferral Routing for Cost-Efficient Guardrails
- Bridging Efficiency and Safety: Formal Verification of Neural Networks with Early Exits
- Certifiable Reachability Learning Using a New Lipschitz Continuous Value Function
- RouteLLM: Learning to Route LLMs from Preference Data
- C3PO: Optimized Large Language Model Cascades with Probabilistic Cost Constraints for Reasoning
- Control Barrier Functions for Unknown Nonlinear Systems using Gaussian Processes
- Formal Verification of Unknown Dynamical Systems via Gaussian Process Regression
- IntervalMDP.jl: Accelerated Value Iteration for Interval Markov Decision Processes
- Formal Abstraction of General Stochastic Systems via Noise Partitioning