Abstract
Learning directly from high-dimensional pixels in Reinforcement Learning (RL) is challenging due to the representation learning bottleneck. While Vision Transformers (ViTs) have become the standard in computer vision, their effectiveness in the data-constrained, online-learning setting of RL remains under-explored. This paper evaluates whether self-supervised auxiliary tasks can bridge the performance gap between ViTs and traditional Convolutional Neural Networks (CNNs). We compare three auxiliary objectives—Masked Autoencoders (MAE), Data2Vec, and Momentum Contrastive Learning—against the state-of-the-art CNN-based RAD method. Our results indicate that while reconstruction-based tasks significantly improve ViT performance, CNNs generally maintain superior data efficiency in most control tasks.
Introduction
In deep RL, agents must simultaneously learn to interpret visual observations and derive optimal policies. Convolutional Neural Networks (CNNs) have historically been the preferred architecture due to their inherent spatial inductive biases. However, the shift toward Vision Transformers (ViTs) in broader computer vision raises the question of whether these "data-hungry" models can succeed in RL, where data is often limited and non-stationary. This study investigates if self-supervised learning can provide the necessary representational signal to make ViTs competitive with CNNs in pixel-based RL.
Methods
The authors integrated a compact ViT encoder into a Soft Actor-Critic (SAC) pipeline. To facilitate representation learning, they tested three self-supervised auxiliary tasks designed to help the encoder learn better features:
- MAE (Masked Autoencoders): The agent hides patches of an image and attempts to reconstruct the original pixels.
- Data2Vec: Similar to MAE, but the model predicts the internal latent representations of masked patches rather than raw pixels.
- Momentum Contrastive Learning: Based on the CURL algorithm, this method encourages the model to recognize that different augmentations (e.g., random crops) of the same image should have similar representations.
These methods were benchmarked against RAD (Reinforcement Learning with Augmented Data), a high-performing CNN baseline. To ensure a fair comparison, the number of learnable parameters was matched between the ViT and CNN architectures.
Experimental Setup
Evaluation was conducted on the DeepMind Control Suite (DMControl) across six environments: Finger Spin, Cartpole Swingup, Reacher Easy, Cheetah Run, Walker Walk, and Cup Catch. Performance was tracked up to 500k environment steps to assess both final performance and data efficiency.
Key Results and Discussion
The experimental results highlight several critical trade-offs between architecture and learning objectives:
- Reconstruction vs. Contrast: Reconstruction-based tasks (MAE and Data2Vec) significantly outperformed contrastive learning for ViTs. In the visually constrained environments of DMControl, contrastive signals may be too weak compared to the dense supervision provided by reconstruction.
- The Persistence of CNNs: Despite the auxiliary tasks, CNNs (via RAD) achieved the best overall performance in 4 out of 6 environments. The spatial locality bias of CNNs appears highly effective for learning from the relatively small datasets typical of RL.
- ViT Niche Success: ViTs showed a niche advantage in specific tasks like "Finger Spin" and "Cup Catch," potentially benefiting from the global context provided by the attention mechanism. For instance, in Cup Catch at 500k steps, ViT with MAE achieved a score of 973.64, outperforming RAD's 925.16.
- Necessity of Self-Supervision: Standard ViT training without auxiliary losses performed poorly across the board, confirming that self-supervision is a prerequisite for making Transformers viable in data-constrained RL.
Conclusion
While Vision Transformers can be adapted for pixel-based RL through self-supervised auxiliary tasks, they do not yet consistently outperform optimized CNN baselines in terms of data efficiency. Reconstruction-based objectives like MAE are the most effective for ViTs in this setting. Future research should explore the impact of large-scale pre-training on diverse datasets to fully unlock the potential of Transformers in reinforcement learning.
Summary updated