Skill Decision Transformer

Shyam Sudhakaran, Sebastian Risi

TL;DR

Skill Decision Transformer (Skill DT) extends the sequence-modeling paradigm of offline reinforcement learning to unsupervised skill discovery by conditioning a causal transformer on learned discrete skill embeddings and their future distributions. Without relying on any reward labels during training, Skill DT discovers diverse, distinguishable behaviors and matches or outperforms reward-supervised baselines across multiple standard D4RL locomotion and navigation benchmarks.

What Problem Does This Paper Address?

Traditional offline reinforcement learning (RL) methods, including sequence-modeling architectures like the Decision Transformer (DT), rely heavily on reward annotations (such as Returns-to-Go) to steer policy generation. However, offline datasets often contain diverse, heterogeneous behaviors where reward functions may be sparse, noisy, or completely missing.

Existing methods for unsupervised skill discovery or State Marginal Matching (SMM) often either require online environment interaction, output complex continuous skill spaces that need downstream RL policies to select skills (e.g., OPAL), or require manual binning of raw state dimensions (e.g., Categorical DT), which struggles in high-dimensional state spaces. The authors ask: Can a transformer discover and execute meaningful, discrete behavioral primitives directly from offline trajectories without any reward supervision?

Methods

Skill DT builds on the Generalized Decision Transformer (GDT) framework, casting skill learning as an autoregressive sequence-prediction problem:

  1. VQ-VAE Skill Encoder: The model uses a Vector Quantized-Variational Autoencoder (VQ-VAE) to map continuous states $s_t$ into continuous latents $\hat{z}_t$, which are then quantized to the nearest discrete codebook embedding $z_t$.
  2. Future Skill Distributions: Future trajectory statistics are represented as normalized histograms $Z_t$ of one-hot encoded skill indices occurring between timestep $t$ and trajectory end $T$.
  3. Causal Transformer Policy: A GPT-style causal transformer conditions action predictions on context windows of states, discrete skill embeddings, and future skill distributions: $$\pi(a_t \mid Z_{t-K:t}, z_{t-K:t}, s_{t-K:t})$$ (Note: unlike standard DT, past actions are omitted to focus on extracting state-level behavioral dynamics).
  4. Hindsight Skill Re-labelling: Because the VQ-VAE codebook evolves throughout training, trajectory skill labels drift. To maintain training stability, future skill distributions across the dataset are re-labeled at each training iteration using the updated encoder before computing the combined action prediction MSE and VQ-VAE loss.

Datasets

The authors evaluated Skill DT on standard tasks from the D4RL benchmark:

  • MuJoCo Gym Locomotion: Continuous control environments (walker2d, halfcheetah, hopper, ant) across medium and medium-replay dataset splits.
  • AntMaze: Sparse-reward navigation tasks requiring continuous control (antmaze-umaze, antmaze-umaze-diverse, antmaze-medium-diverse, and antmaze-medium-play).

No new benchmark datasets were introduced.

Key Insights and Ideas

  • Rewards aren't needed to discover high-performing behavior: By quantizing state spaces and conditioning on future skill histograms, the transformer naturally segments distinct behaviors present in the data. Evaluating each discovered discrete skill in the environment reveals that high-performing trajectories are faithfully isolated and executable.
  • Discrete skills simplify selection: Rather than training a secondary hierarchical policy with RL to navigate a continuous latent space, discrete skills allow users to query behaviors simply by iterating through the codebook entries.
  • Replay datasets need higher skill capacity: For unimodal datasets (-medium), as few as 5 to 10 skills suffice. In contrast, highly multimodal datasets (-replay) exhibit massive gains when increasing codebook capacity (e.g., Hopper replay jumps from 28 to 81 normalized score as skills increase from 5 to 32).
  • Zero-shot trajectory recreation (SMM): Given an unseen target trajectory, Skill DT can encode its states into a skill histogram and rollout a policy in the environment that reproduces macroscopic trajectory features—including unusual behaviors like loops—without environment-specific goal conditioning.

Key Results

Evaluated on D4RL normalized scores (higher is better):

  • Gym Locomotion: Skill DT outperformed standard DT across all tasks and surpassed supervised baselines (CQL, IQL) on several:
  • Walker2d-medium: 82 (vs. DT: 74, CQL: 79, IQL: 78.3, KMeans DT: 76)
  • Hopper-medium: 76 (vs. DT: 68, CQL: 58, IQL: 66, KMeans DT: 66)
  • Ant-medium: 106 (vs. DT: 94, IQL: 101, KMeans DT: 100)
  • AntMaze (U-Maze): Skill DT achieved perfect scores of 100 on both antmaze-umaze and antmaze-umaze-diverse, significantly outperforming DT (59 / 53) and competitive with or better than IQL (88 / 62).
  • AntMaze (Medium): Skill DT scored 13 on medium-diverse and 0 on medium-play. Like standard DT (which scored 0 on both), Skill DT struggles with long-horizon trajectory stitching compared to dynamic-programming methods (IQL: 71 / 70; OPAL: 81).

Limitations and Future Work

  • Evaluation overhead: Because training is entirely reward-free, finding the optimal policy for a specific task requires rolling out all codebook skills in the environment to identify the highest-return primitive.
  • No trajectory stitching / dynamic programming: Like other autoregressive sequence models, Skill DT struggles on complex compositional tasks (e.g., antmaze-medium) that require stitching sub-trajectories from suboptimal data.
  • Future directions: Integrating hierarchical reward-conditioned policies on top of the learned discrete primitives, exploring active prediction of future skill distributions, and incorporating online fine-tuning.

Summary updated

BibTeX
@inproceedings{sudhakaran2023skill,
  author = {Shyam Sudhakaran and Sebastian Risi},
  title = {{Skill Decision Transformer}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=mb7PtrUbHa},
}
Figure