Policy Optimization with Linear Temporal Logic Constraints

Cameron Voloshin, Hoang Minh Le, Swarat Chaudhuri, Yisong Yue

TL;DR

This paper introduces a model-based reinforcement learning framework that optimizes policies subject to complex, logic-based constraints defined by Linear Temporal Logic (LTL). By reducing the problem to a reachability analysis and leveraging a generative model, the authors provide an algorithm—LTL Constrained Planning (LCP)—that guarantees both task satisfaction and cost optimality. LCP provides rigorous sample complexity bounds and empirically outperforms existing heuristics and standard "reward shaping" methods.

What Problem Does This Paper Address?

Standard Reinforcement Learning (RL) relies heavily on the "reward hypothesis"—the assumption that any task can be captured by a scalar cost or reward function. However, real-world specifications are often far more nuanced.

Consider a robot that must "perpetually visit the coffee room and the office" (a liveness property) while "never entering a hazardous zone" (a safety property).

A grid world illustrating a liveness property: perpetually visiting the coffee room and the office.

Encoding these multi-faceted requirements into a single scalar reward is notoriously difficult. It frequently leads to "reward hacking," where an agent finds a loophole in the cost function to achieve a high score without actually performing the intended task. Furthermore, some tasks are mathematically impossible to represent as simple Markovian rewards because they require memory of past events.

While prior work has explored using Linear Temporal Logic (LTL) to specify these constraints, existing methods often rely on restrictive assumptions (like known mixing times or specific discount factors) or lack formal guarantees. This paper seeks a systematic way to decouple task specification (what to do) from policy selection (how to do it efficiently) while providing provable, theoretical guarantees.

Methods: LTL Constrained Planning (LCP)

The authors propose a model-based approach that utilizes a generative model (a simulator) of the environment. The LCP method follows three main steps:

  1. Synchronization via Product MDP: The environment's standard Markov Decision Process (MDP) is combined with a Limit Deterministic Büchi Automaton (LDBA) that mathematically represents the LTL formula. This creates a "Product MDP" where the state space is augmented to track the progress of the logical formula, effectively giving the agent the memory required for complex tasks.
  2. Identifying Accepting Maximal End Components (AMECs): The algorithm identifies sets of states where the agent can stay indefinitely while satisfying the LTL condition. Essentially, these are the "goal regions" where the logic is perpetually satisfied.
  3. Two-Stage Optimization:
    • PlanRecurrent (PR): Within the AMECs, the algorithm finds a policy that minimizes the "gain" (average cost) while ensuring the agent visits "accepting" states infinitely often.
  4. PlanTransient (PT): The algorithm then solves a Stochastic Shortest Path (SSP) problem to find the most cost-effective way to reach these AMECs from the starting state.
Abstract diagram of the Product MDP, illustrating transitions into Accepting Maximal End Components (AMECs).

A key technical contribution is the use of an optimistic Bellman operator and a known lower bound ($\beta$) on non-zero transition probabilities. This allows the algorithm to circumvent previous theoretical "unlearnability" results for LTL-RL.

Key Insights and Ideas

  • Decoupling Specification from Cost: By using LTL for constraints, the cost function (e.g., energy used, time taken) can be kept simple and interpretable. The complex logic is handled entirely by the LTL framework.
  • The Necessity of $\beta$: The paper highlights that without a known lower bound on transition probabilities ($\beta$), it is impossible to distinguish between a very rare transition and one that is logically impossible. This bound is crucial for making LTL satisfaction verifiable.
  • Automatic State Augmentation: LTL-based methods automatically provide the "memory" needed for history-dependent tasks. In the "coffee and office" loop, the automaton state tells the agent whether it has already visited the coffee room, a detail a standard Markovian agent would forget.
  • Reduction to Reachability: Treating LTL satisfaction as a reachability problem (reaching and staying in AMECs) allows the authors to apply well-understood tools from Stochastic Shortest Path theory to a much more complex logical setting.

Key Results

  • Sample Complexity: The paper provides a PAC (Probably Approximately Correct) bound, detailing the number of samples required to reach an $\epsilon$-optimal policy.
  • Empirical Efficiency: In a Pacman domain (an infinite-horizon task requiring the agent to collect food and avoid a ghost), the theoretical bound suggested ~350 samples per state-action pair. Remarkably, LCP found a near-perfect policy with only 11 samples per pair.
  • Superior Satisfaction: LCP reached a 1.0 probability of satisfying the LTL specification significantly faster than Logically Constrained RL (LCRL). In a Discretized Mountain Car task, standard LCRL failed to learn entirely, while LCP succeeded without any manual "reward breadcrumbs."
  • Robustness: Unlike cost-shaping, which can lead to unanticipated edge-case failures, LCP maintains strict, mathematical adherence to the logical constraints.

Limitations and Future Work

While highly effective, the current framework is designed for finite state and action spaces (tabular focus). Although demonstrated on a discretized continuous environment, it does not yet natively support high-dimensional continuous spaces. Additionally, the algorithm assumes access to a generative model (simulator), which isn't always available in pure "in-the-wild" RL.

Finally, the theoretical sample complexity bounds are much more conservative than what is observed in practice, suggesting room for tighter analytical work. Future directions include extending the work to use function approximation (like Neural Networks) to handle continuous state spaces and exploring model-free variants that maintain similar strict guarantees.

Summary updated

BibTeX
@inproceedings{voloshin2022policy,
  author = {Cameron Voloshin and Hoang Minh Le and Swarat Chaudhuri and Yisong Yue},
  title = {{Policy Optimization with Linear Temporal Logic Constraints}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=yZcPRIZEwOG},
}
Figure