Shielded Reinforcement Learning Under Dynamic Temporal Logic Constraints

Serdar Yüksel, Ali Tevfik Büyükkoçak, Derya AksarayarXiv 2026 · DOI

Abstract

Reinforcement Learning (RL) has shown promise in various robotics applications, yet its deployment on real systems is still limited due to safety and operational constraints. The safe RL field has gained considerable attention in recent years, which focuses on imposing safety constraints throughout the learning process. However, real systems often require more complex constraints than just safety, such as periodic recharging or time-bounded visits to specific regions. Imposing such spatio-temporal tasks during learning still remains a challenge. Signal Temporal Logic (STL) is a formal language for specifying temporal properties of real-valued signals and provides a way to express such complex tasks. In this paper, we propose a framework that leverages sequential control barrier functions and model-free RL to ensure that the given STL tasks are satisfied throughout the learning process. Our method extends beyond traditional safety constraints by enforcing rich STL specifications, which can involve visits to dynamic targets with unknown trajectories. We also demonstrate the effectiveness of our framework through various simulations.

Introduction

Reinforcement Learning is powerful but notoriously "reckless" during its early exploration phase. In robotics, this isn't just a matter of low scores; it’s a matter of hardware failure. While "Safe RL" typically focuses on simple collision avoidance, real-world robots face more complex spatio-temporal constraints. For example, a surveillance drone doesn't just need to avoid walls; it must also return to a (potentially moving) charging dock every 10 minutes to avoid crashing.

Existing methods often struggle with these operational constraints because they only guarantee satisfaction after training, work primarily in discrete state spaces, or cannot handle dynamic targets with unknown future trajectories. If a robot violates these constraints during training (e.g., runs out of battery), the autonomous learning process is interrupted, requiring human intervention and defeating the purpose of autonomous RL.

Methodology

The authors propose a model-free RL framework that acts as a "shielded" controller. The core innovation lies in integrating Signal Temporal Logic (STL) with Sequential Control Barrier Functions (CBFs) to enforce hard constraints during the exploration phase.

The shielded RL architecture: the RL agent's action is filtered by a Sequential CBF block before interacting with the environment.

Core Components

  • Signal Temporal Logic (STL): A formal language used to define complex requirements like "Eventually visit Region A within 60 seconds and stay for 10 seconds, while visiting a charger every 90 seconds."
  • Sequential Control Barrier Functions (CBFs): CBFs are mathematical tools used to keep a system's state within a "safe" set. The authors use a sequential version that chains these sets together to satisfy a series of time-bounded STL tasks.
  • The Shield (Quadratic Programming): At every time step, the RL agent suggests an action ($u^{RL}$). This action is passed through a Quadratic Program (QP) filter. If the suggested action would lead to a constraint violation, the QP calculates the minimal possible correction ($u^{CBF}$) to keep the robot on track to satisfy its STL tasks.
  • Robustness to Uncertainty: The method assumes single integrator dynamics but accounts for unknown disturbances and moving targets. It uses "worst-case distance" calculations, requiring only the target's current position and maximum speed rather than its entire future path.

Experimental Evaluation

The researchers evaluated their framework using custom-built simulation environments designed to test periodic and dynamic constraints.

Simulation environments: (a) Periodic recharging with mobile stations on fixed paths; (b) Multi-target navigation with randomly moving targets.

Scenarios

  • Case 1 (Periodic Recharging): A robot must reach a goal while periodically visiting one of two mobile charging stations moving along fixed paths.
  • Case 2 (Multi-Target Navigation): A more complex scenario where the robot must visit two randomly moving targets within specific time windows, remain in them for a set duration, and still maintain a periodic charging schedule.

Results and Discussion

  • High Satisfaction Rates: In Case 1, the agent satisfied the complex STL constraints 99.56% of the time during the learning process. In the more difficult Case 2, it achieved a 95.2% satisfaction rate.
  • Effective Shielding: The learning curves demonstrate that while an unconstrained agent (e.g., standard SAC) might reach higher rewards, it does so by completely ignoring safety tasks. The shielded agent successfully learns to balance its primary goal with its operational requirements.
  • Graceful Degradation: By using "slack variables" in their Quadratic Program, the authors allow for "temporal relaxation." If physical limits make it impossible to meet a deadline perfectly, the system finds the solution that misses the deadline by the smallest possible margin rather than failing entirely.

Conclusion

This paper presents a robust framework for ensuring that RL agents satisfy complex, time-sensitive tasks throughout the learning process. By treating STL tasks as hard constraints, the system prevents the "learning-ending" failures common in standard RL. Future work will involve extending the framework to more complex robot dynamics, such as quadrotors, and refining reachability analysis to reduce conservatism, potentially allowing for more exploration time.

Summary updated

Abstract

Reinforcement Learning (RL) has shown promise in various robotics applications, yet its deployment on real systems is still limited due to safety and operational constraints. The safe RL field has gained considerable attention in recent years, which focuses on imposing safety constraints throughout the learning process. However, real systems often require more complex constraints than just safety, such as periodic recharging or time-bounded visits to specific regions. Imposing such spatio-temporal tasks during learning still remains a challenge. Signal Temporal Logic (STL) is a formal language for specifying temporal properties of real-valued signals and provides a way to express such complex tasks. In this paper, we propose a framework that leverages sequential control barrier functions and model-free RL to ensure that the given STL tasks are satisfied throughout the learning process. Our method extends beyond traditional safety constraints by enforcing rich STL specifications, which can involve visits to dynamic targets with unknown trajectories. We also demonstrate the effectiveness of our framework through various simulations.
BibTeX
@misc{yuksel2026shielded,
  author = {Serdar Yüksel and Ali Tevfik Büyükkoçak and Derya Aksaray},
  title = {{Shielded Reinforcement Learning Under Dynamic Temporal Logic Constraints}},
  year = {2026},
  eprint = {2603.17152},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.17152},
}
Figure