Hugging FaceEdward Beeching, Thomas SimoniniAnnouncement
Introducing Decision Transformers on Hugging Face 🤗
Summary
Hugging Face has integrated the Decision Transformer architecture into its transformers library and Hub, expanding support for offline reinforcement learning. Unlike standard reinforcement learning methods that maximize returns by learning value functions or policies through active environment interaction, Decision Transformers model trajectories as conditional sequence problems. The model feeds past states, actions, and target returns-to-go over a context window into a GPT-2 autoregressive backbone to generate future actions. Evaluating pre-trained continuous control checkpoints requires standardizing observations with training set statistics and iteratively updating the target return based on received rewards. This sequence modeling paradigm enables practitioners to adjust agent behaviors and skill levels directly by specifying different target returns at runtime.
Context
Online deep reinforcement learning requires agents to learn via trial and error either in the real world or inside complex, costly simulators that risk being exploited. Offline reinforcement learning circumvents interactive training by learning policies from static datasets of prior demonstrations, but standard offline approaches still face challenges such as counterfactual query handling.
Approach / What changed
Hugging Face added Decision Transformers to the transformers library alongside pre-trained checkpoints for Gym environments like Hopper, Walker2D, and Halfcheetah. The architecture treats reinforcement learning as an autoregressive sequence modeling problem using a GPT-2 backbone conditioned on return-to-go, states, and actions to predict subsequent actions.
Takeaways
Decision Transformer models trajectory sequences autoregressively with a GPT architecture instead of relying on conventional value function fitting or policy gradients.
Inference requires passing a context window of tokens (states, actions, returns-to-go, and timesteps) and normalizing inputs using the mean and standard deviation from training.
Conditioning the model on target returns enables direct control over agent performance at test time, such as modulating opponent bot difficulty in games.
Source and freshness
- Source
- huggingface.co
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.