A Minimalist Prompt for Zero-Shot Policy Learning

Meng Song, Xuezhi Wang, Tanay Biradar, Yao Qin, Manmohan ChandrakerarXiv 2024

Abstract

Transformer-based methods have exhibited significant generalization ability when prompted with target-domain demonstrations or example solutions during inference. Although demonstrations, as a way of task specification, can capture rich information that may be hard to specify by language, it remains unclear what information is extracted from the demonstrations to help generalization. Moreover, assuming access to demonstrations of an unseen task is impractical or unreasonable in many real-world scenarios, especially in robotics applications. These questions motivate us to explore what the minimally sufficient prompt could be to elicit the same level of generalization ability as the demonstrations. We study this problem in the contextual RL setting which allows for quantitative measurement of generalization and is commonly adopted by meta-RL and multi-task RL benchmarks. In this setting, the training and test Markov Decision Processes (MDPs) only differ in certain properties, which we refer to as task parameters. We show that conditioning a decision transformer on these task parameters alone can enable zero-shot generalization on par with or better than its demonstration-conditioned counterpart. This suggests that task parameters are essential for the generalization and DT models are trying to recover it from the demonstration prompt. To extract the remaining generalizable information from the supervision, we introduce an additional learnable prompt which is demonstrated to further boost zero-shot generalization across a range of robotic control, manipulation, and navigation benchmark tasks.

Introduction

In the evolving landscape of foundation models for robotics, the Decision Transformer (DT) has emerged as a prominent architecture for offline reinforcement learning. A common paradigm for adapting DTs to novel tasks is "prompting," where the model is provided with a few expert demonstrations to specify the desired behavior. However, this approach faces two significant challenges. First, requiring expert demonstrations for an unseen task at test time is often impractical; if a solution is already available, the need for an autonomous agent is diminished. Second, the information extracted from high-dimensional demonstrations (e.g., video or state-action trajectories) is often ambiguous, making it difficult to discern whether the model is learning task goals or specific environmental dynamics.

This work investigates the "minimally sufficient prompt"—the smallest set of information required to enable zero-shot generalization in robotic agents. We hypothesize that task parameters, which explicitly define the differences between training and test environments, are the primary drivers of generalization.

Methodology: Minimalist Prompting

We propose the Minimalist Prompting Decision Transformer, which replaces complex trajectory-based prompts with a structured input consisting of two primary components:

  1. Task Parameters ($c$): Low-dimensional, interpretable values that define the specific task instance. Examples include target velocities for locomotion or goal coordinates for manipulation.
  2. Learnable Prompt ($z$): A set of "soft" tokens (embeddings) optimized during training. While $c$ specifies the "what" (the goal), $z$ captures the "how" (shared physics and control logic across tasks).
Architecture of the Minimalist Prompting Decision Transformer, incorporating task parameters $c$ and learnable prompts $z$.

The model is trained using Behavior Cloning (BC) to map these minimalist prompts, along with the current state and target return, directly to actions. This architecture allows the agent to bypass the need for test-time demonstrations, achieving true zero-shot generalization.

Experimental Evaluation

The proposed method was evaluated across several diverse robotics benchmarks:

  • MACAW (Control): Includes Cheetah-Velocity and Ant-Direction.
  • Meta-world (Manipulation): Includes ML1-Reach, ML1-Push, and ML1-Pick-Place.
  • ML10: A multi-skill benchmark requiring the mastery of 10 distinct robotic skills.
  • D4RL Maze2D (Navigation): A continuous navigation task with unseen goal locations.

Results and Analysis

The experimental results demonstrate that minimalist prompting consistently outperforms state-of-the-art demonstration-based methods, such as Trajectory-DT.

Zero-shot performance of Task-Learned-DT compared to baselines across various robotic benchmarks.

Key Findings

  • Task Parameters as Primary Drivers: Conditioning on task parameters alone often yields better generalization than using full expert demonstrations. This suggests that demonstration-conditioned models primarily attempt to infer these underlying parameters.
  • Efficacy of Learnable Prompts: While task parameters are sufficient for simpler tasks, the learnable prompt ($z$) is crucial for complex environments like ML10, where it serves as a repository for shared "common sense" knowledge across skills.
  • Zero-Shot Superiority: In the Ant-Direction task, our minimalist prompt achieved a score of 110.35, significantly higher than the 89.04 achieved by the few-shot Trajectory-DT. Similarly, on the ML10 benchmark, Task-Learned-DT scored 74.56 versus 63.14 for the baseline.
  • Robustness: The method maintains high performance even when trained on suboptimal (medium or random) data, whereas demonstration-based methods are highly sensitive to the quality of the provided prompt.

Discussion and Conclusion

Our findings suggest that an ideal prompt for robotic agents should focus on the "what" (the goal) rather than the "how" (the trajectory). By stripping away redundant trajectory information, the model becomes more robust and practical for real-world deployment.

Current limitations include sensitivity to the length of the learnable prompt ($z$) and the requirement for a pre-specified "target return." Future research will explore automated prompt length optimization and the integration of natural language descriptions to define task parameters more intuitively. Ultimately, minimalist prompting offers a more efficient and realistic path toward general-purpose robotic agents.

Summary updated

Abstract

Transformer-based methods have exhibited significant generalization ability when prompted with target-domain demonstrations or example solutions during inference. Although demonstrations, as a way of task specification, can capture rich information that may be hard to specify by language, it remains unclear what information is extracted from the demonstrations to help generalization. Moreover, assuming access to demonstrations of an unseen task is impractical or unreasonable in many real-world scenarios, especially in robotics applications. These questions motivate us to explore what the minimally sufficient prompt could be to elicit the same level of generalization ability as the demonstrations. We study this problem in the contextural RL setting which allows for quantitative measurement of generalization and is commonly adopted by meta-RL and multi-task RL benchmarks. In this setting, the training and test Markov Decision Processes (MDPs) only differ in certain properties, which we refer to as task parameters. We show that conditioning a decision transformer on these task parameters alone can enable zero-shot generalization on par with or better than its demonstration-conditioned counterpart. This suggests that task parameters are essential for the generalization and DT models are trying to recover it from the demonstration prompt. To extract the remaining generalizable information from the supervision, we introduce an additional learnable prompt which is demonstrated to further boost zero-shot generalization across a range of robotic control, manipulation, and navigation benchmark tasks.
BibTeX
@misc{song2024minimalist,
  author = {Meng Song and Xuezhi Wang and Tanay Biradar and Yao Qin and Manmohan Chandraker},
  title = {{A Minimalist Prompt for Zero-Shot Policy Learning}},
  year = {2024},
  eprint = {2405.06063},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.06063},
}
Figure