Introduction
In offline Reinforcement Learning (RL), the Decision Transformer (DT) treats RL as a sequence modeling problem. The Prompting Decision Transformer (PDT) extends this paradigm to handle multiple tasks by prepending a "prompt"—a snippet of an expert demonstration—to the input. This prompt essentially instructs the model to execute the task demonstrated in the example.
However, standard PDTs select these prompt segments uniformly at random from a pool of expert data. This approach assumes all expert segments are equally informative, which is rarely the case. Some segments demonstrate critical, unique maneuvers, while others show generic behaviors like simply moving forward. Randomly selecting uninformative segments leads to poor task identification and suboptimal performance. Previous attempts to optimize these prompts suffered from combinatorial explosion or struggled with high-dimensional data like pixels.
This paper introduces a scalable, bandit-based method for optimizing trajectory prompts in PDTs. By treating prompt selection as a structured bandit problem and utilizing the pre-trained model itself as a feature extractor, the authors achieve significant performance gains in multi-task and few-shot offline RL without ever updating the underlying model's weights.
Bandit-Based Prompt Tuning
To overcome the limitations of random sampling, the authors propose a Contextual Multi-Armed Bandit (CMAB) approach to learn which prompt segments yield the highest rewards at inference time.
Key innovations of this method include:
- Structured Bandit Architecture: Rather than attempting to find the perfect combination of $J$ segments—which creates a combinatorial nightmare—the authors treat each slot in the prompt as an independent bandit problem. This structural assumption reduces the search complexity from combinatorial to linear.
- PDT as a Feature Extractor: To enable the bandit to operate in high-dimensional environments (such as pixel-based games), the method leverages the pre-trained PDT’s internal embeddings as features. Consequently, the bandit learns from the "concepts" the PDT already understands rather than raw pixels.
- Theoretical Regret Bounds: The authors mathematically prove that their "independence assumption" (treating prompt slots as independent) still guarantees sublinear regret, ensuring the system reliably converges toward the optimal prompts over time.
Experimental Setup and Key Insights
The researchers evaluated their method across several benchmarks, including classic continuous control tasks in MuJoCo (Half Cheetah and Ant), robotic manipulation in Meta-world (Pick-place), and custom environments like a Sparse 2D Point task designed to visualize prompt space exploration.
A major insight from the study is the confirmation of the "informativeness gap." Random sampling is a significant bottleneck for PDTs; simply selecting better examples from the same dataset yields substantial performance jumps. Furthermore, treating prompt segments as independent slots proved highly effective. This suggests that PDTs are trained to attend to individual informative transitions rather than complex global interactions between different prompt segments.
Key Results
The bandit-tuned PDT demonstrated superior performance across the board. It consistently outperformed both the vanilla PDT and other optimization baselines, such as Hill-climbing and ZORankSGD, across all MuJoCo and Meta-world tasks.
Notably, in the MuJoCo Ant environment, the tuned PDT actually surpassed the single-task CQL oracle—a model trained specifically and exclusively for that single task. The bandit method also exhibited remarkable robustness to noise. When the demonstration pool was polluted with non-expert (novice) data, the bandit successfully identified the few available expert segments, whereas the random baseline failed completely. Finally, the method showed strong Out-of-Distribution (OOD) generalization on tasks the model hadn't seen during training, effectively bridging the gap between pre-training and adaptation.
Limitations and Future Directions
While the structured bandit approach reduces search complexity to linear time, the search space still scales with the number of available demonstrations. In scenarios with millions of expert transitions, the bandit must still evaluate a massive number of "arms." Additionally, like all offline RL methods, this approach is fundamentally constrained by the data it has seen; it can optimize the use of existing knowledge but cannot extrapolate entirely new behaviors absent from the offline dataset.
Future work may explore developing a "learned sampler" capable of pre-filtering high-potential segments or clustering similar prompts. This would further reduce redundancy and accelerate the search process in massive datasets.
Summary updated