Decision Transformer: Reinforcement Learning via Sequence Modeling

Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Michael Laskin, Pieter Abbeel, Aravind Srinivas, Igor Mordatch

2021 · NeurIPS

Decision Transformer: Reinforcement Learning via Sequence Modeling

Problem

Framing

Offline RL still relies on value estimation, bootstrapping, and pessimism to recover good policies from fixed data. This paper replaces that stack with conditional sequence modeling: a causal Transformer predicts actions from desired return-to-go, past states, and past actions, matching or exceeding strong offline RL baselines on Atari and D4RL.

Currently Used Methods

Foundational

Proposed Method

Architecture

Decision Transformer packs each timestep as return-to-go, state, and action tokens, then feeds the last KK steps as 3K3K tokens to a causally masked GPT. Each modality has its own embedding layer, timestep embeddings are shared across the three tokens of a step, and the hidden state at each state token predicts the next action.

Architecture diagram: return, state, and action tokens are interleaved, embedded with timestep encodings, passed through a causal transformer, and decoded autoregressively into actions.

Loss / Objective

Training reduces to next-action prediction on offline trajectories.

τ^=(R^1,s1,a1,R^2,s2,a2,,R^T,sT,aT)\hat{\tau} = (\hat{R}_1, s_1, a_1, \hat{R}_2, s_2, a_2, \ldots, \hat{R}_T, s_T, a_T) L(θ)=1Kt=1K(πθ(atR^1,s1,a1,,R^t,st),at)\mathcal{L}(\theta) = \frac{1}{K}\sum_{t=1}^{K} \ell\big(\pi_\theta(a_t \mid \hat{R}_1, s_1, a_1, \ldots, \hat{R}_t, s_t),\, a_t\big) ={logpθ(at)discrete actionsa^tat2continuous actions\ell = \begin{cases} -\log p_\theta(a_t \mid \cdot) & \text{discrete actions} \\ \|\hat{a}_t - a_t\|^2 & \text{continuous actions} \end{cases}

Sampling Rule / Algorithm

At test time, the model conditions on a target return and rolls it forward autoregressively.

a^tπθ(atR^1,s1,a1,,R^t,st)\hat{a}_t \sim \pi_\theta\big(a_t \mid \hat{R}_1, s_1, a_1, \ldots, \hat{R}_t, s_t\big) R^t+1=R^trt\hat{R}_{t+1} = \hat{R}_t - r_t

Training Procedure

Evaluation

Datasets

Metrics

Headline results

Results bar chart: Decision Transformer versus TD learning and behavior cloning on Atari, OpenAI Gym, and Key-to-Door; it leads on Gym and Key-to-Door and is competitive on Atari.

Ablations

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers