A Policy Search Method For Temporal Logic Specified Reinforcement Learning Tasks

Xiao Li, Yao Ma, Călin Belta · DOI

Abstract

Reward engineering is an important aspect of reinforcement learning. Whether or not the user's intentions can be correctly encapsulated in the reward function can significantly impact the learning outcome. Current methods rely on manually crafted reward functions that often require parameter tuning to obtain the desired behavior. This operation can be expensive when exploration requires systems to interact with the physical world. In this paper, we explore the use of temporal logic (TL) to specify tasks in reinforcement learning. TL formula can be translated to a real-valued function that measures its level of satisfaction against a trajectory. We take advantage of this function and propose temporal logic policy search (TLPS), a model-free learning technique that finds a policy that satisfies the TL specification. A set of simulated experiments are conducted to evaluate the proposed approach.

Introduction

In standard Reinforcement Learning (RL), designers specify goals through a reward function. However, "reward engineering" is notoriously difficult. Simple functions, such as Euclidean distance to a goal, often fail to capture complex logical requirements—for example, "Visit Point A, then Point B, but never enter Zone C." Poorly designed rewards can lead to "reward hacking," where agents find unintended shortcuts that maximize scores without fulfilling the actual task. Furthermore, manually tuning weights for multi-objective rewards is time-consuming and expensive, especially in robotics. This paper addresses these challenges by using Temporal Logic (TL), a formal mathematical language, to define tasks precisely and automatically generate a reward signal.

Methodology

The proposed framework utilizes Truncated Linear Temporal Logic (TLTL), a variant designed for finite-time sequences. TLTL allows for "English-like" specifications to be mathematically mapped to a scalar value known as the "robustness degree" ($\\rho$). A positive $\\rho$ indicates task satisfaction, while a negative value provides a gradient indicating how close the agent was to success.

Robustness Smoothing

The robustness degree relies on non-differentiable min and max operators, which are incompatible with gradient-based optimization. To overcome this, the authors introduce a log-sum-exp approximation to create a differentiable version of the robustness function. This approximation is mathematically bounded, and its optimal points coincide with the original logic.

Temporal Logic Policy Search (TLPS)

TLPS is a model-free policy search method. In each iteration, the agent collects sample trajectories and solves a constrained optimization problem to find updated trajectories that improve smoothed robustness while remaining close to the original samples to respect physical dynamics. The policy, modeled as a time-varying linear Gaussian, is then updated using weighted maximum likelihood to match these improved trajectories.

Experimental Evaluation

The approach was evaluated using simulated 2D vehicle navigation environments with a 6D continuous state space and 2D action space. Two benchmarks were established:

  • Task 1 (Simple): Reach a goal while avoiding a circular obstacle.
  • Task 2 (Sequential): Visit three goals in a strict order (Goal 1 $\\rightarrow$ Goal 2 $\\rightarrow$ Goal 3) without revisiting previous goals and avoiding obstacles.

Results and Discussion

TLPS demonstrated significant advantages in complex sequential tasks. In Task 1, the policy converged in approximately 30 iterations. The more challenging Task 2 required about 50 iterations, where TLPS outperformed baseline methods like Relative Entropy Policy Search (REPS) in both convergence speed and final policy quality.

Trajectory evolution for Task 1 (left) and Task 2 (right) over 50 iterations.

The parameter $\\beta$ controls the smoothness of the reward function. A higher $\\beta$ increases accuracy relative to the original logic but makes the optimization landscape more "jagged." Conversely, a lower $\\beta$ provides a smoother gradient but is less precise.

Average robustness vs. iteration for Task 1 (left) and Task 2 (right) with varying smoothing parameters.

As shown in the results, a robustness value greater than zero provides a mathematical guarantee that the original specification was satisfied, eliminating the ambiguity often found in heuristic rewards.

Conclusion

TLPS offers a robust alternative to manual reward engineering by leveraging formal logic specifications. While the method is currently sensitive to initial conditions and does not explicitly model system physics during trajectory updates, it provides a clear path toward verifiable reinforcement learning. Future work will focus on more principled exploration strategies and improving hyperparameter robustness.

Summary updated

BibTeX
@inproceedings{li2018policy,
  author = {Xiao Li and Yao Ma and Călin Belta},
  title = {{A Policy Search Method For Temporal Logic Specified Reinforcement Learning Tasks}},
  booktitle = {ACC},
  year = {2018},
  doi = {10.23919/acc.2018.8431181},
}
Figure