Introducing Decision Transformers on Hugging Face 🤗
Decision Transformer, an offline reinforcement learning method that recasts RL as return-conditioned sequence modeling, is now part of the 🤗 transformers library, with nine pretrained checkpoints for Gym continuous-control tasks (Hopper, Walker2D, HalfCheetah). Instead of fitting a value function, a GPT-2 model takes the last K timesteps of return-to-go, state and action tokens and autoregressively predicts actions that reach a desired return. Code covers loading the model, padding and masking a 20-step context window, normalizing states with the mean and standard deviation from each model card, and running an evaluation loop. Setting the target return directly controls how well the resulting policy performs.
Related posts
- Train your first Decision Transformer
Hugging Face hardMasterDecision Transformers recast reinforcement learning as conditional sequence modeling: a GPT-2 model takes the last K timesteps of return-to-go, state and action tokens and autoregressively predicts actions that achieve a desired return. This walkthrough trains an offline Decision Transformer from scratch on the HalfCheetah expert dataset from the Hugging Face hub. A custom data collator normalizes states, computes returns-to-go, scales rewards by 1000, pads sequences and samples trajectories by length. A subclassed model adds an MSE action loss so the standard transformers Trainer can be used, and training takes about 40 minutes in Colab versus roughly 3 hours in the original paper.
- Decision Models in Hugging Face
Hugging Face mediumAdeptDecision models take a state plus a set of typed questions with predefined answers and return structured decisions with probabilities instead of generating text, avoiding schema violations and autoregressive decoding overhead. Three primitives cover most cases: choice (softmax over options), score (expected value over an ordered scale), and noul (a Bernoulli probability for yes/no). Choice and score also report a confidence value that normalizes the top probability against a uniform distribution. The post compares the approach with fixed-label and zero-shot NLI classification and shows usage through a new transformers "decision" pipeline intended to give these models a common interface.
- Jack of All Trades, Master of Some, a Multi-Purpose Transformer Agent
Hugging Face hardMasterJAT (Jack of All Trades) is an open reproduction of DeepMind's Gato: a single GPT-Neo-based Transformer trained by behavioral cloning on a new dataset of expert trajectories from Atari, BabyAI, Meta-World and MuJoCo, plus text and image-caption data. It interleaves observation/reward and action embeddings, using modality-specific encoders (CNN for images, linear layers for continuous and discrete values, ViT for images, GPT-2 tokenization for text), with MSE or cross-entropy losses per modality. Across 157 tasks it averages 65.8% of expert performance, ranging from 14.1% on Atari 57 to 99.0% on BabyAI, with only rudimentary NLP and CV ability. Adding observation prediction as an auxiliary loss helps when weighted around κ=0.005 and hurts at 0.5, and the expert agents, dataset and model are all released on the Hugging Face Hub.
- Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox
Hugging Face hardMasterExecutable checks on terminal database state, originally built to grade agents in ThinkingBox-Bench, double as binary RL rewards for post-training tool-using agents. Fine-tuning Qwen3.8-27B with token-mean GRPO for 50 steps on 187 out-of-distribution tasks raised pass@1 from 51.70% to 60.78% and tasks solved on all 20 attempts from 38 to 107, while pass@20 coverage dipped slightly, consistent with sharpening. The key lever is offline policy-relative difficulty: candidate tasks are probed against the base policy, a Jeffreys Beta posterior estimates success probability, and only tasks likely to yield mixed reward groups (non-zero GRPO advantage) are kept. Cost per dependable task fell from $24.36 to $8.00, approaching frontier models.
- Together AI at ICML 2026: frontier research across the full stack
Together AI hardMasterTogether AI's nine ICML 2026 papers span the AI stack from agents to GPU kernels, each with a headline result. ThunderAgent makes multi-turn agent workflows visible to the inference scheduler for 1.5–3.6x throughput. Aurora trains speculative-decoding drafters online via asynchronous RL on accepted/rejected tokens, gaining 1.25x over a static speculator. Untied Ulysses chunks attention by head to fit 5M-token training on one 8xH100 node, and OEA recovers MoE sparsity under batching for up to 39% faster decode without retraining. The rest cover verifier-free reasoning (RARO), pairwise self-verification (V1), test-time RL for discovery (TTT-Discover), a data-science agent benchmark (DSGym), and a multi-GPU kernel generation benchmark where the best frontier model solves fewer than a third of 87 tasks.