Decision Transformer with Task-Aware Representations for Offline Meta-Reinforcement Learning
Organizations: State University of New York at Binghamton · San Diego State University · LinkedIn
Abstract
To enable effective generalization in offline meta-RL, it is essential to accurately infer the underlying task through latent task representations, which provide a compact and transferable summary of task-specific characteristics for guiding policy generation. In this paper, we propose Contrastive Task-Aware Decision Transformer (CoTA-DT), a DT-based offline meta-RL framework that learns task representations by jointly integrating four complementary components: (i) contrastive learning from offline trajectories, (ii) alignment with natural-language task descriptions, (iii) one-step supervision via a task-conditioned world model, and (iv) long-term supervision via a task-conditioned Q function. The learned task representations are used as conditioning signals for a DT-based policy, enabling task-aware meta-policy learning. To further support generalization in both zero-shot and few-shot settings, we design a language-grounded, self-adaptive strategy that enables effective and reliable adaptation to unseen tasks. Notably, in CoTA-DT, the pretrained LLM serves as a shared backbone for language encoding, world modeling, Q-function estimation, and policy learning. This unified design facilitates parameter sharing, improving both efficiency and generalization. Extensive experiments across diverse offline meta-RL benchmarks demonstrate that CoTA-DT consistently outperforms prior methods, particularly in challenging zero-shot generalization scenarios.
Figures & tables
| BC-Z | BAKU | Prompt-DT | Meta-DT | UNICORN | T2DA-T | CoTA-DT | |
|---|---|---|---|---|---|---|---|
| Pt-Robot | |||||||
| Cheetah-Vel | |||||||
| Ant-Dir | |||||||
| Meta-World |
| BC-Z | BAKU | Prompt-DT | Meta-DT | UNICORN | T2DA-T | CoTA-DT | |
|---|---|---|---|---|---|---|---|
| Pt-Robot | |||||||
| Cheetah-Vel | |||||||
| Ant-Dir | |||||||
| Meta-World |
| Quality | BC-Z | BAKU | Prompt-DT | Meta-DT | T2DA-T | CoTA-DT | |
|---|---|---|---|---|---|---|---|
| Expert | Pt-Robot | ||||||
| Meta-World | |||||||
| Medium | Pt-Robot | ||||||
| Meta-World |
| Environment | CoTA-DT (full) | w/o | w/o | w/o | w/o | w/o LLM |
|---|---|---|---|---|---|---|
| Pt-Robot | ||||||
| Cheetah-Vel | ||||||
| Ant-Dir | ||||||
| Meta-World |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Environment | # Tasks | Train/Test | Task variation | |||
|---|---|---|---|---|---|---|
| Point-Robot | 50 | 45/5 | 2 | 2 | 20 | Target position |
| Cheetah-Vel | 50 | 45/5 | 20 | 6 | 200 | Target velocity |
| Ant-Dir | 50 | 45/5 | 27 | 8 | 200 | Target heading |
| Meta-World | 22 | 18/4 | 39 | 4 | 200 | Diverse manipulation |
| Group | Hyperparameter | Value |
| Backbone | LLM backbone | LLaMA-3.2 1B (frozen) |
| Hidden size | 2048 | |
| LoRA rank / | 8 / 16 | |
| LoRA target modules | q_proj , v_proj (all layers) | |
| Context encoder | Architecture | 1-layer GRU |
| Hidden / output dim | 256 / |
| Hyperparameter | Value | Test return |
|---|---|---|
| Default (CoTA-DT) | — | |
| ( weight, default ) | ||
| ( weight, default ) |
| Backbone | # params | Hidden dim | Trainable LoRA | Pt-Robot | Meta-World |
|---|---|---|---|---|---|
| GPT-2 small ( Radford et al., 2019 ) | 117M | 768 | 0.39M | ||
| Qwen-2.5 0.5B ( Yang and others, 2024 ) | 0.5B | 1024 | 0.55M | ||
| Qwen-2.5 1.5B ( Yang and others, 2024 ) | 1.5B | 1536 | 0.95M | ||
| LLaMA-3.2 1B ( Touvron et al., 2023 ) | 1.2B | 2048 | 0.85M |
| Description style | Test return | vs. Standard |
|---|---|---|
| Minimal | ||
| Standard (default) | — | |
| Noisy |
| Configuration | Text encoder | Seeds | Pt-Robot | Meta-World |
|---|---|---|---|---|
| T2DA-T (reproduced) | Pretrained CLIP | 5 | ||
| w/o LLM (small DT) | Separate pretrained CLIP | 5 | ||
| Random-init 1B + LoRA | Random-init shared backbone | 5 | ||
| CoTA-DT (full) | Pretrained shared backbone | 5 |
| Point-Robot | Meta-World | ||||||
|---|---|---|---|---|---|---|---|
| Mode | |||||||
| static | |||||||
| online | |||||||
| inversion only | |||||||
| finetune | |||||||
Meta-Reinforcement Learning
Meta-reinforcement learning trains agents across tasks so they can adapt quickly to new environments or objectives.
See all 43 papers