A Policy Search Method For Temporal Logic Specified Reinforcement Learning Tasks

Xiao Li, Yao Ma, Calin Belta

TL;DR

This paper introduces Temporal Logic Policy Search (TLPS), a framework that replaces manual "reward engineering" with formal task specifications. By translating Truncated Linear Temporal Logic (TLTL) into a smooth, differentiable reward function, the authors enable reinforcement learning agents to master complex, multi-step sequences that are traditionally difficult to tune by hand.

What Problem Does This Paper Address?

In standard Reinforcement Learning (RL), designers specify goals through a reward function. However, "reward engineering" is notoriously difficult. Simple functions (like distance to a goal) often fail to capture complex logical requirements, such as "Visit Point A, then Point B, but never enter Zone C."

When rewards are poorly designed, agents may engage in reward hacking—finding unintended shortcuts that maximize the score without actually completing the task. Furthermore, manually tuning the weights of different reward components is time-consuming and expensive, especially in robotics. The authors address this by using Temporal Logic (TL), a formal mathematical language, to define tasks precisely and automatically generate a reward signal.

Methods

The authors utilize Truncated Linear Temporal Logic (TLTL), a variant of logic designed for finite-time sequences (trajectories).

The core technical challenge is that the "robustness degree" (a measure of how well a trajectory satisfies a logic formula) relies on min and max operators. These are non-differentiable, making them incompatible with efficient gradient-based optimization. To solve this, the authors introduce:

  1. Robustness Smoothing: They use a log-sum-exp approximation to create a differentiable version of the robustness function. They provide mathematical proofs (Lemmas 1-3) showing that this approximation is bounded and, crucially, that its optimal points coincide with the original logic.
  2. TLPS Algorithm: A model-free policy search method. At each iteration:
  3. The agent collects sample trajectories.
  4. It solves a constrained optimization problem to find "updated" trajectories that improve the smoothed robustness while staying close to the original samples (to respect physical dynamics).
  5. The policy (modeled as a time-varying linear Gaussian) is updated using weighted maximum likelihood to match these improved trajectories.

Datasets

The paper evaluates the approach using simulated 2D Vehicle Navigation environments. Rather than static datasets, the "data" consists of trajectories generated by a vehicle with 6-dimensional continuous state space (position, heading, velocity) and 2-dimensional action space (speed, steering).

Two specific benchmarks were used:

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

Key Insights and Ideas

  • Logic as a Reward Language: Temporal logic allows for "English-like" specifications (e.g., "eventually reach $g$ and always avoid $o$") to be mathematically mapped to a scalar value.
  • Beyond Binary Success: The robustness degree $\rho$ isn't just a "pass/fail" bit. It provides a "margin of satisfaction." A positive value means the task was achieved (and tells you how safely), while a negative value tells the agent how close it was to succeeding, providing a rich gradient for learning.
  • The Smoothing Trade-off: The parameter $\beta$ controls the smoothness. A higher $\beta$ makes the reward more accurate to the logic but harder to optimize (more "jagged"), while a lower $\beta$ is easier to follow but less precise.

Key Results

  • Superiority in Complex Tasks: For the simple navigation task, TLPS performed comparably to baseline methods like Relative Entropy Policy Search (REPS). However, for the complex sequential task (Task 2), TLPS showed a clear advantage in both convergence speed and the final quality of the learned policy.
  • Convergence Speed: In Task 1, the trajectory distribution converged to satisfy the logic specification in roughly 30 iterations. The harder Task 2 required about 50 iterations.
  • Semantic Integrity: Because the reward is derived directly from logic, a robustness value $> 0$ provides a mathematical guarantee that the user's original specification was satisfied, eliminating the ambiguity of heuristic rewards.

Limitations and Future Work

  • Local Optima: TLPS is a local policy search method. Like many such methods, it is sensitive to initial conditions and requires a reasonable starting policy to explore effectively.
  • Dynamics Blindness: The trajectory update step (Equation 6) does not explicitly model the system's physics; it relies on a "closeness" constraint to ensure the suggested path is physically reachable. If the learning rate is too high, the agent might try to follow a path the robot's motors can't actually execute.
  • Future Directions: The authors suggest developing more principled exploration strategies and making the algorithm more robust to hyperparameter changes (like the smoothing factor $\beta$).

Summary updated

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