Instructing Goal-Conditioned Reinforcement Learning Agents with Temporal Logic Objectives

Wenjie Qiu, Wensen Mao, He Zhu

TL;DR

This paper introduces GCRL-LTL, a framework that allows reinforcement learning agents to follow complex, temporally extended instructions (like "Visit A, then B, while avoiding C") without ever seeing those instructions during training. By decoupling low-level navigation from high-level logic using Büchi automata and a learned "goal value function," the authors achieve zero-shot generalization to intricate, infinite-horizon tasks.

What Problem Does This Paper Address?

Standard Goal-Conditioned Reinforcement Learning (GCRL) is excellent at teaching agents to reach a specific state (e.g., "go to the red zone"). However, real-world tasks are rarely that simple. They often involve sequences, conditions, and safety constraints—properties formally described by Linear Temporal Logic (LTL).

Existing LTL-RL approaches usually try to learn these logical structures by sampling millions of different LTL formulas during training. This leads to two major issues:

  1. Poor Generalization: If the agent encounters a formula at test time that is longer or more complex than those in its training set, it often fails.
  2. Finite Horizons: Most current methods struggle with $\omega$-regular expressions—tasks that require infinite behavior, such as "oscillate between A and B forever."

The authors aim to bridge this gap: can we build an agent that learns basic skills once and then follows any arbitrary LTL instruction zero-shot?

Methods

The core philosophy of GCRL-LTL is decoupling. Instead of learning the logic and the movement simultaneously, the system splits them into a high-level planner and a low-level actor.

ZoneEnv and its corresponding Büchi Automaton for LTL instruction planning.
  1. Low-Level Goal-Conditioned Agent: The agent is trained simply to reach individual goals (e.g., "go to yellow," "go to white"). It doesn't know anything about LTL yet.
  2. The Goal Value Function ($V$): This is the "connective tissue" of the paper. The authors train a specific value function that estimates the "difficulty" or cost of transitioning between any two goals in the environment.
  3. Büchi Automaton Construction: When a new LTL instruction arrives, it is automatically converted into a Büchi Automaton—a state machine (graph) where "accepting" runs correspond to satisfying the LTL formula.
  4. Weighted Graph Search: The high-level planner treats the Büchi Automaton as a map. It uses the learned Goal Value Function to weight the edges of this graph. It then uses Dijkstra’s algorithm to find the "easiest" path (or cycle, for infinite tasks) to satisfy the formula.
  5. Reach-Avoid Control: To handle safety (e.g., "avoid red"), the authors implement a dynamic policy that monitors the value function. If the agent gets too "close" to a forbidden zone, it overrides the goal-seeking action with a safety maneuver.

Datasets

The authors evaluated their approach across three distinct environments:

Complex grid navigation task demonstrating the agent's path planning through a state machine.
  • ZoneEnv (Safety Gym): A continuous 2D plane where a point robot must navigate between colored zones while avoiding others.
  • LetterWorld: A $7 \times 7$ discrete grid containing various letters. This tests the agent's ability to handle long sequences of specific landmarks.
  • Ant-16rooms: A complex MuJoCo environment where a four-legged "Ant" must navigate a maze of 16 rooms connected by narrow doors, requiring precise control and long-term planning.

Key Insights and Ideas

  • Value Functions as Distance Metrics: The most elegant "aha moment" is using the RL value function not just for control, but as a cost estimator for a high-level graph search. This allows a discrete logical planner to understand the "physics" of the environment.
  • Zero-Shot is Possible via Decoupling: By not training on LTL formulas, the agent never overfits to a specific "distribution" of tasks. As long as it knows how to reach the individual components (the atomic propositions), the graph search handles the logical complexity.
  • Handling the Infinite: Because Büchi automata naturally represent infinite loops, GCRL-LTL can solve "stability" and "loop" tasks (e.g., "Visit A and B infinitely often") simply by finding the lowest-cost cycle in the graph.

Key Results

  • Outperforming the State-of-the-Art: In LetterWorld, GCRL-LTL achieved a 99.6% success rate on partially ordered tasks, while the baseline (LTL2Action) struggled at 66.1%.
  • Robustness to Complexity: When task depth was increased (Out-of-Distribution), GCRL-LTL maintained a 98.6% success rate, whereas the baseline plummeted to 47.7%.
  • Efficiency: In the Ant-16rooms environment, GCRL-LTL reached ~90% success across 8 complex tasks after 3 million environment steps. A leading compositional baseline (DiRL) required 3 million steps per task to achieve similar results.
  • $\omega$-Regular Success: The authors successfully demonstrated agents performing infinite loops between zones in ZoneEnv, a feat many standard RL agents cannot achieve without manual reward shaping.

Limitations and Future Work

  • Internal vs. External Signals: The current model assumes all "propositions" in the LTL formula are reachable goals. It cannot yet handle external environment signals (e.g., "If the light turns green, go to A").
  • Static Planning: The high-level path is currently found at the start of an episode. If the environment changes significantly, the agent might need a "task monitor" to replan dynamically.
  • Unsatisfiable Tasks: The authors noted that if a task is logically impossible (e.g., "be in two far-apart places at once"), the agent's behavior becomes erratic (oscillating between them) rather than identifying the task as impossible.

Future work suggests integrating a task monitor to act as an external memory, allowing the agent to respond to unpredictable environmental triggers while maintaining its logical objectives.

Summary updated

BibTeX
@inproceedings{qiu2023instructing,
  author = {Wenjie Qiu and Wensen Mao and He Zhu},
  title = {{Instructing Goal-Conditioned Reinforcement Learning Agents with Temporal Logic Objectives}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=19AgWnmyoV},
}
Figure