All models

decision_transformer_tiny

A GPT that reads returns, states and actions and writes the actions that reach a target return.

Reinforcement learning and control · 177 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (35 KB)

Open in a new tab

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.

At a glance

Parameters
858.8K
Operations
177
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2021
Cited by
464 (as of 5 October 2026)
Authors
Lili Chen, Kevin Lu, Aravind Rajeswaran and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m4126
Graph hash
53fc6c4c150c88fb50b8fb21c7b8d1570f3474514ff9c728ab8247efe97bc60f
Skeleton hash
95866ba4e4bb9b37b49816e3577162e0db849674852a989b58453c4dedd589af
Architecture hash
ad0e98084c72db4ffb39e29ea3fffa935b1217d0d8f0765736e630db9bc07e11
Diagram SHA-256
d17611935054b296658c817ab4c735231f07326cfbe8a6af1c97d8f0a69335a7
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

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.

  • Decision Transformer
  • DecisionTransformer
  • DT
  • offline RL
  • reinforcement learning via sequence modeling
  • return-to-go
  • GPT
  • Atari
  • OpenAI Gym
  • Key-to-Door

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@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}, 
}