On the Transferability of Deep-Q Networks

Matthia Sabatelli, Pierre Geurts

TL;DR

While fine-tuning pre-trained networks is the default approach in supervised learning, this paper shows that fine-tuning Deep-Q Networks in reinforcement learning overwhelmingly results in negative transfer. The authors find that the root cause is a synchronization breakdown: a randomly re-initialized output head rapidly destroys the pre-trained feature extractor, whereas freezing the backbone and training only the head enables fast, positive transfer.

What Problem Does This Paper Address?

Training Deep Reinforcement Learning (DRL) agents directly from high-dimensional pixels requires massive computational budgets and millions of environment interactions. In computer vision and natural language processing, Transfer Learning (TL)—fine-tuning pre-trained representations on a new task—dramatically reduces training time and data needs.

However, how well does transfer learning work for value-based, model-free DRL agents? While prior work showed mixed results in small setups, whether standard Deep-Q Networks can reliably transfer representations across tasks has remained an open question. The authors set out to determine: How transferable are Deep-Q Networks?

Methods

The authors evaluate transferability using three popular Q-learning algorithms: Deep-Q Networks (DQN), Double DQN (DDQN), and Deep Quality-Value (DQV) Learning.

Their experimental setup systematically tests how knowledge moves across tasks:

  • Standard Fine-Tuning: Take a convolutional network pre-trained on a source Markov Decision Process ($M_S$), replace and randomly re-initialize the final linear layer (which outputs action values $Q(s, a)$), and update all network weights on the target task ($M_T$).
  • Linear Probing / Feature Extraction ("Only-Head"): Freeze the pre-trained convolutional backbone and train only the newly initialized final linear layer on $M_T$.
  • Hybrid Transfer: Initialize the feature extractor with weights that previously caused negative transfer, but initialize the decision head with weights that yielded positive transfer, isolating the interaction between the two components.
  • Evaluation Metric: Transfer performance is quantified via the area ratio metric ($r$), comparing cumulative reward during transfer against training from scratch: $$r = \frac{\text{area of } M_S - \text{area of } M_T}{\text{area of } M_T}$$ A positive $r$ indicates positive transfer; negative values indicate negative transfer.

Datasets

The authors evaluate agents on two testbeds:

  1. Atari Arcade Learning Environment (ALE): A 10-game subset (including Bank Heist, Boxing, Crazy Climber, Enduro, Fishing Derby, Frostbite, James Bond, Ms. Pacman, Pong, and Zaxxon/Ice Hockey/Gopher) chosen to cover varying levels of visual similarity, gameplay dynamics, and baseline agent proficiency.
  2. The Catch Environment Suite (Control Benchmark): A newly developed set of 5 controlled variants based on the classic 21×21 pixel Catch task:
  3. Catch-v0: Baseline (5-pixel paddle, falling ball).
  4. Catch-v1: Increased precision requirement (paddle reduced to 2 pixels).
  5. Catch-v2: High visual noise (background pixels assigned random values between 0 and 255).
  6. Catch-v3: Vertically mirrored geometry (paddle at top, ball ascends).
  7. Catch-v4: Extreme reward sparsity (reward awarded only after 5 consecutive catches).

Key Insights and Ideas

  • Similarity does not guarantee transfer: In supervised learning, task similarity is the best predictor of transfer success. In DRL, even near-identical tasks (e.g., transferring between variants of Catch, or between maze games like Bank Heist and Ms. Pacman) suffered severe negative transfer.
  • The Desynchronization Trap: A Deep-Q Network simultaneously learns a visual representation and an optimal value function. When fine-tuning begins, the freshly randomized linear head produces chaotic gradient updates that rapidly corrupt and "unlearn" the pre-trained convolutional features before the head learns to use them.
  • Self-Transfer Fails Under Fine-Tuning: In an experiment where agents were transferred back to the exact same environment they trained on ($M_S = M_T$), fine-tuning still led to performance collapse and instability in 3 out of 4 Catch versions.
  • Freezing the backbone works: When the pre-trained feature extractor was frozen ("Only-Head"), self-transfer achieved positive transfer across all Catch environments, converging almost instantaneously to optimal policies.
  • Positive transfer stems from target MDP dynamics, not features: The rare cases where fine-tuning succeeded (such as Fishing Derby with DQV or Catch-v4) occurred because the target task was too sparse or difficult to learn from scratch. Pre-training provided enough initial stability to bootstrap learning, rather than transferring reusable game concepts.

Key Results

  • Atari Benchmark: Fine-tuning DDQN and DQV models across Atari game pairs resulted in negative or absent transfer in the overwhelming majority of cases. For example, transferring Fishing Derby $\to$ Boxing yielded an area ratio of $r = -0.893$ (DQV), and Bank Heist $\to$ Pong yielded $r = -3.013$ (DDQN). Transfer was also non-symmetric: Boxing $\to$ Fishing Derby yielded positive transfer ($r = 0.552$), but the reverse failed completely.
  • Catch Inter-Task Transfer: Fine-tuning across different Catch tasks yielded negative area ratios across the board (ranging from $r = -0.016$ to $r = -0.486$).
  • Catch Self-Transfer: Training only the head yielded consistently positive transfer ($r = 0.05$ on v0, $0.141$ on v1, $0.674$ on v2, $0.059$ on v3). Conversely, full fine-tuning produced negative transfer on three of the four tasks ($r = -0.218$ on v1, $r = -0.236$ on v3).

Limitations and Future Work

  • Algorithm Scope: The findings are specific to value-based, model-free algorithms (DQN variants) learning from pixel observations; they do not encompass policy gradient, actor-critic, or model-based architectures.
  • Mitigation Strategies Left Unexplored: The paper diagnoses why fine-tuning fails (representation desynchronization), but does not propose or evaluate explicit algorithmic solutions—such as learning rate warm-ups, progressive feature unfreezing, or regularized fine-tuning penalties—to bridge the gap between feature extractor and head.

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