Return-Aligned Decision Transformer

Tsunehiko Tanaka, Kenshi Abe, Kaito Ariu, Tetsuro Morimura, Edgar Simo-Serra

Abstract

Traditional approaches in offline reinforcement learning aim to learn the optimal policy that maximizes the cumulative reward, also known as return. It is increasingly important to adjust the performance of AI agents to meet human requirements, for example, in applications like video games and education tools. Decision Transformer (DT) optimizes a policy that generates actions conditioned on the target return through supervised learning and includes a mechanism to control the agent's performance using the target return. However, the action generation is hardly influenced by the target return because DT’s self-attention allocates scarce attention scores to the return tokens. In this paper, we propose Return-Aligned Decision Transformer (RADT), designed to more effectively align the actual return with the target return. RADT leverages features extracted by paying attention solely to the return, enabling action generation to consistently depend on the target return. Extensive experiments show that RADT significantly reduces the discrepancies between the actual return and the target return compared to DT-based methods.

Introduction

In offline Reinforcement Learning (RL), the goal is often to train a single model capable of performing at various skill levels—such as a video game AI that can act as a beginner, intermediate, or expert opponent on command. The Decision Transformer (DT) was introduced to address this by conditioning actions on a "target return" (the desired total reward). However, research has identified a significant flaw: DT’s self-attention mechanism tends to ignore return tokens, focusing instead on state and action patterns. This leads to "return misalignment," where the agent significantly overshoots or undershoots the target return because it fails to "listen" to the performance prompt.

Methods: The RADT Architecture

The Return-Aligned Decision Transformer (RADT) fundamentally restructures how return information is processed. Unlike the standard DT, which mixes return, state, and action tokens into a single sequence for self-attention, RADT separates them to prevent return information from being "washed out."

Comparison of DT and RADT architectures, highlighting the separation of return-to-go tokens and the integration of SeqRA and StepRA modules.

RADT introduces two specialized alignment mechanisms within its transformer block:

  1. Sequence Return Aligner (SeqRA): This utilizes a cross-attention mechanism where the state-action sequence acts as the "query" and the return-to-go sequence acts as the "key" and "value." This forces the model to extract features specifically from the history of desired returns, capturing long-term dependencies.
  2. Stepwise Return Aligner (StepRA): Replacing standard Layer Normalization, this module applies a linear transformation to state and action tokens using scaling and shifting parameters ($\gamma$ and $\beta$) derived directly from the return token at each specific timestep. This ensures immediate reaction to the current desired performance level.

Experimental Evaluation

RADT was evaluated on two standard RL benchmarks:

  • MuJoCo: Continuous control tasks (Ant, HalfCheetah, Hopper, Walker2d) using the D4RL dataset, involving fine-grained motor control with dense rewards.
  • Atari: Discrete control tasks (Breakout, Pong, Qbert, Seaquest) using the DQN-replay dataset, requiring long-term credit assignment and processing high-dimensional visual inputs.

Key Results and Insights

The most striking insight from the study is the "Attention Gap" in standard DTs, where models allocate nearly zero attention to return tokens. RADT’s architecture fixes this by design, ensuring the model consistently depends on the target return.

Return-to-go trajectories for DT and RADT across different target returns. RADT effectively reduces overshooting, aligning actual performance with the target.

RADT significantly outperformed baselines like the original DT, StARformer, and Decision ConvFormer in achieving target returns:

  • MuJoCo: Reduced absolute error between target and actual returns by 54.9% compared to DT.
  • Atari: Reduced absolute error by 34.4% compared to DT.
  • Controllability: Visualizations of return-to-go transitions show that while DT agents often "overshoot" targets (behaving greedily), RADT agents successfully throttle performance to converge near the requested target.

Ablation studies revealed that SeqRA and StepRA are complementary: StepRA is more effective for dense, continuous tasks (MuJoCo), while SeqRA is vital for tasks requiring long-term memory (Atari).

Conclusion and Future Work

RADT provides a "volume knob" for agent performance, shifting the focus from simple reward maximization to precise controllability. While RADT introduces a slight increase in computational cost (approximately 28% increase in training time), the gains in alignment are substantial. Future work includes investigating how RADT handles multi-agent environments and improving its ability to extrapolate beyond the performance levels seen in training data.

Summary updated

BibTeX
@article{tanaka2025return,
  author = {Tsunehiko Tanaka and Kenshi Abe and Kaito Ariu and Tetsuro Morimura and Edgar Simo-Serra},
  title = {{Return-Aligned Decision Transformer}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=lTt2cTW8h1},
}
Figure