Delayed Reinforcement Learning by Imitation

Pierre Liotet, Davide Maran, Lorenzo Bisi, Marcello Restelli

Abstract

In real-world applications of Reinforcement Learning (RL), such as robotics and high-frequency trading, delays between actions and observations are ubiquitous. These delays break the Markov property, necessitating state augmentation that leads to high-dimensional, difficult-to-learn state spaces. We present DIDA (Delayed Imitation with Dataset Aggregation), an algorithm that addresses this challenge by reframing delayed RL as an imitation learning problem. DIDA trains an expert in an undelayed environment and uses it to guide a delayed student, bypassing the complexities of value function estimation in augmented spaces. Our results across multiple domains demonstrate that DIDA achieves state-of-the-art performance with significantly higher sample efficiency than existing baselines.

Introduction: The Challenge of Latency

Standard RL agents operate under the assumption of instantaneous environment reactions. In practice, sensor lag and actuator latency sever the direct link between a current action and its immediate result. While the Markov property can be restored by augmenting the state with a history of pending actions, this "augmented state" creates a massive search space that is computationally expensive to navigate from scratch. Previous solutions often rely on complex model-based predictions or memoryless heuristics that struggle in dynamic environments.

Methodology: DIDA and the Imitation Bridge

DIDA proposes a simple yet effective paradigm: if learning in a delayed world is difficult, leverage an undelayed expert to teach a "laggy" student. The process follows three main steps:

  1. Expert Training: A standard RL agent (e.g., Soft Actor-Critic) is trained in an idealized, undelayed version of the task.
  2. Student Initialization: The student agent operates in the delayed environment, observing the augmented state (the last known state plus the queue of pending actions).
  3. Dataset Aggregation (DAGGER): Using a modified DAGGER approach, the student collects trajectories in the delayed environment. For every encountered augmented state, the undelayed expert is queried to provide the optimal instantaneous action. The student then learns a direct mapping from the high-dimensional augmented state to the expert's policy.

By utilizing imitation, DIDA avoids the need to explicitly predict future states or solve the complex credit assignment problems inherent in delayed RL.

Experimental Evaluation

The authors evaluated DIDA across several benchmark domains, including classic control (Pendulum) and high-dimensional robotic locomotion tasks in MuJoCo (HalfCheetah, Reacher, Swimmer, and Walker2d).

Performance of DIDA across Pendulum, HalfCheetah, and Reacher environments. The pink line indicates the rapid convergence of DIDA once imitation training begins.

As shown in the figures above, DIDA exhibits a characteristic "jump" in performance as soon as the imitation phase begins (marked as "DIDA training starts"). In the HalfCheetah environment, for instance, the agent reaches near-expert performance within approximately 500,000 steps of starting the DIDA training phase, significantly outperforming specialized baselines like DCAC or augmented TRPO.

Key Insights and Results

  • Sample Efficiency: DIDA converges much faster than traditional delayed RL methods because it leverages the pre-existing knowledge of the undelayed expert.
  • Robustness to Lag: Theoretical analysis and stress tests indicate that DIDA is highly robust to increasing delay intervals ($\Delta$), maintaining stable returns where other algorithms fail.
  • Surpassing the Ceiling: Interestingly, in certain tasks like the Swimmer environment, the imitation process can act as a regularizer, allowing the student to occasionally match or even slightly exceed the performance of the undelayed expert.
DIDA performance in the Swimmer environment, demonstrating convergence to the undelayed expert's performance level.

Conclusion

DIDA offers a pragmatic and high-performance solution for handling latency in RL. By shifting the focus from state prediction to expert imitation, it provides a robust framework for real-world deployment where delays are unavoidable. Future work aims to extend this framework to stochastic delays, further bridging the gap between simulated benchmarks and complex real-world environments.

Summary updated

BibTeX
@inproceedings{liotet2022delayed,
  author = {Pierre Liotet and Davide Maran and Lorenzo Bisi and Marcello Restelli},
  title = {{Delayed Reinforcement Learning by Imitation}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=blqYxepAcB},
}
Figure