Learning from Demonstrations using Signal Temporal Logic

Aniruddh Gopinath Puranic, Jyotirmoy Deshmukh, Stefanos Nikolaidis

Introduction

Teaching robots complex tasks typically relies on hand-coding reward functions or Learning from Demonstrations (LfD). However, LfD often struggles with imperfect or "noisy" human demonstrations, ambiguity in intent, and a lack of explicit safety guarantees. Furthermore, sequential tasks requiring a specific order of operations are notoriously difficult to capture with standard Markovian rewards. This paper proposes a framework that leverages Signal Temporal Logic (STL) to evaluate demonstration quality and infer robust, non-Markovian reward functions.

Methodology

The core of the proposed approach is the integration of formal logic into the reinforcement learning pipeline. As shown in Figure 1, the system takes STL specifications and human demonstrations as input to infer rewards, which then guide the robot's policy learning.

The proposed framework integrates STL specifications and demonstrations to infer rewards and train a robot policy via a verification loop.

STL-Guided Reward Inference

Instead of treating all demonstrations as equally valid, the framework uses STL to calculate a "robustness" score for each trajectory. This score provides a numerical measure of how well a demonstration satisfies a set of formal rules. These rules are organized into a Directed Acyclic Graph (DAG) to handle priorities, distinguishing between "hard" safety constraints and "soft" user preferences.

Requirements are organized into a Priority DAG, allowing the system to weight different STL specifications based on their importance.

The inferred rewards are non-Markovian, meaning they depend on the history of the robot's states rather than just the current one. This allows the robot to learn complex sequential behaviors. During training, a modified Q-learning algorithm ($Q_{stl}$) uses these rewards. If a "hard" safety rule is violated, the episode terminates immediately, ensuring safer and more efficient exploration.

Experimental Results

The framework was evaluated on grid-world environments and OpenAI Gym benchmarks, including FrozenLake and Mountain Car.

Data Efficiency and Sequential Tasks

In a 5x5 grid-world, the method successfully recovered the reward function using only 3 demonstrations (including one imperfect example). In contrast, Maximum Causal Entropy (MCE) IRL required 70 optimal demonstrations to achieve similar results. For multi-goal sequential tasks, the STL-based approach easily mastered the required order of operations, whereas MCE-IRL failed even with 300 demonstrations because it could not capture the temporal dependencies.

Safety in Exploration

In the FrozenLake environment, the $Q_{stl}$ algorithm significantly reduced the exploration space. By penalizing safety violations (falling into "holes") through the STL filter, the agent reached the goal faster and with fewer failures during the learning phase compared to standard Q-learning. The robustness signal from STL provides a "signed distance" that informs the agent not just of failure, but how close it was to succeeding.

Conclusion

By combining the intuitive nature of human demonstrations with the mathematical rigor of Signal Temporal Logic, this framework addresses key limitations in LfD. It provides a mechanism for quality control, enables learning from sparse data, and enforces safety constraints. Future work will focus on scaling these methods to high-dimensional continuous state spaces and handling environmental uncertainty in real-world deployments.

Summary updated

BibTeX
@inproceedings{puranic2020learning,
  author = {Aniruddh Gopinath Puranic and Jyotirmoy Deshmukh and Stefanos Nikolaidis},
  title = {{Learning from Demonstrations using Signal Temporal Logic}},
  booktitle = {Conference on Robot Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=h5TpCuXoSGC},
}
Figure