[Paper Review] CoBERL: Contrastive BERT for Reinforcement Learning
CoBERL proposes a contrastive BERT-inspired representation learning objective combined with a gated LSTM-transformer architecture to improve data efficiency in reinforcement learning. By leveraging masked prediction and a time-domain contrastive loss without handcrafted augmentations, CoBERL achieves superior sample efficiency and performance across Atari, control suite, and 3D environments, consistently outperforming baselines like GTrXL.
Many reinforcement learning (RL) agents require a large amount of experience to solve tasks. We propose Contrastive BERT for RL (CoBERL), an agent that combines a new contrastive loss and a hybrid LSTM-transformer architecture to tackle the challenge of improving data efficiency. CoBERL enables efficient, robust learning from pixels across a wide range of domains. We use bidirectional masked prediction in combination with a generalization of recent contrastive methods to learn better representations for transformers in RL, without the need of hand engineered data augmentations. We find that CoBERL consistently improves performance across the full Atari suite, a set of control tasks and a challenging 3D environment.
Motivation & Objective
- Improve data efficiency in deep reinforcement learning from raw pixels by learning better representations.
- Address the challenge of noisy gradients and strong temporal correlations in RL training with large, dense networks.
- Develop a self-supervised representation learning method that avoids hand-engineered data augmentations.
- Integrate the strengths of LSTMs and transformers through a learnable gate mechanism for dynamic knowledge utilization.
- Enable robust and generalizable representation learning across diverse RL environments, including 2D and 3D control tasks.
Proposed method
- Propose a novel contrastive loss that combines bidirectional masked prediction (inspired by BERT) with a time-domain generalization of ReLIC for self-supervised representation learning.
- Use a causally masked Gated Transformer-XL (GTrXL) to process observations and predict masked inputs, ensuring autoregressive consistency.
- Introduce a learnable gate mechanism that fuses outputs from the GTrXL and an LSTM, allowing dynamic selection of representation pathways based on task demands.
- Train the gate using the RL policy loss, enabling end-to-end optimization of the entire architecture.
- Apply the contrastive loss using normalized embeddings from predicted masked inputs and original observations, with a contrastive objective based on instance discrimination and invariance penalties.
- Use a residual CNN encoder to embed raw pixel observations before feeding them into the transformer and LSTM components.
Experimental results
Research questions
- RQ1Can a contrastive representation learning objective inspired by BERT improve data efficiency in reinforcement learning without handcrafted data augmentations?
- RQ2How does combining LSTMs with transformers via a learnable gate affect performance and sample efficiency in diverse RL environments?
- RQ3Does the integration of masked prediction and contrastive learning in the temporal domain lead to more consistent and generalizable representations in RL?
- RQ4To what extent does CoBERL outperform existing architectures like GTrXL across multiple benchmark environments?
- RQ5What is the impact of masking ratio on the auxiliary pretraining objective and final RL performance?
Key findings
- CoBERL achieves consistent improvements in data efficiency across all 57 Atari games, with significant performance gains in sample efficiency.
- On the DeepMind Control Suite, CoBERL shows improved sample efficiency and higher final scores compared to GTrXL and other baselines.
- In the 3D DMLab-30 environment, CoBERL demonstrates superior memory and reasoning capabilities, outperforming GTrXL in terms of area under the curve (AUC) with t(60) = 2.616, p = 0.0011.
- The ablation study confirms that both the contrastive loss and the gated architecture contribute independently to performance gains, with the contrastive objective being particularly effective in representation learning.
- Higher masking ratios (e.g., 50%) degrade performance, indicating that excessive masking reduces useful temporal context for the auxiliary task.
- The method generalizes well across domains, showing strong performance in both 2D platformers and 3D first-person/third-person control tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.