Knowledge transfer in multi-task deep reinforcement learning for continuous control

Kun Wu, Zhiyuan Xu, Zhengping Che, Jian Tang, Jieping Ye

TL;DR

Training a single deep reinforcement learning agent to master multiple continuous control tasks is notoriously difficult due to task interference and catastrophic forgetting. KTM-DRL overcomes this by transferring knowledge from pre-trained, task-specific expert "teachers" into a single compact student network using a two-stage process: offline distillation followed by teacher-guided online exploration. Remarkably, this single multi-task network matches—and occasionally outperforms—specialized individual agents trained exclusively on a single task.

What Problem Does This Paper Address?

While Deep Reinforcement Learning (DRL) excels at individual continuous control benchmarks, training a single policy to handle diverse environments (Multi-Task DRL) typically leads to degraded performance or outright failure. Standard multi-task approaches struggle because:

  1. Task interference and conflicting gradients: Shared neural network representations get pulled in conflicting directions across different tasks.
  2. Catastrophic forgetting: Learning a new task causes the policy to overwrite skills learned on previous ones.
  3. Mismatched state and action spaces: Continuous control tasks often possess different state and action dimensions, complicating unified network design.

While policy distillation methods (like Actor-Mimic) showed promise in discrete domains (e.g., Atari with DQN), extending knowledge transfer to continuous actor-critic architectures (such as TD3 or SAC) has remained an open challenge.

Methods

KTM-DRL builds on Twin Delayed Deep Deterministic Policy Gradient (TD3) and uses a single "DNN triple" (one actor network and two critic networks) to control all tasks:

  • Handling Variable Dimensions via Padding: Rather than creating task-specific heads or modular sub-networks, the student actor and critics use fixed input/output dimensions padded with zeros. Slicing ($f^k$) and masking ($g^k$) functions extract task-relevant action values.
  • Hierarchical Experience Replay (HER): To prevent any single environment from dominating parameter updates, KTM-DRL maintains $K$ distinct sub-buffers (one per task) for both offline and online phases. Every training epoch draws a mini-batch of $N$ transitions from each sub-buffer, ensuring balanced gradient steps across all tasks.
  • Stage 1: Offline Knowledge Transfer: Before interacting with the environments, the student agent learns offline from teacher experience buffers. The student critics minimize regression loss against teacher Q-values, while the student actor updates its parameters using the gradient provided by the teacher's critic ($\nabla_a Q_1^k$).
  • Stage 2: Teacher-Guided Online Learning: The student interacts with the environments to gather fresh experience. Student critics are trained with standard temporal-difference (TD) targets. Crucially, the student actor is updated with a hybrid policy gradient combining guidance from the student's critic and the teacher's critic: $$\nabla_{\theta^\pi} G(\theta^\pi) = \alpha \nabla_{\text{teacher}} + \beta \nabla_{\text{student}}$$

Datasets

The authors evaluated KTM-DRL on two continuous control benchmarks built on the MuJoCo physics engine:

  • Benchmark A (HalfCheetah Morphologies): 8 morphologically varied tasks modifying body parts (Small/Big Torso, Leg, Foot, and Thigh).
  • Benchmark B (Diverse Control Tasks): 6 structurally distinct MuJoCo tasks with varying dynamics and dimensionalities: Ant, Hopper, Walker2d, HalfCheetah, InvertedPendulum, and InvertedDoublePendulum.

Key Insights and Ideas

  • Distillation can exceed the teacher: On Benchmark A, the student achieved an average score 2% higher than the individual single-task "ideal" agents (e.g., scoring 18% higher on HalfCheetahSmallTorso). As observed in prior distillation literature, transferring policies into a joint representation can act as a regularizer and promote broader state exploration.
  • Critics need to be transferred, not just actors: Initializing or training both student critics and actors via teacher guidance stabilizes early multi-task learning significantly compared to learning representations from scratch.
  • Replay structure matters more than raw capacity: The ablation study revealed that switching from a single global buffer to hierarchical sub-buffers accounts for a 23% performance improvement, making it the single most influential architectural choice for preventing catastrophic forgetting.

Key Results

  • Outperforming Baselines: KTM-DRL outperformed multi-task baselines across almost all tasks, beating Multi-Task TD3 (TD3-MT) by 42%, Multi-Task SAC (SAC-MT) by 110%, SharedNet by 130%, and Gradient Surgery (G-Surgery) by 180% on average.
  • Competitive with Single-Task Experts: Despite having substantially fewer parameters than the combination of $K$ separate expert models (the "Ideal" benchmark), KTM-DRL offered near-identical performance on Benchmark B (e.g., reaching 5,836 vs. 5,839 on Ant, and 10,921 vs. 10,969 on HalfCheetah).
  • Ablation Findings:
  • Removing offline pre-training ("w/o Offline") caused an average 5% performance drop.
  • Removing the teacher term during online learning caused a 2% drop, while removing online TD updates entirely ("Online only Teacher") caused a 5% drop.

Limitations and Future Work

  • Reliance on Converged Teachers: KTM-DRL assumes access to high-performing, expert-level single-task policies. If teachers are sub-optimal, noisy, or fail to converge, the student’s performance may degrade. Learning effectively from imperfect continuous teachers remains an open question.
  • Upfront Training Costs: While student training is computationally efficient (taking ~12 hours on an NVIDIA Tesla P100), the prerequisite step of training $K$ separate expert teachers adds computational overhead prior to multi-task consolidation.

Summary updated

BibTeX
@inproceedings{wu2020knowledge,
  author = {Kun Wu and Zhiyuan Xu and Zhengping Che and Jian Tang and Jieping Ye},
  title = {{Knowledge transfer in multi-task deep reinforcement learning for continuous control}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=nwUh8nj6k1E},
}
Figure