Attentive Multi-task Deep Reinforcement Learning

Timo Bräm, Gino Brunner, Oliver Richter, Roger Wattenhofer

TL;DR

This paper introduces an Attentive Multi-Task (AMT) architecture for deep reinforcement learning that uses a soft attention mechanism to dynamically route state and task information through a shared set of sub-networks. By automatically grouping related tasks and isolating conflicting ones, the model achieves efficient positive knowledge transfer while avoiding negative transfer, matching or beating state-of-the-art methods while using significantly fewer parameters and naturally handling unaligned action spaces.

What Problem Does This Paper Address?

In multi-task reinforcement learning (RL), agents try to learn multiple skills simultaneously to improve sample efficiency through shared experience. However, this often leads to negative transfer—a phenomenon where learning one task actively harms performance on another conflicting task.

Many existing approaches struggle with this balance. Some assume all tasks share underlying similarities, which fails when tasks conflict. Others require perfectly aligned action spaces across all tasks. Methods that successfully avoid negative transfer, like Progressive Neural Networks (PNN), often do so by scaling the network size linearly or super-linearly with the number of tasks, leading to massive memory and computational overhead. The authors tackle the challenge of building a parameter-efficient multi-task RL agent that can automatically figure out which tasks should share knowledge and which should be kept strictly separate, without relying on human-provided priors.

Methods

The authors propose a novel architecture combining a shared feature extractor, an ensemble of sub-networks, and a soft attention mechanism, trained end-to-end using Asynchronous Advantage Actor-Critic (A3C).

  • Shared Feature Extractor: A standard Convolutional Neural Network (CNN) processes the environment state into a shared high-level embedding.
  • Attention Network: This module takes the state embedding and a one-hot encoded task ID, outputting a set of softmax weights.
  • Sub-Networks: A fixed number of independent sub-networks process the shared state embedding to produce policy and value estimates. Crucially, the number of sub-networks is much smaller than the total number of tasks.
  • Attentive Routing: The final policy and value function are calculated as an attention-weighted linear combination of the sub-networks' outputs.
  • Task-Specific Output Layers: A final task-specific linear layer maps the weighted policy to the specific action space of the current task.

Datasets

The authors evaluate their approach on custom, lightweight environments designed specifically to test both positive and negative transfer:

  • Grid Worlds: 20 variations of an 8x8 grayscale grid world. Tasks vary by adding walls, bonus objects, and penalty objects. To force negative transfer scenarios, some tasks have inverted reward structures (e.g., what is a bonus in Task A is a penalty in Task B).
  • Connect Four: 4 variations of the classic game (standard, connect five, and 90-degree rotated versions where players choose rows instead of columns).

Key Insights and Ideas

  • Automatic Specialization: The attention mechanism naturally learns to dedicate specific sub-networks to specific families of tasks. When trained on both Grid World and Connect Four tasks simultaneously, the network cleanly routes Grid World states to one sub-network and Connect Four states to another, effectively isolating unrelated domains.
  • Parameter Efficiency: Because the model dynamically routes information through a fixed number of sub-networks (scaling roughly as one new sub-network for every four tasks), it avoids the parameter explosion seen in PNNs, which add a whole new network column for every new task.
  • Handling Unaligned Actions: By decoupling the core policy logic from the final action mapping via task-specific linear layers, the architecture can easily share knowledge between tasks that have fundamentally different action spaces (e.g., moving up/down vs. dropping a token in a specific column).

Key Results

  • Sample Efficiency: On a suite of up to 20 Grid World tasks, the AMT architecture required fewer environment interactions to reach a 0.9 average score compared to PNNs, and performed comparably to Distral (another state-of-the-art multi-task baseline).
  • Model Size: For 20 tasks, AMT required only ~1 million parameters. In contrast, Distral required ~3 million, and PNN required over 5 million parameters.
  • Unaligned Action Spaces: When trained on 6 tasks where 3 had inverted action dimensions (e.g., the "left" action moves the agent right), AMT reached the target score in ~2.5 million steps. PNN took over 5.5 million steps, and Distral failed to reach the threshold for all tasks within the time limit, proving AMT's superiority in unaligned domains.

Limitations and Future Work

  • Limitations: The evaluation is restricted to relatively simple, custom 2D environments. The authors note that testing on more complex, standard benchmarks like the Arcade Learning Environment (Atari) was limited by computational resource constraints during the study (training hundreds of networks for the scaling experiments was too expensive).
  • Future Work: The authors plan to scale their approach to more complex tasks by integrating more resource-efficient RL algorithms, such as IMPALA, to handle the increased computational load of larger, more realistic environments.

Summary updated

BibTeX
@inproceedings{bram2019attentive,
  author = {Timo Bräm and Gino Brunner and Oliver Richter and Roger Wattenhofer},
  title = {{Attentive Multi-task Deep Reinforcement Learning}},
  booktitle = {ECML/PKDD},
  year = {2019},
  url = {https://openreview.net/forum?id=Y_EEuVQCE2p},
}
Figure