
DecisionTransformer
Reinforcement learning and control177 ops1.3M params
A GPT that reads returns, states and actions and writes the actions that reach a target return.
Reinforcement learning and control · 177 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
About this model's family
Decision Transformer treats reinforcement learning as a sequence modeling problem, the kind of problem language models already solve. Instead of fitting value functions or policy gradients, it feeds a causally masked Transformer a trajectory and lets it output actions. The trick is conditioning: given a desired return, past states and actions, the autoregressive model generates future actions that achieve that return. The paper reports that this simple recipe matches or exceeds state-of-the-art model-free offline RL baselines on Atari, OpenAI Gym and Key-to-Door tasks.
Each of the last K timesteps becomes three tokens, one each for return-to-go, state and action, so the model sees 3K tokens. A separate linear layer per modality projects raw inputs to the embedding dimension, followed by layer normalization. A learned embedding for each timestep is added to each token, which differs from a standard positional embedding because one timestep spans three tokens.
Only the action is predicted: the head on each state token is trained with cross-entropy for discrete actions or mean-squared error for continuous ones. The authors did not find that predicting states or returns-to-go improved performance. At test time the target return is decremented by the achieved reward after each executed action, and generation repeats until the episode ends.
The traced members come from the official codebase, which ships separate atari and gym sub-directories. The Atari member runs its frames through a convolutional encoder instead of a linear layer before they become state tokens. The README notes that the code is not an official Google or Facebook product.
Key idea. Decision Transformer casts offline reinforcement learning as conditional sequence modeling with a causally masked Transformer, generating actions that achieve a desired return rather than fitting value functions or policy gradients.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{chen2021decisiontransformerreinforcementlearning,
title={Decision Transformer: Reinforcement Learning via Sequence Modeling},
author={Lili Chen and Kevin Lu and Aravind Rajeswaran and Kimin Lee and Aditya Grover and Michael Laskin and Pieter Abbeel and Aravind Srinivas and Igor Mordatch},
year={2021},
eprint={2106.01345},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2106.01345},
}