All models

decision_transformer_atari_tiny

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

Reinforcement learning and control · 221 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 (20 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
2.2M
Operations
221
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
m4125
Graph hash
1b6d01993076d78530b83f8248ed7970948dc4664a9a92896311e4061f5c6312
Skeleton hash
7886088844e3d4fae71df8a61be82c2b5a1d9ca760aca01c60c028df884d02cd
Architecture hash
34c4008341876245d8185ef8ade773e7eb5d2d9d06e269eb749fbbb07df78d59
Diagram SHA-256
916d5e280cd4c513475284c2a7b71ba192e8375e1d3f2c153b587f2fa1a6bdac
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}, 
}