On The Transferability of Deep-Q Networks

Matthia Sabatelli, Pierre Geurts

In the world of Supervised Learning (SL), Transfer Learning (TL) is a superpower. We take a model pre-trained on millions of images (like ImageNet) and "fine-tune" it for a specific task with remarkable success. But in Deep Reinforcement Learning (DRL), this superpower often feels more like a curse.

In their paper "On The Transferability of Deep-Q Networks," Matthia Sabatelli and Pierre Geurts dive into why Deep-Q Networks (DQNs) struggle to reuse knowledge, often performing worse than models trained from scratch—a phenomenon known as negative transfer.

TL;DR

This paper systematically investigates transfer learning in DQNs across Atari benchmarks and custom control tasks. The authors reveal that transfer is surprisingly difficult in DRL, often resulting in negative transfer due to a "synchronization" failure between the model's feature extractor and its policy-making head.

What Problem Does This Paper Address?

Training DRL agents is notoriously slow and computationally expensive. Naturally, researchers want to use TL to skip the "learning to see" phase and jump straight to "learning to act." However, while TL is standard practice in computer vision, its application in DRL is inconsistent.

The authors set out to answer a fundamental question: How transferable are Deep-Q Networks? They specifically look at whether visual similarity between tasks (like two different maze games) actually helps, and why fine-tuning a pre-trained network often leads to unstable or poor performance.

Methods

The researchers employed a two-pronged experimental approach:

  1. Large-scale Atari Study: They tested two popular DQN variants—Double DQN (DDQN) and Deep Quality-Value (DQV) Learning—across 10 different Atari games. They pre-trained models on one game and transferred them to the others, measuring the "Area Ratio" metric to quantify if the transfer helped or hindered learning.
  2. Controlled "Catch" Experiments: To isolate variables, they created four versions of the game "Catch" (Catch-v0 to v3). These variants allowed them to test specific hypotheses about task complexity, visual noise, and state representation (e.g., mirroring the screen).
  3. Fine-tuning vs. Feature Extraction: They compared two strategies:
  4. Full Fine-tuning: Updating all weights in the network.
  5. Only-Head: Freezing the convolutional layers (the "eyes") and only training the final linear layer (the "brain").

Datasets

  • Atari Arcade Learning Environment (ALE): A standard DRL benchmark. The authors selected 10 games, including visually similar pairs like Ms. Pacman and Bank Heist. Visually similar games like Ms. Pacman and Bank Heist don't always guarantee easy transfer.

  • Catch Variants: Custom-built environments ranging from simple binary grids to versions with random background noise and mirrored dynamics.

  • Catch-v4: A "sparse reward" version where the agent only gets a point after five successful catches in a row, making it nearly impossible to learn from scratch.
Figure 1: The visually similar Ms Pacman and Bank Heist games.

Key Insights and Ideas

  • Visual Similarity is Deceptive: You might assume that a model trained on Ms. Pacman would breeze through Bank Heist because both involve navigating mazes. The results say otherwise: visual similarity does not reliably predict positive transfer in DRL.
  • The Synchronization Trap: A DQN has two jobs: extracting features from pixels and estimating the value of actions. The authors hypothesize that during fine-tuning, the pre-trained "eyes" are too detached from the randomly initialized "brain." As the brain tries to learn, it forces the eyes to change, often destroying the useful features they already had before the brain can even make sense of them.
  • "Only-Head" is Often Better: Surprisingly, using a pre-trained model as a frozen feature extractor often yielded better results than allowing the whole network to adapt.
  • TL as a "Key" for Sparse Rewards: The most significant "aha moment" came from Catch-v4. While models trained from scratch failed completely due to the sparse rewards, transferred models succeeded. This suggests TL's true value in DRL might not be speeding up easy tasks, but making impossible tasks solvable.

Key Results

  • Negative Transfer is the Norm: In the Atari experiments, the vast majority of game pairs resulted in negative transfer. For DDQN, almost no game pairs showed a significant benefit from pre-training.
  • Asymmetric Transfer: Transfer isn't a two-way street. Transferring from Boxing to Fishing Derby was beneficial ($r = 0.552$), but the reverse (Fishing Derby to Boxing) was a disaster ($r = -0.893$).
  • The Hybrid Success: The authors demonstrated that a "Hybrid" approach—initializing the head with weights that already showed some success—could stabilize learning, as shown in their visualization of training dynamics. A visualization of how different initialization strategies affect the training of DQNs.
A visualization of how different initialization strategies affect the training of DQNs.

Limitations and Future Work

The study focuses exclusively on value-based, model-free algorithms (the DQN family). The authors acknowledge that policy gradient methods or model-based RL might exhibit different transfer properties.

Future research could explore better ways to "synchronize" the feature extractor and the policy head during transfer. The authors suggest that the secret to successful transfer might lie deeper in the "inner properties" of the environment's MDP (Markov Decision Process) rather than just the visual pixels on the screen.

Summary updated

BibTeX
@inproceedings{sabatelli2021transferability,
  author = {Matthia Sabatelli and Pierre Geurts},
  title = {{On The Transferability of Deep-Q Networks}},
  booktitle = {DeepRL @ NeurIPS},
  year = {2021},
  url = {https://openreview.net/forum?id=MmFx8vj3A5I},
}
Figure