Skip to main content
QUICK REVIEW

[Paper Review] A Composable Specification Language for Reinforcement Learning Tasks

Kishor Jothimurugan, Rajeev Alur|arXiv (Cornell University)|Aug 21, 2020
Formal Methods in VerificationComputer Science21 citations
TL;DR

This paper proposes a composable specification language for defining complex reinforcement learning (RL) tasks using high-level logical predicates, compiling them into shaped reward functions and extended state spaces via a task monitor. The approach enables efficient learning of optimal policies for non-Markovian tasks, with Spectrl achieving over 97% success rate on benchmarks and outperforming state-of-the-art baselines including TLTL and CCE.

ABSTRACT

Reinforcement learning is a promising approach for learning control policies for robot tasks. However, specifying complex tasks (e.g., with multiple objectives and safety constraints) can be challenging, since the user must design a reward function that encodes the entire task. Furthermore, the user often needs to manually shape the reward to ensure convergence of the learning algorithm. We propose a language for specifying complex control tasks, along with an algorithm that compiles specifications in our language into a reward function and automatically performs reward shaping. We implement our approach in a tool called SPECTRL, and show that it outperforms several state-of-the-art baselines.

Motivation & Objective

  • To address the challenge of manually designing sparse and fragile reward functions for complex RL tasks with multiple objectives and constraints.
  • To enable users to specify tasks using intuitive, composable logical predicates without low-level action sequences.
  • To automatically generate a reward function with partial credit for intermediate progress and memory-aware state extensions for non-Markovian tasks.
  • To outperform existing RL baselines in sample efficiency and success rate on complex, sequenced tasks with safety constraints.
  • To provide a compiler-like pipeline that transforms high-level task specifications into trainable RL problems.

Proposed method

  • The method uses a domain-specific language to express tasks as sequences of achieve and ensure statements over state predicates (e.g., reach, avoid, fuel > 0).
  • A task monitor (finite automaton) is automatically synthesized from the specification to track subtask progress and maintain memory across states.
  • The monitor state is extended into the agent’s observation space, enabling the policy to reason about task progress.
  • Reward shaping is applied by assigning partial credit for completing intermediate subtasks and progressing through the specification sequence.
  • The reward function is compiled such that for deterministic MDPs, optimal policies are preserved; empirical results show effectiveness in stochastic settings.
  • The approach integrates with standard RL algorithms (e.g., ARS) by generating a shaped reward function and extended state space.

Experimental results

Research questions

  • RQ1Can a high-level, composable specification language improve the specification and learning of complex RL tasks with multiple objectives and constraints?
  • RQ2How can reward shaping be systematically derived from task structure to improve sample efficiency and convergence?
  • RQ3Can a task monitor be automatically generated to handle non-Markovian specifications and enable memory-aware control policies?
  • RQ4Does automatic compilation of specifications into shaped rewards outperform direct use of specification semantics as rewards?
  • RQ5How does the method scale with increasing specification complexity, especially in deeply nested sequencing structures?

Key findings

  • Spectrl achieved a success rate of at least 97% on all tasks in the benchmark suite, outperforming state-of-the-art baselines including TLTL and CCE.
  • Without reward shaping, Spectrl failed to learn policies unless random sampling accidentally reached the final monitor state, demonstrating the necessity of shaping.
  • For tasks requiring memory (e.g., $φ_5$, $φ_6$, $φ_7$), Spectrl significantly outperformed CCE and TLTL, which rely on single-state policies and fail on non-Markovian tasks.
  • Spectrl scaled well with specification size, showing low sample complexity growth even with up to 7 nested sequencing operators.
  • In the cart-pole environment, Spectrl learned the task faster than TLTL and outperformed CCE, which failed to learn a valid policy.
  • The method demonstrated robustness to multiple constraints (e.g., obstacle avoidance and fuel maintenance), where CCE’s performance degraded significantly.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.