TL;DR
This paper introduces a "safe-by-construction" neural network controller design that embeds Control Barrier Functions (CBFs) directly into the network as a differentiable layer. By doing so, the controller learns to optimize long-term performance while strictly satisfying safety constraints during training, avoiding the shortsighted performance degradation typical of traditional post-hoc safety filters.
What Problem Does This Paper Address?
Neural networks (NNs) are highly effective at learning complex control policies from data, but their black-box nature makes them risky for safety-critical systems like autonomous driving or robotics because they lack formal safety guarantees.
To fix this, researchers often use Control Barrier Functions (CBFs) as an online safety filter (typically solved as a Quadratic Program, or CBF-QP) to override unsafe NN actions at the last millisecond. However, this creates a major issue: the safety filter operates myopically (shortsightedly), unaware of the long-term consequences of its modifications. Because the NN is trained without knowing it will be filtered, the combined system often suffers from poor long-term performance or erratic behavior when the filter repeatedly intervenes.
Methods
The authors propose moving the safety filter inside the neural network training loop by designing differentiable safety layers. This allows end-to-end optimization via gradient descent (such as Adam), meaning the NN learns to maximize performance while being fully aware of its safety boundaries.
The paper compares two main safe-by-construction architectures:
- NN-diff-QP: A baseline approach where the NN output passes through a differentiable Quadratic Program layer that projects unsafe actions onto the safe control set.
- NN-gauge (Proposed): A novel architecture that leverages a geometric concept called a gauge map. Since the safe control set defined by a CBF forms a polytope, the gauge map establishes a mathematical bijection (a perfect one-to-one mapping) between a simple bounded space (the unit $\ell_\infty$-norm ball outputted by a standard $\tanh$ activation function) and the complex polytopic safe control set. To center the safe set around the origin for the gauge map, they implicitly calculate an interior safe policy using the Chebyshev center via a Linear Program (LP).
Datasets
Not discussed in the paper. The authors evaluate their methods using simulated physical environments (dynamical system models) rather than static datasets.
Key Insights and Ideas
- End-to-End Safety Awareness: The core "aha moment" is that safety shouldn't be an afterthought. By making the safety filter differentiable, the network's gradients carry information about the safety boundaries, forcing the network to proactively learn safe trajectories rather than constantly bumping into a hard safety filter.
- QP vs. LP Complexity: While
NN-diff-QPprovides good performance, solving a differentiable QP layer is computationally heavy during training.NN-gaugecircumvents this by using a Linear Program (LP) to find the Chebyshev center, making both training and online execution significantly faster and cheaper.
Key Results
The methods were tested on two classic benchmarks: Adaptive Cruise Control (ACC) and Aircraft Collision Avoidance.
- Adaptive Cruise Control: Standard unconstrained NNs violated safety constraints. Applying a traditional post-hoc filter (
NN-QP) kept the car safe but severely degraded performance (trajectory cost of 818.2). In contrast, the end-to-end trainedNN-gauge(cost: 270.9) andNN-diff-QP(cost: 258.3) achieved performance comparable to Model Predictive Control (MPC, cost: 269.3) but with much faster online solve times (0.28s and 0.35s vs. 3.11s for MPC). - Computational Efficiency:
NN-gaugereduced training time per epoch compared toNN-diff-QP(8.3s vs 11.0s in ACC; 101.5s vs 133.0s in aircraft avoidance) and achieved faster online evaluation due to its simpler LP formulation.
Limitations and Future Work
- Dependence on a Valid CBF: The proposed method assumes that a valid Control Barrier Function is already known and provided. Synthesizing valid CBFs for highly complex, non-linear systems remains a difficult challenge on its own.
- Scalability to High-Dimensional Control: While the LP approach in
NN-gaugeis faster than a QP, solving optimization problems inside the neural network loop still introduces a computational bottleneck compared to standard unconstrained NNs as the number of states and constraints scales up.
Summary updated