Abstract
The Decision Transformer (DT) has gained significant attention by framing reinforcement learning (RL) as a sequence modeling problem. However, the computational cost of Transformers and their effectiveness in high-frequency dynamic stabilization tasks remain under-explored. This paper investigates whether the Transformer architecture is essential to the success of the sequence modeling approach in RL. By introducing the "Decision LSTM" (DLSTM), we demonstrate that replacing the Transformer with a standard LSTM leads to superior performance, better stabilization, and faster inference in continuous control tasks, both in simulation and on real robotic hardware.
Introduction
Reinforcement Learning (RL) is traditionally viewed as an iterative search for an optimal policy. The Decision Transformer (DT) shifted this paradigm by treating RL as a language-like sequence modeling task, predicting actions based on a history of states, actions, and target rewards (returns-to-go). While successful in discrete domains like Atari, Transformers scale quadratically with sequence length and may struggle with the high-frequency demands of dynamic stabilization—tasks where a robot must maintain a delicate balance, such as an inverted pendulum. This study evaluates if the sequential framing itself, rather than the specific attention mechanism, is the primary driver of performance in these control problems.
Methods
To isolate the impact of the architecture, we conducted a controlled swap of the core model within the DT framework.
- Decision LSTM (DLSTM): The GPT-2 Transformer block was replaced with a standard Long Short-Term Memory (LSTM) network.
- Architectural Streamlining: Unlike Transformers, LSTMs are inherently sequential. Consequently, we removed the attention masks and positional encodings required by the original DT.
- Baselines: DLSTM was compared against the original Decision Transformer and a standard Behavioral Cloning (BC) model, which serves as a reward-agnostic feedforward baseline.
The objective was to determine if the sequence modeling approach (predicting actions from history) holds its value regardless of whether the underlying mechanism is attention-based or recurrent.
Experimental Setup
The models were evaluated across four continuous control environments:
- MuJoCo Inverted Pendulum: A classic stabilization benchmark.
- OpenAI Pendulum: A swing-up task.
- Furuta Pendulum (Simulation): A complex rotary inverted pendulum.
- Furuta Pendulum (Real Hardware): A physical platform used to test real-time constraints and sim-to-real transfer.
Training data included "Expert" trajectories and "Replay" trajectories (a mixture of performance levels).
Results and Discussion
Our findings suggest that the strength of the DT framework lies in its framing of RL as sequence modeling, rather than the Transformer architecture itself.
Performance and Stabilization
In the Furuta Pendulum stabilization task using Expert data, DLSTM achieved a return of 5.93, nearly matching the expert's 5.95. In contrast, the Decision Transformer failed to stabilize the system, managing a return of only 0.46. This performance gap is visualized in the phase plots of the swing-up task.
The Role of Return-to-Go (RTG)
A surprising discovery was that "prompting" the models with different RTG values had no measurable effect on performance in these stabilization tasks. Both DT and DLSTM appeared to ignore reward conditioning, relying instead on the state-action history.
Computational Efficiency
For real-world robotics, inference speed is critical. On a standard laptop, DLSTM generated actions in approximately 0.8ms, twice as fast as the DT's 1.6ms. While both fit within the 4ms window required for a 250Hz controller, the LSTM offers a significantly larger safety margin for more complex control loops.
Conclusion
The Decision LSTM demonstrates that for continuous control and dynamic stabilization, a recurrent architecture can outperform the Transformer while being more computationally efficient. While Transformers may still excel in discrete domains or tasks requiring extremely long-term dependencies, the "sequence modeling" paradigm in RL does not strictly require the Transformer's complexity. Future work will investigate why reward conditioning fails in these specific tasks and how to further bridge the sim-to-real gap for high-velocity robotic movements.
Summary updated