Source-linked AI summary

Reinforcement Learning With Temporal Logic Rewards

Xiao Li, Cristian-Ioan Vasile, Calin Belta

arXiv:1612.03471v2cs.AIcs.RO

TL;DR

The paper tackles the difficulty of designing rewards for robotic tasks with complex temporal and logical structure. It proposes TLTL and uses its robustness degree as a reward for reinforcement learning, with simulations and a toast-placing demonstration reporting faster learning and stronger task satisfaction than heuristic rewards.

  • Problem

    Reward functions are often handcrafted heuristics, but complex robotic tasks require specifications with richer temporal and logical structure.

  • Method

    The paper uses TLTL to specify finite-trajectory tasks and converts each formula’s quantitative robustness degree into a real-valued reinforcement-learning reward.

  • Results

    Temporal-logic robustness rewards produced better learning outcomes than comparison rewards, including 100% success in 10 toast-placing trials while the comparison reward failed to learn the task.

  • Takeaways & Limitations

    TLTL robustness rewards enabled a relatively simple non-hierarchical reinforcement-learning method to learn a temporally structured task.

Abstract

from arXiv · show

Reinforcement learning (RL) depends critically on the choice of reward functions used to capture the de- sired behavior and constraints of a robot. Usually, these are handcrafted by a expert designer and represent heuristics for relatively simple tasks. Real world applications typically involve more complex tasks with rich temporal and logical structure. In this paper we take advantage of the expressive power of temporal logic (TL) to specify complex rules the robot should follow, and incorporate domain knowledge into learning. We propose Truncated Linear Temporal Logic (TLTL) as specifications language, that is arguably well suited for the robotics applications, together with quantitative semantics, i.e., robustness degree. We propose a RL approach to learn tasks expressed as TLTL formulae that uses their associated robustness degree as reward functions, instead of the manually crafted heuristics trying to capture the same specifications. We show in simulated trials that learning is faster and policies obtained using the proposed approach outperform the ones learned using heuristic rewards in terms of the robustness degree, i.e., how well the tasks are satisfied. Furthermore, we demonstrate the proposed RL approach in a toast-placing task learned by a Baxter robot.

I. INTRODUCTION

The paper addresses reward-design challenges in complex robotic tasks by using temporal logic to encode specifications and convert their robustness into learning rewards. Experiments compare temporal-logic and heuristic rewards, reporting faster learning and better policy quality for the proposed approach.

  • Motivation: Complex real-world robotic tasks require rewards that capture temporal structure, domain knowledge, and behavioral constraints beyond simple reach-avoid objectives.Handcrafted extrinsic rewards can require many trials and may fail to represent desired and hazardous behaviors accurately.
  • Approach: TLTL captures designer requirements with temporal-logic specifications over finite trajectories and provides quantitative semantics called robustness degree.The robustness degree transforms temporal-logic formulas into real-valued reward functions.
  • Evaluation: The study compares convergence rate and learned-policy quality for temporal-logic robustness rewards against heuristic reward functions.It also compares a simple temporal-logic algorithm with a more elaborate reinforcement-learning algorithm using heuristic rewards.
  • Results: Better-quality policies were learned faster with temporal-logic rewards than with heuristic reward functions in the reported comparisons.The paper demonstrates the framework on a temporally structured toast-placing task learned by a Baxter robot.

A. Policy Search in Reinforcement Learning

Policy search learns robotic controllers by optimizing parameters of a stochastic policy in continuous state and action spaces. The paper adopts REPS as its policy-search technique.

  • Policy search: Policy search methods optimize parameterized policies for Markov decision processes with continuous state and action spaces.This setting is particularly suited to finding robotic controllers.
  • Problem formulation: An infinite MDP consists of continuous states and actions, a transition probability function, and a trajectory-based reward over a finite horizon.The transition function maps a state-action pair to probabilities over next states.
  • Problem formulation: Reinforcement learning seeks a stochastic policy that maximizes expected accumulated reward while the transition function remains unknown to the agent.The reward may be designed or learned, including through inverse reinforcement learning.
  • Policy parameterization: The policy is represented by a parameterized model, and search is conducted in its parameter space to find suitable model parameters.The paper denotes the parameterized policy by πθ, where θ contains the model parameters.
  • Chosen method: The paper adopts Relative Entropy Policy Search, an information-theoretic method for solving the policy-search problem.A brief overview of REPS is provided before the subsequent method description.

B. Relative Entropy Policy Search

REPS constrains policy updates so the new trajectory distribution remains close to sampled trajectories while optimizing performance. The paper combines this policy-search framework with trajectory-level temporal-logic rewards.

  • REPS formulation: Episode-based REPS formulates policy search as a constrained optimization problem using a relative-entropy constraint.The constraint limits the size of each policy update.
  • REPS formulation: The KL-divergence threshold keeps the updated trajectory distribution near sampled trajectories, promoting exploration safety and helping avoid premature convergence.These properties are especially relevant in robotic applications.
  • REPS update: The constrained optimization problem can be solved with Lagrange multipliers to obtain a closed-form trajectory-distribution update.The update is then estimated at sampled trajectory points because only sample trajectories are available.
  • Implementation: The implementation uses time-varying linear-Gaussian policies and weighted maximum-likelihood estimation, with feedback gains held fixed to reduce parameter dimensionality.Because temporal-logic rewards depend on entire trajectories, they are evaluated as terminal rewards rather than cost-to-go values.

III. TRUNCATED LINEAR TEMPORAL LOGIC(TLTL)

The paper proposes TLTL as a temporal logic for specifying robotic goals and domain knowledge in reinforcement learning. TLTL is defined over finite state sequences and supports quantitative satisfaction semantics.

  • TLTL motivation: TLTL is introduced as a temporal logic intended for specifying goals and incorporating domain knowledge into reinforcement learning.Its definitions use real and integer number sets and bounded integer intervals.
  • Design goals: TLTL is designed around predicates, continuous satisfaction measures, finite variable-length trajectories, and optionally bounded temporal operators.These characteristics target convenient specification of reinforcement-learning tasks.
  • Syntax and semantics: TLTL formulas use predicates and Boolean or temporal operators, including eventually, always, until, then, and next.Formulas are evaluated over finite-time sequences of robot states generated by an MDP.

A. TLTL Syntax And Semantics

TLTL specifies robot tasks with state predicates and temporal operators over finite trajectories, while robustness degree provides a real-valued measure of specification satisfaction.

  • Syntax: TLTL formulas use state predicates f(s) < c combined with Boolean and temporal operators.The operators include eventually, always, until, then, next, and implication.
  • Semantics: TLTL formulas are evaluated over finite state trajectories, including trajectories of variable length.A trajectory of duration k satisfies φ when s0:k |= φ.
  • Temporal operators: The always, eventually, until, and then operators quantify when subtrajectories satisfy their component specifications.Always requires satisfaction across every relevant subtrajectory, whereas eventually and then require satisfaction at least once; until additionally constrains the preceding formula.
  • Quantitative semantics: Robustness degree ρ(st:t+k, φ) is a real-valued measure of how far a trajectory is from satisfying or violating φ.It supplies quantitative semantics for TLTL specifications.
  • Quantitative semantics: Positive robustness implies satisfaction, while negative robustness implies violation, allowing robustness to substitute for Boolean semantics.In the example φ = ♦(s < 10), the trajectory [11, 5] has robustness 5, representing its satisfaction margin.

B. Comparison With Existing Formal Languages

The paper motivates TLTL by requiring a formal language that supports quantitative rewards, finite variable-length trajectories, state predicates, and optional time bounds. TLTL is designed to meet these requirements more directly than the compared alternatives.

  • Design requirements: A formal RL specification language should provide state predicates, continuous satisfaction measures, finite variable-length evaluation, and optional temporal time bounds.These requirements support per-step evaluation on currently available trajectory data.
  • Reward construction: Quantitative semantics are needed to transform formal specifications into real-valued reward functions for reinforcement learning.This transformation is central to using a formal language as an RL reward.
  • Comparison with STL: STL uses infinite real-valued signals and requires a time bound for every temporal operator, which can create problems for robotic task specification.The paper gives learning to place a beer in a fridge as an example where the robot needs to learn a finite sequence of operations.
  • Comparison with alternatives: BLTL and LTLf support finite sequences but require time bounds and use atomic propositions without quantitative semantics.These properties limit their fit with the stated design requirements.
  • TLTL design: TLTL combines state predicates, finite trajectories of any length, optional time bounds, and operators for goals, constraints, sequences, and decisions.The paper states that these components can cover a wide range of robotic-task specifications.

IV. RELATED WORK

Prior work combines reward shaping or temporal logic with reinforcement learning, but the cited approaches are largely limited to discrete settings or restricted temporal operators. The paper positions its contribution as applying temporal logic RL to continuous robotic control.

  • Reward design: Potential-based reward shaping adds training rewards while preserving the original problem’s optimal policy.Inverse reinforcement learning instead seeks reward functions from observed optimal behavior.
  • Temporal-logic RL: Recent temporal-logic RL work adapted STL robustness to Q-learning on τ-MDPs in discrete spaces.This represents one route for combining quantitative temporal specifications with learning.
  • Temporal-logic RL: Automata-based methods have synthesized policies satisfying LTL specifications for MDPs with unknown transition probabilities.The cited methods target LTL satisfaction in MDP settings.
  • Positioning: The paper states that existing methods are constrained to discrete state and action spaces and a limited set of temporal operators.It presents its work as the first application of temporal logic RL to continuous state and action spaces, supported by experiments.

V. EXPERIMENTS

The experiments compare TLTL-based rewards with discrete and distance-based continuous rewards in simulated manipulation tasks, then apply TLTL to a Baxter toast-placing task.

  • Simulated tasks: Two simulated manipulation tasks compare TLTL rewards with discrete rewards and distance-based continuous rewards.The comparison evaluates alternative reward designs used in reinforcement learning.
  • Robot demonstration: A Baxter robot learns a toast-placing task specified in TLTL.The task combines learning a reaching policy with a gripper-timing policy.

A. Simulated 2D Manipulation Tasks

Simulated 2D manipulation experiments compare TLTL robustness rewards with discrete and distance-based continuous heuristics on single-goal and sequential-goal tasks. TLTL rewards achieved the best convergence and final return, especially for the temporally structured task.

  • Task setup: The simulator uses a three-joint manipulator with an 8-dimensional state and 3-dimensional velocity action space, with Gaussian command noise.States include joint angles, joint velocities, and end-effector position.
  • Task setup: Task 1 requires reaching a goal while avoiding two obstacles, whereas Task 2 requires visiting three goals in sequence while avoiding obstacles.Task 2 additionally records visited goals to identify the next required goal.
  • TLTL specifications: TLTL specifications encode goal ordering, non-revisitation, and obstacle avoidance using temporal predicates over finite trajectories.The sequential specification requires visiting gr, gg, then gb while enforcing ordering and obstacle constraints.
  • Evaluation: Reward comparisons use episode-based REPS and, for immediate heuristic rewards, step-based REPS with four random seeds and tuned continuous-reward coefficients.TLTL robustness is evaluated from complete trajectories, while step-based REPS uses cost-to-go estimates for discrete and continuous rewards.
  • Results: TLTL robustness produced the best convergence rate and final return in both tasks; discrete reward failed on Task 2 because of sparse returns.A tuned continuous reward was comparable on Task 1, but TLTL outperformed competing rewards by a considerable margin on Task 2.
  • Results: Encoding temporal structure in the reward allowed a relatively simple non-hierarchical algorithm to learn a hierarchical task in continuous state and action spaces.During training, obstacles were treated as penetrable with negative reward proportional to penetration depth rather than immediate episode termination.

B. Learning Toast-Placing Task With A Baxter Robot

A Baxter robot learns a toast-placing task specified with TLTL constraints for reaching, collision avoidance, and gripper timing. The TLTL reward learned a substantially better policy and achieved perfect success in evaluation trials, while the comparison reward failed.

  • Task setup: The Baxter task uses a 21-dimensional state and 8-dimensional action space to control arm motion and continuous gripper position at 20 Hz.The state includes joint angles and velocities, end-effector pose, and gripper position; actions include seven joint velocities and desired gripper position.
  • Task specification: The TLTL specification requires avoiding the table and toaster, reaching the slot, keeping the gripper closed until reaching it, then opening it.Spatial and orientation predicates define the table, toaster, and slot regions, while gripper predicates encode open and closed conditions.
  • Reward construction: Robustness is generated from TLTL quantitative semantics, with robustness greater than zero indicating specification satisfaction and predicate scales normalized for learning.The robustness is evaluated recursively over the trajectory and implemented in a highly vectorized form.
  • Training: Training uses episode-based REPS with 100-step episodes and 10 sample trajectories per update, while toaster penetration receives a depth-proportional negative reward.Table collisions restart the episode; the reported episode horizon is around six seconds.
  • Results: The TLTL reward learned a significantly better policy than the comparison reward because the latter depends heavily on manually tuned coefficient magnitudes.The comparison reward can overemphasize reaching the slot while neglecting correct gripper timing when coefficients are poorly balanced.
  • Limitation: Predicate-robustness normalization remains manual, with automatic or adaptive normalization identified as future work.Proper normalization is required so that subformulas receive comparable treatment during learning.
  • Results: 100% success was achieved in 10 toast-placing trials with the TLTL policy, whereas the comparison policy failed to learn the task.The reported failure was attributed to inability to learn the correct gripper timing policy.

VI. CONCLUSION

The paper frames robot learning as goal-directed behavior constrained by explicit rules, and proposes TLTL rewards to encode those rules in reinforcement learning. TLTL rewards outperformed comparison rewards and enabled learning of a temporally structured task, with successful demonstration on a Baxter robot.

  • VI. CONCLUSION: Robot learning requires both goals and well-defined rules, since learning safe behavior from goals alone may require an intractable number of trials.The paper uses driving as an analogy for why domain rules matter in robot learning.
  • VI. CONCLUSION: TLTL is a formal specification language with quantitative semantics designed for convenient robotic task specification.Its robustness-based reward incorporates temporal structure and constraints into learning.
  • VI. CONCLUSION: TLTL rewards outperformed discrete and continuous comparison rewards and enabled a non-hierarchical RL method to learn a temporally structured task.The comparisons used a 2D simulated manipulation environment while fixing the RL algorithm.
  • VI. CONCLUSION: The approach successfully learned a toast-placing task on a Baxter robot.This provides a physical-robot demonstration beyond the simulated manipulation experiments.
Loading 1612.03471v2…