Introduction
Decision Transformers (DTs) have emerged as a powerful paradigm for offline reinforcement learning, reframing the RL problem as a conditional sequence modeling task. By leveraging the self-attention mechanism of transformers, DTs can model complex dependencies across long sequences of states, actions, and returns. However, a significant challenge arises in environments with multi-discrete action spaces, where agents must execute multiple independent actions simultaneously. Standard DT architectures often struggle to capture the nuances of these compound actions, leading to suboptimal performance. This paper introduces Multi-State-Action Tokenisation (M-SAT), a novel architectural modification designed to disentangle and ground multi-discrete actions within the transformer framework.
The Challenge of Multi-Discrete Action Spaces
In many real-world and simulated environments, such as 3D games or robotic control, an agent's action at any given timestep is not a single choice but a set of concurrent decisions. For instance, in the ViZDoom environment, an agent might need to move forward, strafe left, and fire a weapon all at once.
Traditional Decision Transformers typically "squash" these multiple action components into a single token. This approach creates a representational bottleneck. The transformer's attention mechanism is forced to interact with a monolithic action embedding, making it difficult for the model to learn the specific relationships between individual action components and the environmental state. This lack of granularity hinders the model's ability to understand the underlying dynamics and leads to poor sample efficiency and stability.
Methodology: Multi-State-Action Tokenisation (M-SAT)
M-SAT addresses the limitations of standard DTs through two primary innovations: action disentanglement and auxiliary state injection.
Action Disentanglement
Instead of encoding a multi-discrete action vector as a single token, M-SAT expands the action space into $N$ separate tokens, where $N$ is the number of action components. This expansion allows the transformer's self-attention heads to independently weigh and relate each sub-action to the sequence history. For example, the model can learn that the "Attack" action is highly relevant when an enemy is present in the state image, while "Movement" actions might be more influenced by the overall goal direction.
Auxiliary State Injection (Grounding)
To provide necessary context for these individual action tokens, M-SAT "grounds" each one by incorporating information from the preceding state. Specifically, the embedding of each action component is combined with the embedding of the current state. This ensures that the model doesn't just see "what" action was taken, but "where" and "in what context" it occurred.
As shown in Figure 1, the architecture processes the raw state through a CNN and other inputs (Timestep, RTG) through MLPs. The multi-discrete action components (e.g., Turn, Forwards, Strafe, Attack) are individually processed and then integrated with the state representation to form the final sequence of tokens fed into the transformer.
Experimental Setup
The researchers evaluated M-SAT against a baseline Decision Transformer in the ViZDoom environment, focusing on two scenarios that demand complex reasoning and multi-action coordination:
- Deadly Corridor (DC): A combat-heavy task where the agent must navigate a hallway, dodge projectiles, and eliminate enemies. It features a 4-dimensional multi-discrete action space.
- My Way Home (MWH): A navigation-focused task in a large labyrinth. The agent must find a specific goal with only sparse rewards, requiring long-term planning. This task uses a 2-dimensional multi-discrete action space.
Both environments utilize raw image-based states, presenting a significant challenge for offline RL models.
Key Results and Discussion
M-SAT demonstrated substantial improvements over the baseline DT in both performance and stability.
Performance Gains
The most striking results were observed in the "My Way Home" scenario. While the baseline DT struggled to solve the task, achieving an average reward of only 0.243, M-SAT achieved a near-perfect average reward of 0.964. This suggests that the disentangled tokenization allows the model to better capture the long-range dependencies required for navigation.
As illustrated in Figure 6, M-SAT (blue) consistently outperforms the baseline (orange) across training steps. In the navigation task (right plot), the gap is particularly pronounced, with M-SAT maintaining high performance while the baseline fails to converge effectively.
Interpretability and Stability
Beyond raw scores, M-SAT offered improved interpretability. Visualization of attention maps revealed that specific attention heads began to "track" individual action components. For instance, attention would spike on the "Attack" token specifically when enemies were visible in the state frame. Furthermore, M-SAT exhibited much lower variance in performance across different runs, indicating a more robust learning process compared to the "squashed" action approach.
Conclusion
Multi-State-Action Tokenisation (M-SAT) provides a simple yet highly effective way to adapt Decision Transformers for complex, multi-discrete action spaces. By disentangling actions and grounding them with state information, M-SAT unlocks the full potential of the transformer's attention mechanism for reinforcement learning. The significant performance boosts in challenging 3D environments like ViZDoom highlight M-SAT's potential for scaling DTs to even more sophisticated real-world tasks.
Summary updated