On the Power of Multitask Representation Learning in Linear MDP

Rui Lu, Gao Huang, Simon S. DuarXiv 2021

Abstract

While multitask representation learning has become a popular approach in reinforcement learning (RL), theoretical understanding of why and when it works remains limited. This paper presents analyses for the statistical benefit of multitask representation learning in linear Markov Decision Process (MDP) under a generative model. We consider an agent learning a representation function $\phi$ from $T$ source tasks and then using it for a new task. We discover a Least-Activated-Feature-Abundance (LAFA) criterion, $\kappa$, and prove that multitask learning reduces the required samples for a new task from $O(\mathcal{C}(\Phi)^2\kappa d H^4)$ to $O(\kappa d H^4)$. This theoretically explains the power of multitask representation learning in reducing sample complexity.

Introduction

Reinforcement Learning (RL) is notoriously "sample hungry," often requiring millions of interactions to learn effective policies in environments with large state or action spaces. A common empirical strategy to mitigate this is multitask representation learning: training an agent on several related tasks to learn a shared "feature extractor" (representation), then reusing that extractor for new tasks. While this works well in practice, a deep theoretical understanding of why and when it provides a statistical advantage has been lacking. This paper addresses this gap by analyzing Linear Markov Decision Processes (MDPs) and quantifying the sample complexity reduction.

Methodology: Representation Learning in Linear MDPs

The authors study this through the lens of Linear MDPs, where transition dynamics and rewards are linear functions of underlying features. They propose a two-stage least-squares approach:

  1. Representation Learning Stage: The agent collects data from $T$ source tasks and solves an Empirical Risk Minimization (ERM) problem to find a representation function $\phi$ (from a large class $\Phi$) that best explains the rewards and transitions across all tasks.
  2. Target Task Stage: Given a new task, the agent freezes the learned $\hat{\phi}$ and only needs to learn a simple linear weight vector $w$ for that specific task.

A key contribution is the introduction of the Least-Activated-Feature-Abundance (LAFA) criterion, $\kappa$. This metric quantifies how well the sampling distribution "covers" the feature space. If certain features are rarely seen during training on the new task, $\kappa$ becomes large, making it harder to learn an optimal policy even with a perfect representation.

Empirical Validation

To corroborate their theory, the authors used a Noisy Grid-World environment. The agent moves in a 5x5 grid (19 valid positions) but receives 100-dimensional observations, where 81 dimensions are purely random Gaussian noise. This setup tests the agent's ability to ignore noise and extract the relevant 19-dimensional spatial structure.

The learned representation successfully identifies the 19 relevant spatial features while ignoring the 81 noisy dimensions across different actions.

As shown above, the learned representation effectively isolates the relevant features. The most significant result is the gain in sample efficiency. In experiments, the multitask agent reached near-optimal performance on a new task with only ~300 samples, whereas an agent learning from scratch required ~10,000 samples.

Comparison of cumulative rewards over time. The multitask approach ("use phi") significantly outperforms learning from scratch, reaching optimality with orders of magnitude fewer samples.

Key Insights and Results

  • Complexity Shift: The most important finding is that multitask learning changes the "scaling law" of RL. Without it, the samples needed for a new task depend on the complexity of the entire function class $\mathcal{C}(\Phi)$. With a pre-learned representation, it only depends on the dimension of the representation $d$.
  • The Importance of Coverage: The LAFA criterion shows that a good representation isn't enough; the sampling strategy must be balanced. If the agent stays in one corner of the grid, the benefits of the learned representation vanish, suggesting that adaptive sampling is a necessary partner to representation learning.
  • Theoretical Bound: The sub-optimality gap is proven to be $\tilde{O}\left(H^2 \sqrt{\frac{\mathcal{C}(\Phi)^2 \kappa d}{NT} + \frac{\kappa d}{n}}\right)$, where $H$ is the horizon, $N$ is samples per source task, and $n$ is samples for the new task.

Conclusion

This work provides the first theoretical result showing that representation learning provably improves sample efficiency in Linear MDPs. While the current analysis assumes a generative model and perfect optimization, it sets the stage for future research into online exploration and more complex task relationships.

Summary updated

Abstract

While multitask representation learning has become a popular approach in reinforcement learning (RL), theoretical understanding of why and when it works remains limited. This paper presents analyses for the statistical benefit of multitask representation learning in linear Markov Decision Process (MDP) under a generative model. In this paper, we consider an agent to learn a representation function $\phi$ out of a function class $\Phi$ from $T$ source tasks with $N$ data per task, and then use the learned $\hat{\phi}$ to reduce the required number of sample for a new task. We first discover a \emph{Least-Activated-Feature-Abundance} (LAFA) criterion, denoted as $\kappa$, with which we prove that a straightforward least-square algorithm learns a policy which is $\tilde{O}(H^2\sqrt{\frac{\mathcal{C}(\Phi)^2 \kappa d}{NT}+\frac{\kappa d}{n}})$ sub-optimal. Here $H$ is the planning horizon, $\mathcal{C}(\Phi)$ is $\Phi$'s complexity measure, $d$ is the dimension of the representation (usually $d\ll \mathcal{C}(\Phi)$) and $n$ is the number of samples for the new task. Thus the required $n$ is $O(\kappa d H^4)$ for the sub-optimality to be close to zero, which is much smaller than $O(\mathcal{C}(\Phi)^2\kappa d H^4)$ in the setting without multitask representation learning, whose sub-optimality gap is $\tilde{O}(H^2\sqrt{\frac{\kappa \mathcal{C}(\Phi)^2d}{n}})$. This theoretically explains the power of multitask representation learning in reducing sample complexity. Further, we note that to ensure high sample efficiency, the LAFA criterion $\kappa$ should be small. In fact, $\kappa$ varies widely in magnitude depending on the different sampling distribution for new task. This indicates adaptive sampling technique is important to make $\kappa$ solely depend on $d$. Finally, we provide empirical results of a noisy grid-world environment to corroborate our theoretical findings.
BibTeX
@misc{lu2021power,
  author = {Rui Lu and Gao Huang and Simon S. Du},
  title = {{On the Power of Multitask Representation Learning in Linear MDP}},
  year = {2021},
  eprint = {2106.08053},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.08053},
}
Figure