Knowledge Transfer for Deep Reinforcement Learning with Hierarchical Experience Replay

Haiyan Yin, Sinno Jialin Pan

TL;DR

This paper introduces a more efficient way to "distill" multiple specialized Reinforcement Learning (RL) agents into a single multi-task student network. By using task-specific feature extractors and a novel Hierarchical Prioritized Experience Replay (H-PR), the authors achieve faster training and better performance than previous methods, effectively eliminating the common problem of "negative transfer" where tasks interfere with one another.

What Problem Does This Paper Address?

Deep Reinforcement Learning (DRL) has seen massive success in specific domains (like Atari games), but these models are typically "specialists"—one network plays one game. Policy Distillation aims to solve this by training a single "student" network to mimic the behavior of multiple "teacher" networks.

However, existing distillation methods face three major hurdles:

  1. Computational Cost: Training a massive multi-task network from raw pixels takes an enormous amount of time.
  2. Negative Transfer: Because different games have different visual styles and objectives, forcing them to share the same early convolutional layers often causes the network to perform worse on all of them.
  3. Data Sampling: In a multi-task setting, it is difficult to decide which experiences from which games the student should focus on to learn most effectively.

Methods

The authors propose two major innovations to the standard distillation pipeline:

1. Task-Specific Feature Architecture

Unlike previous models that try to learn a single set of convolutional filters for all games, this architecture keeps the convolutional layers task-specific. The student network uses pre-trained, high-level features from the teachers as inputs. These features are then fed into shared fully-connected layers. This prevents the "pixel-level" confusion that leads to negative transfer while still allowing the model to learn generalized "reasoning" in the shared layers.

Proposed multi-task distillation architecture with task-specific feature extractors.

2. Hierarchical Prioritized Experience Replay (H-PR)

Standard prioritized sampling (PER) focuses on transitions with high error. However, in multi-task learning, this can bias the student toward a small subset of "hard" states, causing it to forget the global distribution of the game. H-PR solves this with a two-tier approach:

  • Level 1 (Partitioning): Replay memory is divided into bins based on state-values ($V(s)$). The system samples uniformly across these bins to ensure the student sees a representative mix of "easy" and "hard" game states.
  • Level 2 (Prioritization): Inside each bin, experiences are prioritized based on the absolute gradient of the distillation loss. This ensures the student focuses on the specific transitions where its behavior differs most from the teacher.

Datasets

The researchers evaluated their approach using the Atari 2600 benchmark via the Arcade Learning Environment. They tested on a diverse set of 10 games: Beamrider, Breakout, Enduro, Freeway, Ms. Pacman, Pong, Qbert, Seaquest, Space Invaders, and River Raid*.

Key Insights and Ideas

  • High-Level Features are "Mixable": The authors observed that while raw pixels are game-specific, the high-level embeddings learned by deep networks have higher within-game variance. By sharing only the top layers, the model can find commonalities in "logic" (e.g., "avoid the projectile") without getting bogged down by visual differences.
  • Preserving the Global Distribution: Purely prioritized sampling can be "too greedy." By partitioning based on state-values, H-PR acts as a regularizer, ensuring the agent doesn't lose its ability to handle "boring" or "easy" states that are nonetheless vital for overall game flow.
  • Gradient as a Proxy for Learning: In distillation, we don't use the standard TD-error. The authors found that the gradient of the KL-divergence (the difference between teacher and student distributions) is a robust metric for identifying which data points provide the most "knowledge gain."

Key Results

  • Superior Performance: The proposed architecture achieved scores exceeding 100% of the teacher's performance across all 10 games. In Enduro, the student actually outperformed the teacher by over 15%.
  • Faster Convergence: The multi-task model converged within 1.5 million mini-batch steps, whereas baseline architectures (like DIST and Actor-Mimic) required at least 2.5 million steps to reach similar levels.
  • Efficiency in Hard Tasks: For complex games like Breakout and Qbert, H-PR reached target performance levels in roughly 50% of the steps* required by uniform sampling.
Performance comparison of H-PR with different partition numbers (P) against uniform sampling on Breakout and Q*bert.
  • Robustness: While baseline multi-task models often fell below 75% of teacher performance on certain games (negative transfer), the proposed method remained stable and effective across the entire suite.

Limitations and Future Work

  • Teacher Dependency: The method relies on having high-quality, pre-trained teacher networks and their specific convolutional filters. This adds a "pre-processing" step to the pipeline.
  • Memory Overhead: Maintaining separate partitions and priority queues for multiple tasks increases memory consumption, though the authors note this has a neutral effect on actual learning performance.
  • Future Directions: The authors suggest that incorporating more efficient exploration strategies into the distillation process could further accelerate learning, especially for games where the state-visitation distribution changes drastically as the agent improves.

Summary updated

BibTeX
@inproceedings{yin2017knowledge,
  author = {Haiyan Yin and Sinno Jialin Pan},
  title = {{Knowledge Transfer for Deep Reinforcement Learning with Hierarchical Experience Replay}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.1609/aaai.v31i1.10733},
}
Figure