[Paper Review] Prompting Decision Transformer for Few-Shot Policy Generalization
This paper proposes Prompt-DT, a prompt-based Decision Transformer that enables few-shot policy generalization in offline reinforcement learning by conditioning on short trajectory prompts from a few demonstrations. Without any fine-tuning on unseen tasks, Prompt-DT outperforms strong meta-offline RL baselines and generalizes to out-of-distribution tasks, demonstrating robustness to prompt length and high sensitivity to prompt quality.
Humans can leverage prior experience and learn novel tasks from a handful of demonstrations. In contrast to offline meta-reinforcement learning, which aims to achieve quick adaptation through better algorithm design, we investigate the effect of architecture inductive bias on the few-shot learning capability. We propose a Prompt-based Decision Transformer (Prompt-DT), which leverages the sequential modeling ability of the Transformer architecture and the prompt framework to achieve few-shot adaptation in offline RL. We design the trajectory prompt, which contains segments of the few-shot demonstrations, and encodes task-specific information to guide policy generation. Our experiments in five MuJoCo control benchmarks show that Prompt-DT is a strong few-shot learner without any extra finetuning on unseen target tasks. Prompt-DT outperforms its variants and strong meta offline RL baselines by a large margin with a trajectory prompt containing only a few timesteps. Prompt-DT is also robust to prompt length changes and can generalize to out-of-distribution (OOD) environments.
Motivation & Objective
- To investigate whether architectural inductive bias, particularly in Transformers, can enhance few-shot generalization in offline reinforcement learning.
- To address the challenge of generalizing to unseen tasks in offline RL, where distribution shift limits performance.
- To explore prompt-based learning from natural language processing as a new paradigm for few-shot adaptation in offline RL.
- To develop a method that enables zero-shot or few-shot adaptation without task-specific fine-tuning.
Proposed method
- The method uses a Decision Transformer architecture trained to predict optimal trajectories conditioned on a trajectory prompt composed of a few demonstration transitions.
- The trajectory prompt is constructed from a few timesteps of expert or medium-quality demonstrations from the same task distribution.
- The model is trained end-to-end on offline datasets from multiple tasks, learning to generate policies conditioned on the prompt and history.
- During inference, the model generates policies for new tasks using only a short trajectory prompt, without any parameter updates or fine-tuning.
- The approach leverages the sequential modeling strength of Transformers to capture long-range dependencies in trajectory data.
- The prompt length is treated as a hyperparameter, and the model is evaluated for robustness to prompt length variations.
Experimental results
Research questions
- RQ1Can a prompt-based framework from NLP be effectively adapted to offline reinforcement learning for few-shot policy generalization?
- RQ2How does the quality of the trajectory prompt affect policy generalization performance in unseen tasks?
- RQ3Can the model generalize to out-of-distribution tasks, such as those with goal ranges outside the training distribution?
- RQ4How does the model’s performance vary with different prompt lengths and prompt construction strategies?
- RQ5Is the prompt-based approach more effective than standard meta-offline RL methods like MACAW?
Key findings
- Prompt-DT outperforms the strong meta-offline RL baseline MACAW by a large margin across five MuJoCo control benchmarks without any fine-tuning on target tasks.
- The model generalizes to out-of-distribution tasks, such as Ant-dir with target directions outside the training range, where prior methods fail.
- Prompt-DT is robust to changes in prompt length when trained on expert data, maintaining strong performance across different prompt lengths.
- The model’s performance is highly sensitive to prompt quality: expert prompts lead to high returns, while random prompts result in poor performance.
- Ablation studies confirm that prompt quality significantly influences generalization, with performance dropping sharply when prompts are low-quality or from random data.
- The method generalizes to novel tasks with only 15 or fewer timesteps in the prompt, demonstrating strong few-shot learning capability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.