TL;DR
StARformer improves visual reinforcement learning by blending short-term Markovian inductive biases with long-term sequence modeling. By separating local state-action-reward transitions from global trajectory context, it handles longer sequence histories more effectively and significantly outperforms standard Decision Transformers.
What Problem Does This Paper Address?
Recent advances in reinforcement learning (RL) treat the problem as a sequence modeling task. Instead of traditional step-by-step value estimation, models like the Decision Transformer (DT) ingest a history of past states, actions, and rewards to predict the next best action.
However, standard Transformers attend to all tokens uniformly across time. This naive approach ignores a fundamental property of RL: adjacent timesteps share strong, causal, Markovian-like relationships (e.g., your immediate action directly dictates the next state and reward). Attending to everything equally dilutes these essential local priors, making learning harder—especially as sequence lengths grow. Furthermore, standard methods compress entire image states using Convolutional Neural Networks (CNNs) before sequence modeling, which discards fine-grained spatial details crucial for precise control.
Methods
The authors introduce the State-Action-Reward Transformer (StARformer), which splits sequence modeling into two interleaved components to capture both local and global dynamics:
- Step Transformer: This component models local, single-step transitions. It groups the previous action ($a_{t-1}$), previous reward ($r_{t-1}$), and current state ($s_t$). Crucially, the image state is broken into fine-grained, Vision Transformer (ViT)-style patches. Self-attention within this short temporal window produces local StAR-representations.
- Sequence Transformer: This component focuses on long-term trajectory modeling. It takes the local StAR-representations and combines them with global image features extracted via a standard CNN encoder. It then performs self-attention over the entire trajectory history using a causal mask to predict the next action.
This dual-structure architecture allows the model to capture fine-grained spatial-temporal interactions locally while preserving abstract global context for long-range planning.
Datasets
The model was evaluated on two popular image-based benchmarks:
- Atari Environments: 6 games (Assault, Boxing, Breakout, Pong, Qbert, Seaquest) using 1% of the DQN replay buffer dataset.
- DeepMind Control Suite (DMC): 3 continuous control tasks (Cheetah-run, Reacher-easy, Walker-walk) using image inputs, with trajectories generated from a Soft Actor-Critic (SAC) agent.
Evaluations were conducted in both offline RL (learning from a fixed buffer of sub-optimal rollouts) and imitation learning (behavior cloning without reward signals) settings.
Key Insights and Ideas
- Markovian Inductive Bias Relieves Model Capacity: Explicitly grouping local $(a, r, s)$ triplets acts as a powerful regularizer. It relieves the Sequence Transformer from having to learn basic step-by-step physics from scratch, freeing up capacity to focus on long-term context.
- The "Fine-to-Coarse" Fusion: The paper reveals an interesting synergy: patch-based (ViT-style) embeddings are ideal for local step transitions because they preserve spatial details (like the exact position of a ball or paddle), whereas CNN features are better for long-term sequence modeling because they provide abstract, global context.
- Scaling to Longer Histories: While standard Decision Transformers saturate or degrade when given longer histories (performance flattens out at sequence length $T=10$), StARformer’s performance steadily improves as the sequence length increases up to $T=30$.
Key Results
- Offline RL Performance: StARformer significantly outperformed Decision Transformer (DT) and state-of-the-art non-Transformer methods (like CQL, QR-DQN, REM, and BEAR) across both Atari and DMC tasks. For example, on Breakout, StARformer achieved an episodic return score of 124.1 compared to DT's 76.9.
- Imitation Learning: StARformer consistently beat DT and standard behavior cloning baselines, demonstrating robust performance even when completely stripped of reward signals.
- Interpretability: Visualizations of the Step Transformer's attention maps showed that the model naturally learns the semantic meaning of actions. For instance, it strongly attends to the right side of a paddle when the chosen action is "move right".
Limitations and Future Work
- Architectural Sensitivity: The authors note that simply replacing CNN features with ViT patches naively in standard architectures degrades performance; the success of StARformer relies heavily on its specific dual-transformer interleaved design.
- Scope of Evaluation: The paper focuses primarily on offline RL and imitation learning settings. Extending this explicit local-global modeling to online, interactive RL settings remains an open direction.
- Computational Overhead: Operating two distinct transformer components increases architectural complexity and token interaction layers, though it optimizes the use of model capacity.
Summary updated