Deep Reinforcement Learning with Swin Transformers
Li Meng, Morten Goodwin, Anis Yazidi, Paal Engelstad
TL;DR
The paper introduces Swin DQN, an online reinforcement learning algorithm that substitutes CNN backbones with Swin Transformers in Double DQN to leverage local self-attention for high-dimensional visual inputs. By using patch-based tokenization, shifted windowed self-attention, and a hierarchical Swin architecture, it achieves substantial improvements across 49 Atari games, outperforming a CNN-based baseline in maximal and mean returns and improving human-normalized metrics and AUC. The approach demonstrates that spatial attention can meaningfully enhance feature representations in vision-based DRL, albeit at increased computational cost, suggesting directions for lighter Swin variants and broader real-world applications.
Abstract
Transformers are neural network models that utilize multiple layers of self-attention heads and have exhibited enormous potential in natural language processing tasks. Meanwhile, there have been efforts to adapt transformers to visual tasks of machine learning, including Vision Transformers and Swin Transformers. Although some researchers use Vision Transformers for reinforcement learning tasks, their experiments remain at a small scale due to the high computational cost. This article presents the first online reinforcement learning scheme that is based on Swin Transformers: Swin DQN. In contrast to existing research, our novel approach demonstrate the superior performance with experiments on 49 games in the Arcade Learning Environment. The results show that our approach achieves significantly higher maximal evaluation scores than the baseline method in 45 of all the 49 games (92%), and higher mean evaluation scores than the baseline method in 40 of all the 49 games (82%).
