Continual Task Learning through Adaptive Policy Self-Composition

Shengchao Hu, Yuhang Zhou, Ziqing Fan, Jifeng Hu, Li Shen, Ya Zhang, Dacheng Tao · DOI

Abstract

Continual Offline Reinforcement Learning (CORL) presents a significant challenge in balancing the acquisition of new skills (plasticity) with the retention of previously learned ones (stability). We present CompoFormer, a transformer-based framework that addresses this "stability-plasticity tradeoff" through adaptive policy self-composition. By utilizing semantic task descriptions and a frozen language model, CompoFormer identifies and reuses relevant prior knowledge to solve new tasks. Our results on the Offline Continual World (OCW) benchmark demonstrate that CompoFormer significantly outperforms existing regularization-based methods, maintaining near-zero forgetting while achieving high average performance across complex task sequences.

Introduction

In the pursuit of general-purpose artificial agents, the ability to learn a sequence of tasks over time—Continual Learning (CL)—is essential. Performing this in an "offline" manner, where agents learn from pre-collected datasets, is particularly valuable for safety-critical domains like robotics. However, CORL is plagued by catastrophic forgetting and distribution shifts. When an agent's policy evolves, the data it was trained on may no longer match the current state-action distributions, leading to performance degradation on earlier tasks. Existing methods often struggle to find a balance between being too rigid to learn or too flexible to remember.

The CompoFormer Framework

CompoFormer builds upon the Decision Transformer (DT) architecture, introducing an Adaptive Policy Self-Composition module to manage task transitions.

The CompoFormer architecture leverages semantic embeddings and attention to compose policies for sequential tasks.

The core mechanism involves three key steps:

  1. Semantic Embedding: Each new task is represented by a text description (e.g., "handle press side"). A frozen Sentence-BERT (S-BERT) model converts these descriptions into semantic vectors.
  2. Attention-Based Composition: The model computes attention scores between the current task's embedding and those of previously learned tasks. This allows the system to dynamically determine which prior policies are most relevant to the current objective.
  3. Adaptive Logic: If the composed knowledge from existing policies meets a predefined performance threshold, the model reuses them directly. If the knowledge is insufficient, the model integrates new parameters to capture task-specific nuances.

Structural Adaptation Variants

To handle the integration of new knowledge, the authors propose two distinct structural variants of the Meta-Policy Network:

The Meta-Policy Network architecture alongside the Grow and Prune structural adaptation strategies.
  • CompoFormer-Grow: This variant utilizes Low-Rank Adaptation (LoRA). It adds a small set of trainable parameters for each new task, allowing the model to expand its capacity incrementally without altering the core frozen weights of previous tasks.
  • CompoFormer-Prune: This variant starts with a larger network and employs a masking technique. It "packs" different tasks into specific sub-networks, which are then frozen to prevent interference as the sequence progresses.

Experimental Setup

Evaluation was conducted using the Offline Continual World (OCW) benchmark, a suite adapted from Meta-World for the offline setting.

  • OCW10: A sequence of 10 unique robotic manipulation tasks.
  • OCW20: A 20-task sequence where the initial 10 tasks are repeated, testing the model's ability to recognize and reuse knowledge upon task recurrence.
  • Data: Each task dataset consists of 1 million transitions generated by a Soft Actor-Critic (SAC) agent.

Key Results and Insights

CompoFormer demonstrates a superior ability to manage the stability-plasticity tradeoff compared to 11 baseline methods, including traditional regularization techniques like EWC and MAS.

  • Superior Performance: On OCW10, CompoFormer-Prune achieved an Average Performance (AP) of 0.69, vastly outperforming simple finetuning (0.11) and the strongest regularization baseline, L2 (0.29).
  • Zero Forgetting: While many methods saw performance drops of over 50% on early tasks, CompoFormer maintained near-zero forgetting (approx. -0.01), effectively "locking in" skills.
  • Semantic Correlation: Analysis of attention scores revealed that the model successfully identifies physical primitives. For example, tasks involving "pushing" received high mutual attention, even if the objects being manipulated differed.
  • Zero-Shot Capabilities: Due to its composition logic, CompoFormer can occasionally solve new tasks in a zero-shot manner by combining existing policy components based solely on the task description.

Conclusion and Future Work

CompoFormer represents a significant step forward in CORL by replacing volatile regularization with a structured, semantic-driven approach to policy composition. While highly effective, the framework faces challenges regarding computational complexity, which scales at $O(k^2)$ with the number of tasks $k$. Additionally, while the model excels at preventing forgetting, "forward transfer" remains an open research area. Future work will focus on optimizing inference costs and improving the robustness of the system to varying qualities of task descriptions.

Summary updated

BibTeX
@misc{hu2024continual,
  author = {Shengchao Hu and Yuhang Zhou and Ziqing Fan and Jifeng Hu and Li Shen and Ya Zhang and Dacheng Tao},
  title = {{Continual Task Learning through Adaptive Policy Self-Composition}},
  year = {2024},
  eprint = {2411.11364},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.11364},
}
Figure