Abstract
Ensuring that autonomous systems satisfy complex, time-sensitive requirements remains a significant challenge in robotics. While Reinforcement Learning (RL) offers a powerful framework for training controllers, it often lacks formal guarantees and can lead to unsafe behaviors during the learning process. This paper presents BarrierNet, a neural network architecture that integrates a differentiable Quadratic Program (QP) layer to enforce Signal Temporal Logic (STL) specifications. By mapping STL formulas to High Order Control Barrier Functions (HOCBFs), the proposed framework ensures that system trajectories remain safe and correct both during training and deployment. Evaluation in a 2D navigation task demonstrates that BarrierNet achieves immediate mission satisfaction and superior robustness compared to standard neural network controllers.
Introduction
In modern autonomous systems, mission requirements are often complex and multi-stage, such as "visit Region A within 10 seconds, then stay in Region B for 5 minutes, while always avoiding obstacles." Signal Temporal Logic (STL) provides a formal mathematical language to describe these requirements. However, translating these specifications into reliable control policies is difficult.
Standard Reinforcement Learning (RL) approaches treat the controller as a "black box," which may fail in novel environments or violate critical safety constraints during the "trial and error" phase of training. Conversely, traditional formal methods like Mixed Integer Programming provide safety guarantees but are often computationally prohibitive for real-time applications. This paper introduces BarrierNet to bridge this gap, providing a fast, learnable controller that is mathematically guaranteed to be correct from the very first iteration of training.
Methodology
STL to HOCBF Mapping
The core of the approach involves translating STL formulas—which include temporal operators like "eventually" and "always"—into mathematical constraints known as High Order Control Barrier Functions (HOCBFs). These functions define "safe sets" or "fences" in the system's state space. If the system remains within these sets, the underlying STL specification is guaranteed to be satisfied.
The BarrierNet Architecture
BarrierNet is a differentiable layer implemented as a Quadratic Program (QP) that serves as the final stage of the neural network controller. It functions as a safety filter: it receives a "desired" control signal from a standard neural network and, if that signal would lead to a violation of the HOCBF constraints, it minimally adjusts the signal to ensure compliance. Because the QP is differentiable, the entire architecture can be trained end-to-end using gradient-based optimization.
Trainable Barriers and InitNet
One common drawback of barrier-based methods is that they can be overly conservative, leading to inefficient or awkward movement. To address this, the authors make the parameters of the barrier functions trainable. An auxiliary network, called InitNet, sets these parameters based on the system's initial conditions. This allows the controller to learn the "tightest" possible safety margins necessary to complete the mission, improving overall performance.
Model-Based RL Training
The system is trained using model-based RL to maximize a "robustness" metric, which quantifies how well the STL specification is satisfied. Because the BarrierNet layer enforces constraints at every step, the system "fails safe" even when the primary neural network is still untrained, allowing for safe exploration and learning.
Experimental Evaluation
The framework was evaluated using a 2D Robot Navigation Simulation. The environment consisted of a starting region, two goal regions (Reg1 and Reg2), and two super-elliptical obstacles (Obs1 and Obs2). The robot was tasked with visiting Reg1 within a specific time window and then proceeding to Reg2, all while avoiding obstacles at all times.
Trajectories were generated using the robot's known dynamics, with initial conditions randomly sampled from a starting set. The performance of BarrierNet was compared against a standard Fully Connected Network (FCNet) and a non-learning HOCBF approach.
Results and Discussion
Immediate Satisfaction and Robustness
One of the most significant findings was that BarrierNet achieved a positive robustness score—indicating successful mission completion—from the very first iteration of training. In contrast, the standard FCNet required approximately 150 iterations to reach a similar level of success. Furthermore, after training, BarrierNet achieved a higher final robustness score than the FCNet, suggesting that it not only satisfies the rules but does so with a larger margin of safety.
Real-Time Performance
By utilizing a Quadratic Program as the underlying optimization mechanism, the BarrierNet controller remains computationally efficient. This efficiency makes it suitable for high-frequency, real-time robotic control, addressing the latency issues often associated with formal verification methods.
Limitations and Future Work
While BarrierNet represents a significant step forward, several limitations remain. The current framework only supports a specific fragment of STL and cannot yet handle nested temporal operators (e.g., "eventually always"). Additionally, the method assumes that the system's dynamics are perfectly known; future research could explore learning these dynamics alongside the controller. Finally, the authors noted that solving the QP at discrete time steps can lead to minor "inter-sampling" violations, suggesting that an event-triggered framework might be necessary for absolute continuous-time guarantees.
Conclusion
BarrierNet provides a robust framework for learning controllers that are guaranteed to satisfy complex Signal Temporal Logic specifications. By embedding a differentiable safety layer directly into the neural network architecture, the authors have created a system that is both learnable and formally correct, offering a promising path toward safer and more reliable autonomous systems.
Summary updated