Generalizable Task Representation Learning for Offline Meta-Reinforcement Learning with Data Limitations

Renzhe Zhou, Chenxiao Gao, Zongzhang Zhang, Yang Yu

Introduction

Offline Meta-Reinforcement Learning (OMRL) aims to enable agents to adapt rapidly to new tasks by leveraging static, pre-collected datasets. This approach is vital for real-world applications like robotics and healthcare, where environment interaction is costly or dangerous. However, existing OMRL methods often struggle under two common real-world constraints: task abundance and behavior diversity. When training data is limited to a few tasks or collected by narrow policies, standard contrastive learning methods tend to overfit to "nuisance" features—such as specific noise or behavior patterns—rather than learning the underlying task physics. This leads to poor generalization in unseen environments.

The GENTLE Framework

To address these challenges, we introduce GENTLE (Generalizable Task representations Learning). GENTLE shifts the paradigm from discriminative contrastive learning to a generative reconstruction-based approach. The framework consists of two primary innovations:

1. Task Auto-Encoder (TAE)

Unlike contrastive methods that focus on distinguishing between tasks, the TAE utilizes a reconstruction loss. It encodes context into a task representation $z$, which is then used by a decoder to predict the next state and reward. This objective forces the encoder to capture the generative structure of the environment—its "physics"—which is inherently more stable and generalizable than discriminative features.

The GENTLE architecture featuring the Task Auto-Encoder (TAE) for learning generative task representations.

2. Data Augmentation via Relabeling

To mitigate limited behavior diversity, GENTLE employs a relabeling strategy. By using a pre-trained environment model and the current meta-policy, the framework generates pseudo-transitions: "If the current policy were in this state, what would the result be?" This aligns the training data distribution with the distribution the agent will encounter during testing, preventing the encoder from overfitting to the specific trajectories of the original data collectors.

Experimental Setup

GENTLE was evaluated on several continuous control benchmarks, including 2D Navigation and MuJoCo-based tasks (Ant-Dir, Cheetah-Vel, etc.). To simulate data scarcity, training was restricted to only 10 tasks (or fewer) using data from a single expert-level policy, ensuring low behavior diversity.

Key Results and Analysis

GENTLE consistently outperformed state-of-the-art baselines like FOCAL, CORRO, and BOReL across both given-context and one-shot adaptation protocols.

Latent Space Quality

A critical finding is the superior quality of GENTLE's latent space. While baseline methods often produced "intertwined" or messy task representations, t-SNE visualizations reveal that GENTLE forms tight, distinct clusters for different tasks. This clarity in the latent space directly correlates with the model's ability to generalize to unseen test tasks.

t-SNE visualizations comparing the task representations of GENTLE against baselines; GENTLE exhibits significantly clearer task separation.

Robustness to Context Shift

Many OMRL methods experience a significant performance drop when moving from expert-provided context to "one-shot" scenarios where the agent must collect its own context. GENTLE remains highly performant in these cases, thanks to the distribution alignment provided by its relabeling strategy.

Conclusion

GENTLE demonstrates that reconstruction-based objectives and strategic data relabeling can overcome the limitations of data-scarce Offline Meta-RL. By focusing on the underlying dynamics of the environment rather than simple task discrimination, GENTLE produces representations that are both robust and highly generalizable. Future work will explore extending this framework to environments with sparse rewards and optimizing the exploration strategies used during one-shot adaptation.

Summary updated

BibTeX
@inproceedings{zhou2024generalizable,
  author = {Renzhe Zhou and Chenxiao Gao and Zongzhang Zhang and Yang Yu},
  title = {{Generalizable Task Representation Learning for Offline Meta-Reinforcement Learning with Data Limitations}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i15.29658},
}
Figure