Skip to main content
QUICK REVIEW

[Paper Review] Contextual Transformer for Offline Meta Reinforcement Learning

Runji Lin, Ye Li|arXiv (Cornell University)|Nov 15, 2022
Reinforcement Learning in RoboticsComputer Science4 citations
TL;DR

This paper proposes Contextual Meta Transformer (CMT), a novel offline meta-reinforcement learning framework that leverages prompt tuning and self-supervised pretraining on offline trajectories to improve policy generalization. By treating task-specific context as prompts, CMT enables zero-shot adaptation across unseen tasks with superior performance on D4RL, MuJoCo, and SMAC benchmarks.

ABSTRACT

The pretrain-finetuning paradigm in large-scale sequence models has made significant progress in natural language processing and computer vision tasks. However, such a paradigm is still hindered by several challenges in Reinforcement Learning (RL), including the lack of self-supervised pretraining algorithms based on offline data and efficient fine-tuning/prompt-tuning over unseen downstream tasks. In this work, we explore how prompts can improve sequence modeling-based offline reinforcement learning (offline-RL) algorithms. Firstly, we propose prompt tuning for offline RL, where a context vector sequence is concatenated with the input to guide the conditional policy generation. As such, we can pretrain a model on the offline dataset with self-supervised loss and learn a prompt to guide the policy towards desired actions. Secondly, we extend our framework to Meta-RL settings and propose Contextual Meta Transformer (CMT); CMT leverages the context among different tasks as the prompt to improve generalization on unseen tasks. We conduct extensive experiments across three different offline-RL settings: offline single-agent RL on the D4RL dataset, offline Meta-RL on the MuJoCo benchmark, and offline MARL on the SMAC benchmark. Superior results validate the strong performance, and generality of our methods.

Motivation & Objective

  • To address the lack of self-supervised pretraining and efficient fine-tuning in offline reinforcement learning.
  • To improve zero-shot and few-shot generalization in meta-RL by encoding task context as learnable prompts.
  • To extend sequence modeling-based offline RL to meta-RL settings using contextual prompts for improved policy transfer.
  • To develop a unified framework that pretrains on offline data and adapts via prompt tuning for diverse downstream tasks.

Proposed method

  • Pretrain a transformer-based model on offline trajectories using an autoregressive reconstruction loss with policy prompts.
  • Introduce prompt tuning: learnable context vectors are concatenated with input sequences to condition policy generation.
  • Use contrastive loss to cluster similar trajectories and learn discriminative prompts for different behaviors.
  • Apply behavioral constraint during fine-tuning to prevent distribution shift and overfitting.
  • Extend the framework to meta-RL by using task-specific context sequences as prompts for zero-shot adaptation.
  • Leverage a world model for planning during prompt optimization to improve reward-seeking behavior.

Experimental results

Research questions

  • RQ1Can prompt tuning improve sample efficiency and performance in offline reinforcement learning?
  • RQ2How effective is prompt tuning in enabling zero-shot adaptation across unseen meta-RL tasks?
  • RQ3What is the impact of contrastive loss and behavioral constraints on prompt quality and policy generalization?
  • RQ4Can a sequence modeling approach effectively solve offline meta-RL problems with minimal task-specific adaptation?
  • RQ5How does the quality of task prompts (e.g., expert vs. medium vs. no context) affect zero-shot performance?

Key findings

  • Prompt tuning improves average return by 65.8% compared to baseline models without prompt tuning.
  • Contrastive loss is critical: reducing its coefficient to 10^-6 causes a 50.9% drop in average return due to poor prompt clustering.
  • Behavioral constraint is essential: removing it (coefficient = 0) leads to a 128% performance drop, indicating severe overfitting.
  • Using offline task prompts (medium or expert quality) improves performance by 4% and 7% respectively over zero-shot adaptation with online context.
  • The full CMT model with all components achieves state-of-the-art performance on D4RL, MuJoCo, and SMAC benchmarks.
  • CMT is the first sequence modeling-based method for offline meta-RL, demonstrating strong generalization across diverse environments.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.