Continual and Multi-task Reinforcement Learning With Shared Episodic Memory

Artyom Y. Sorokin, Mikhail S. BurtsevarXiv 2019

TL;DR

This paper introduces SEM-A2C, a novel deep reinforcement learning architecture that leverages a shared episodic memory to improve performance on multi-task and continual learning scenarios. By explicitly separating task-agnostic environmental memory from task-specific policy memory, SEM-A2C demonstrates faster learning and better generalization in complex environments.

What Problem Does This Paper Address?

Reinforcement learning agents often struggle with learning multiple tasks efficiently, especially when those tasks are sequential or require adapting to new skills. Traditional multi-task learning approaches often treat tasks independently or rely on simple weight sharing, which can limit the transfer of knowledge. Furthermore, while episodic memory is crucial for humans and animals to quickly adapt and learn from past experiences, effectively integrating this type of memory into deep RL agents for sequential task execution and continual learning remains a significant challenge. This paper aims to bridge this gap by proposing an architecture that explicitly models and reuses task-agnostic episodic memories across different tasks.

Methods

The core innovation is the Shared Episodic Memory (SEM) architecture, integrated into an Actor-Critic framework (SEM-A2C). SEM-A2C features two distinct recurrent sub-networks:

  • RNNsem (Task-Agnostic Episodic Memory): This network encodes and stores a general representation of the environment's state. Its hidden state is reset only at the end of an entire episode (which can encompass multiple tasks), allowing it to accumulate long-term environmental knowledge.
  • RNNtsm (Task-Specific Memory): This network encodes task-specific information. Its hidden state is reset after each individual task is completed, enabling it to adapt to the current goal while still potentially leveraging information from RNNsem.

The architecture also incorporates:

  • Observation Encoder (Eobs): Processes raw environmental observations.
  • Task Embedder (Etask): Creates embeddings for different task identifiers.
  • Factorized LSTM for RNNtsm: To manage computational complexity and improve sensitivity to task embeddings, the weights for RNNtsm are generated on-the-fly using a factorization technique involving task embeddings and shared matrices.

The agent is trained using a meta-learning setup where episodes consist of multiple tasks. Task completion is predicted by a dedicated head (Fcomp), which helps in managing the sequential task execution.

Datasets

The experiments were conducted in a modified Taxi problem environment. This environment was randomized for each episode, featuring randomly placed walls and water, and the agent had a limited field of view (7x7 cells). For continual learning experiments, a new cargo object and associated tasks were added to the environment.

Key Insights and Ideas

  • Explicit Separation of Memory Types is Key: The paper strongly suggests that explicitly separating task-agnostic environmental memory (RNNsem) from task-specific memory (RNNtsm) is crucial for effective knowledge transfer in multi-task and continual learning.
  • Episodic Memory Aids Task Completion Prediction: The ability of the agent to predict task completion (via Fcomp) is shown to be beneficial, facilitating the smooth transition between tasks.
  • Factorized LSTM for Task Embeddings: Using a factorized LSTM for the task-specific network, where task embeddings influence weight generation, proves more effective than simply concatenating task embeddings with the input. This suggests that how task information is integrated into the network dynamics matters significantly.
  • Generalization to Novel Skills: The SEM-A2C architecture demonstrates an ability to learn new skills more efficiently in a continual learning setting, highlighting the power of its shared episodic memory.

Key Results

  • Multi-Task Learning (Taxi Problem): SEM-A2C significantly outperformed a baseline "Multitask-A2C" (which used weight sharing but no explicit episodic memory) in the Taxi problem. It achieved a 40% faster solution for the "Reach(D)" sub-task after the target was discovered and solved the full Taxi problem with 20% fewer steps.
  • Continual Learning: In a scenario with new cargo-related tasks, SEM-A2C learned both new tasks within one million steps. In contrast, baselines (including a factorized version) struggled, with one only learning the simpler "Pickup(C)" task and failing to learn "Deliver(C)" effectively.
  • Qualitative Improvement: Visualizations (Figure 2) showed that SEM-A2C agents, after visiting a target location, learned to revisit it more efficiently in subsequent tasks, demonstrating effective reuse of learned spatial knowledge.

Limitations and Future Work

  • Limitations: The paper focuses on a specific environment (modified Taxi problem) and a particular RL algorithm (A2C). While the authors suggest their modifications are generalizable, further validation on diverse environments and algorithms is needed. The complexity of managing the task-agnostic memory over very long sequences of tasks might also become a challenge.
  • Future Work: The authors suggest that their SEM-A2C architecture can be applied to other general-purpose RL algorithms like PPO and DRQN. The ability of SEM-A2C to learn sub-task completion also opens avenues for more autonomous execution of hierarchical tasks. Further research could explore more sophisticated methods for memory retrieval and integration, as well as investigate the scalability of the approach to a much larger number of tasks and more complex environments.

Summary updated

BibTeX
@misc{sorokin2019continual,
  author = {Artyom Y. Sorokin and Mikhail S. Burtsev},
  title = {{Continual and Multi-task Reinforcement Learning With Shared Episodic Memory}},
  year = {2019},
  eprint = {1905.02662},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.02662},
}
Figure