Source-linked AI summary

Multi-Task Reinforcement Learning with Context-based Representations

Shagun Sodhani, Amy Zhang, Joelle Pineau

arXiv:2102.06177v2cs.LGcs.AIcs.RO

TL;DR

Multi-task reinforcement learning needs to exploit relations among tasks, yet existing methods often do not use available metadata to guide knowledge transfer. CARE learns multiple context-dependent, composable representations and uses task descriptions to select and combine them; it achieves state-of-the-art results on Meta-World’s 50-task benchmark. The paper also extends contextual MDPs to block contextual MDPs for task-dependent observation spaces.

  • Problem

    Existing multi-task reinforcement learning methods have limited ability to use task metadata for generalizable skill transfer and must manage potentially harmful negative interference.

  • Method

    CARE uses metadata-conditioned attention over a mixture of encoders to learn composable, context-dependent representations with a shared policy.

  • Results

    CARE achieves state-of-the-art results on Meta-World, a challenging benchmark containing 50 distinct robotic manipulation tasks.

  • Takeaways & Limitations

    Metadata can enable more efficient sharing of information across tasks through context-dependent representations used by a single policy.

  • Takeaways & Limitations

    Meta-World comparisons are sensitive to evaluation frequency because the benchmark uses binary success signals and reports best performance over evaluations.

Abstract

from arXiv · show

The benefit of multi-task learning over single-task learning relies on the ability to use relations across tasks to improve performance on any single task. While sharing representations is an important mechanism to share information across tasks, its success depends on how well the structure underlying the tasks is captured. In some real-world situations, we have access to metadata, or additional information about a task, that may not provide any new insight in the context of a single task setup alone but inform relations across multiple tasks. While this metadata can be useful for improving multi-task learning performance, effectively incorporating it can be an additional challenge. We posit that an efficient approach to knowledge transfer is through the use of multiple context-dependent, composable representations shared across a family of tasks. In this framework, metadata can help to learn interpretable representations and provide the context to inform which representations to compose and how to compose them. We use the proposed approach to obtain state-of-the-art results in Meta-World, a challenging multi-task benchmark consisting of 50 distinct robotic manipulation tasks.

1. Introduction

Multi-task reinforcement learning can improve real-world adaptability by transferring knowledge across tasks, but existing methods often fail to use available task metadata. CARE uses metadata to select and compose specialized representations, targeting more efficient sharing and reduced negative interference.

  • Multi-task reinforcement learning aims to help agents master multiple tasks sample-efficiently for real-world adaptation.
  • Existing MTRL methods generally cannot leverage task metadata, such as natural-language descriptions, to transfer generalizable skills across tasks.
  • Task metadata can provide a prior over multiple encoders and help select encoders for each task, enabling context-dependent knowledge sharing.
  • CARE is designed to provide fine-grained control over shared information, thereby alleviating negative interference between tasks.
  • CARE encodes observations into multiple skill- or object-related representations and uses task context to choose which representations to use for each task.
  • The paper reports improved sample efficiency and asymptotic performance together with state-of-the-art results on the 50-task Meta-World benchmark.

2. Preliminaries

The paper formulates metadata-aware multi-task reinforcement learning using contextual and block contextual MDPs. These settings represent task-specific rewards, transitions, and observations while allowing shared objects and skills across tasks.

  • An MDP is defined by states, actions, rewards, transitions, and a discount factor, with policies mapping states to action probabilities.
  • A contextual MDP augments an MDP with a context space and maps each context to task-specific reward and transition parameters.
  • In contextual multi-task settings, tasks can share a full state space while exposing task-dependent subspaces focused on relevant objects.
  • Different tasks may combine different objects and skills, causing their observed state spaces and reward functions to differ while object dynamics remain shared.
  • The BC-MDP extends the contextual MDP by mapping context to reward, transition, and observation-space parameters.
  • Meta-World instantiates this setting with 50 diverse robotic manipulation tasks sharing state and action dimensions but assigning different semantics to state dimensions.

3. A Method for Learning Contextual Attention-based Representations

CARE factorizes task state representations into reusable components and uses metadata to attend over a mixture of encoders. A shared policy then consumes the resulting context-conditioned representation across tasks.

  • A Method for Learning Contextual Attention-based Representations: CARE factorizes task state representations into reusable object- and skill-specific components within a BC-MDP task family.
  • A Method for Learning Contextual Attention-based Representations: A universal policy uses task metadata to select functional representations for each task, supporting compositional examples such as opening doors or drawers.
  • Contextual Attention based Representations: The learned representations are evaluated downstream with Soft Actor-Critic, while CARE itself can be paired with policy optimization methods.
  • Contextual Attention based Representations: Task descriptions are encoded with RoBERTa, projected through feedforward layers, and used as the context representation z_context.
  • Contextual Attention based Representations: CARE uses a context encoder and a mixture of k encoders, with the context determining attention over the encoder representations.
  • Contextual Attention based Representations: The normalized attention weights produce a weighted sum of encoder representations, which is concatenated with context and supplied to the policy network.
  • Contextual Attention based Representations: CARE provides a softer inductive bias than object-oriented learning by encouraging specialization without explicitly modeling interactions between encoders or objects.

4. Experiments

CARE is evaluated across Meta-World’s MT10 and MT50 suites, including low-sample, representation, metadata, interpretability, and zero-shot analyses. The experiments show strong performance, sample efficiency, metadata-dependent task structure, and benefits from compositional representations.

  • Benchmark evaluation: CARE is evaluated on Meta-World’s MT10 and MT50 suites, with results reported after 2 million and 100 thousand training steps.The benchmark contains 10-task and 50-task setups, and evaluations are averaged over multiple seeds.
  • Benchmark evaluation: CARE consistently outperforms other models on MT10 and is more sample efficient than competing baselines in the low-sample regime.The authors also report that PCGrad performs poorly in the low-sample MT10 setting.
  • Policy combinations: Using multi-headed SAC with CARE on MT50 yields a mean success of 0.61 with a standard error of 0.0287.This result illustrates that CARE can be combined with more powerful policies and learning algorithms.
  • Interpreting representations: Hand-coded mappings of tasks to encoders show that assigning encoders to specific objects and skills helps performance.The ablations also examine encoder count and hard attention as alternative design choices.
  • Metadata and compositionality: Metadata improves performance more than removing the encoder mixture, while combining metadata with multiple encoders produces the best performance.Using metadata with a single encoder remains comparable to other baselines, but the mixture provides an additional improvement.
  • Interpreting representations: CARE’s context representations exhibit task structure similar to pretrained task embeddings, whereas representations learned without metadata show weaker correlations.The comparison uses six encoders and cosine similarities across the ten MT10 tasks.
  • Zero-shot generalization: CARE generalizes better than FiLM in experiments involving zero-shot generalization to unseen environments.The comparison with PCGrad and Soft Modularization is described as unfair because those methods cannot generalize to unseen tasks.

5. Related Work

Related work studies multi-task learning, negative interference, contextual MDPs, metadata, and compositional models, while CARE conditions representation decomposition on metadata.

  • Multi-task reinforcement learning transfers useful information across tasks by exploiting shared properties and structure.
  • Negative interference can slow training, cause knowledge loss, and motivate methods that control which information is shared.Some approaches add O(n^2) complexity or ignore gradient components, reducing sample efficiency.
  • Contextual MDPs introduce side information for transfer, but prior formulations assume shared state spaces, smooth MDP parameters, or given contexts.
  • Metadata has been used for task relation discovery in supervised learning and for language-conditioned single-task reinforcement learning.
  • Prior compositional multi-task models decompose or route policies without conditioning module decomposition on metadata.

6. Discussion

The paper positions contextual information and CARE as tools for more efficient information sharing across multi-task reinforcement learning problems, while identifying broader settings for future extension.

  • The BC-MDP setting allows contextual multi-task problems where state spaces can differ across tasks.
  • CARE uses a mixture of encoders to learn context-dependent representations with a single policy across a family of tasks.
  • The study reports new state-of-the-art results on Meta-World, a benchmark containing 50 robotic manipulation tasks.
  • The explored context is limited to text descriptions, although people, places, and other contexts are proposed as extensions.
  • Rich observations could extend the framework toward more flexible but partially observable multi-task problems while retaining tractability through restricted settings.

A.1. Libraries

The implementation uses SAC to train CARE, whose context encoder and mixture of encoders are optimized through policy-related losses.

  • CARE training uses PyTorch, Hydra, MetaWorld, MTEnv, MTRL, NumPy, and Pandas.
  • SAC learns CARE representations using policy, value, and Q-function components.The method provides SAC pseudocode and key equations for training.
  • SAC updates: SAC uses current-policy action samples and an exponentially averaged target value network to stabilize training.
  • Context encoder: The context encoder is updated with the combined objective JC(ω) = JV + JQ + Jπ.
  • Mixture of encoders: Each encoder in the mixture is updated using the combined SAC losses JV + JQ + Jπ.

C.1. Ablations

CARE ablations examine encoder count, hard top-k selection, and manual task-to-encoder assignments, highlighting the trade-offs between performance, interpretability, and construction effort.

  • Encoder count: Too many encoders can hurt CARE performance.
  • Top-k encoders: Hard attention selects the top-k encoders, renormalizes their attention scores, and leaves the others inactive.
  • Top-k encoders: Hard attention performs less well than CARE’s soft attention but remains comparable to other baselines.
  • Manual assignment: Manual skill- and object-based encoder assignments work well and are interpretable, but are time consuming and error-prone.
  • Interpretability: The ablation supports explicitly assigning object and skill concepts to encoders as beneficial for multitask performance.

C.2. Effect of frequency of evaluation

Evaluation frequency affects reported Meta-World performance, so the experiments compare agents under a fixed evaluation schedule while also examining more frequent evaluation.

  • Evaluation frequency: Evaluating the agent more frequently improves performance across the baselines.
  • Evaluation frequency: Meta-World uses a binary success signal, making more frequent evaluation more likely to capture task solutions.
  • Evaluation protocol: The controlled setup evaluates every agent once every 10K environment steps per task.

D. Testing for statistical significance

The evaluation uses Welch’s two-tailed t-test and reports performance comparisons across MT10 and MT50 test environments under multiple training and evaluation conditions.

  • Statistical test: Welch’s two-tailed t-test compares mean performance between CARE and each baseline under unequal-variance assumptions.
  • MT10 evaluation: MT10 results are averaged over 10 seeds after 500 thousand training steps per environment, with significance marked for selected baselines.
  • MT50 evaluation: CARE outperforms the other baselines on MT50 after 500 thousand training steps per environment.
  • MT10 evaluation: MT10 results after 2 million training steps are averaged over 10 seeds, with CARE’s significant improvements marked for selected baselines.
  • Evaluation frequency: The frequency comparison evaluates agents after 1K and 10K steps and reports averaged results over 10 seeds.
Loading 2102.06177v2…