Compositional RL Agents That Follow Language Commands in Temporal Logic

Yen-Ling Kuo, Boris Katz, Andrei BarbuFrontiers Robotics AI 2021 · DOI

Introduction

Recent advancements in robotics and artificial intelligence have led to the development of reinforcement learning (RL) agents capable of executing complex, time-extended instructions. These instructions are specified using Linear Temporal Logic (LTL), a formal language that allows for the expression of intricate temporal constraints. The core innovation lies in a compositional neural network that mirrors the syntax tree of a command, enabling zero-shot generalization to never-before-seen instructions in both discrete and continuous environments.

The Challenge: Beyond Simple Goals

For robots to be truly integrated into human environments, they must understand more than simple point-to-point navigation. Human instructions often involve complex temporal dependencies, such as "pick up the red block, then the blue block, but never touch the green block while the tray is empty."

Standard RL agents typically struggle with this level of variety, often requiring extensive retraining for every new task. While LTL provides the necessary symbolic framework to express these constraints, bridging the gap between symbolic logic and the high-dimensional, "fuzzy" perceptual data processed by deep learning models remains a significant hurdle. This research addresses the need for agents that can follow any LTL command "out of the box" without additional training.

Compositional Neural Network Architecture

The proposed solution is a compositional recurrent neural network architecture that adapts its structure to the specific command it receives.

Overview of the LTL syntax tree (A), the Fetch environment (B), and the compositional network architecture (C).
  1. Syntax Tree Mapping: Every LTL formula is parsed into a syntax tree. Each node in this tree—representing operators (e.g., "Eventually" $\diamond$, "And" $\wedge$) or predicates (e.g., "Red Block")—is mapped to a specific recurrent sub-network, specifically a Gated Recurrent Unit (GRU).
  2. Modular Sub-networks: All formulas utilize a shared pool of these sub-networks. This modularity ensures that the "Eventually" sub-network functions consistently regardless of the specific goal it is paired with.
  3. Bidirectional Information Flow: Environmental features are processed by all sub-networks. Information flows bidirectionally: parent nodes pass state information to children, while children pass updated representations back up the tree. The root node ultimately determines the action distribution.
  4. Multi-Task Training: Agents are trained using Advantage Actor-Critic (A2C) for discrete tasks and Soft Actor-Critic (SAC) for continuous control. By training on thousands of formula combinations, the sub-networks learn to disentangle the semantics of logical operators from the environmental context.

Experimental Domains

The architecture was evaluated across three distinct benchmarks:

  • Symbol Domain: A benchmark for pure symbolic reasoning where agents must output letter sequences satisfying LTL formulas.
  • Craft Domain: A 2D grid world (similar to Minecraft) where agents collect and process resources based on temporal instructions.
  • Fetch Domain: A continuous 3D environment using a robotic arm to manipulate colored blocks, testing the model's applicability to real-world robotic control.

Key Results and Generalization

The compositional approach demonstrated remarkable zero-shot capabilities. In the Symbol domain, the agent achieved 98% in-domain accuracy and 90% zero-shot accuracy on new formulas. Notably, it maintained 42% accuracy on formulas twice as long as those seen during training, whereas traditional "flat" RNN models failed to generalize, dropping to near-zero accuracy.

In the Fetch domain, the agent achieved a 36% success rate on zero-shot tasks involving block manipulation. This represents a significant milestone for end-to-end LTL following in continuous control environments.

Limitations and Future Directions

While promising, the approach faces several challenges. Training is computationally intensive, requiring significant GPU time. Furthermore, in physical environments like Fetch, the agent lacks a mechanism to recover from "irreversible" errors, such as knocking a block out of reach.

Future work may focus on providing more granular feedback by leveraging the compositional structure to identify which specific sub-network failed. Additionally, expanding the framework to handle infinite time horizons or more complex logics like CTL* remains an open area of research.

Summary updated

BibTeX
@article{kuo2021compositional,
  author = {Yen-Ling Kuo and Boris Katz and Andrei Barbu},
  title = {{Compositional RL Agents That Follow Language Commands in Temporal Logic}},
  journal = {Frontiers Robotics AI},
  year = {2021},
  doi = {10.3389/frobt.2021.689550},
}
Figure