Unsupervised State Representation Learning in Partially Observable Atari Games

Li Meng, Morten Goodwin, Anis Yazidi, Paal EngelstadCAIP 2023

Abstract

State representation learning is a cornerstone of effective reinforcement learning (RL), yet most existing methods assume full observability of the environment. In real-world scenarios, agents often encounter Partially Observable Markov Decision Processes (POMDPs) where data is missing or obscured. This paper introduces Masked Spatiotemporal DeepInfoMax (MST-DIM), an unsupervised approach that leverages random masking during pretraining to learn robust state representations. By forcing the model to maximize mutual information between masked frames and future states, MST-DIM enables agents to capture latent factors even under significant occlusion. Our results across 20 Atari games demonstrate that MST-DIM significantly outperforms supervised and standard contrastive baselines, nearly bridging the performance gap between partially and fully observable environments.

Introduction

In the pursuit of autonomous agents capable of navigating complex environments, the ability to extract meaningful features from raw sensory input is paramount. In standard Reinforcement Learning (RL) benchmarks, such as the Arcade Learning Environment (ALE), agents typically operate under the assumption of full observability. However, practical applications—ranging from robotics to autonomous driving—are frequently characterized by noise, sensor failure, or environmental occlusions. These are formally modeled as Partially Observable Markov Decision Processes (POMDPs).

While unsupervised methods like Spatiotemporal DeepInfoMax (ST-DIM) have shown promise in learning representations from full-frame video, their performance degrades sharply when the input is incomplete. This paper addresses the challenge of learning the "latent logic" of an environment—such as the positions of players, enemies, and objectives—when only a fraction of the visual data is available. We propose MST-DIM, a method that incorporates stochastic masking into a contrastive learning framework to build resilience against partial observability.

Methodology

The MST-DIM Framework

MST-DIM builds upon the foundations of ST-DIM, which utilizes contrastive learning to maximize the mutual information between local features of a current frame and global features of a subsequent frame. The core innovation of MST-DIM is the integration of a masking regime during the pretraining phase.

  1. Random Masking Strategy: During training, input frames are subjected to a masking process where portions of the image are replaced with noise. This simulates the data loss inherent in POMDPs.
  2. Binomial Distribution: The masks are generated using a binomial distribution, allowing for a tunable "masking ratio." This parameter controls the severity of the occlusion, enabling the model to practice reconstruction and feature extraction from sparse data.
  3. Contrastive Objective: The model is tasked with matching local patches from a masked frame with the global feature vector of the following frame. This forces the encoder to identify invariant features that persist across time, even if those features are temporarily obscured in the current view.

Evaluation via Linear Probing

To assess the quality of the learned representations without the confounding variables of RL policy gradients, the authors employ "linear probing." A simple linear classifier is trained to predict ground-truth game variables (e.g., the x-y coordinates of a paddle or the score) using only the frozen features extracted by the pretrained encoder. This measures how much "knowledge" about the true state of the game is actually captured by the unsupervised model.

Experimental Setup

Datasets and Benchmarks

The study utilizes 20 diverse games from the Arcade Learning Environment (ALE). To provide a rigorous ground-truth for evaluation, the researchers use the Atari Annotated RAM Interface (AtariARI). AtariARI allows access to the internal state variables stored in the game's RAM, providing a definitive metric for what the agent should know about the environment, despite only being trained on visual pixels.

Baselines

MST-DIM was compared against two primary baselines:

  • Standard ST-DIM: The original contrastive method without masking.
  • Supervised Learning: A model trained directly to predict RAM labels from pixels, representing a theoretical upper bound for feature extraction under traditional training regimes.

Key Insights and Results

Performance in Partially Observable Settings

The quantitative results highlight a significant breakthrough for unsupervised learning in noisy environments. When tested with a 0.4 masking ratio (40% of the screen obscured):

  • Accuracy: MST-DIM achieved a mean accuracy of ~66%, whereas both supervised learning and standard ST-DIM struggled at ~38%.
  • F1 Scores: MST-DIM maintained a mean F1 score of ~64%, more than doubling the ~33% achieved by the supervised baseline.

Robustness and Generalization

A surprising finding was the model's robustness to varying masking ratios. Models pretrained with high masking ratios (e.g., 0.8) still performed exceptionally well when tested at lower ratios. This suggests that the masking task forces the encoder to prioritize high-level structural features over low-level pixel correlations. Furthermore, MST-DIM’s performance in obscured environments (~66%) was remarkably close to the performance of models trained on perfectly clear, fully observable images (~71%), suggesting that the method effectively "recovers" the missing information.

Capturing Small Objects

One common failure of generative models in RL is the tendency to ignore small, high-velocity objects like bullets or pellets, as they represent a negligible fraction of total pixels. MST-DIM’s local-to-global contrastive task specifically incentivizes the model to track these small but critical entities, as they are often the most informative factors for predicting future states.

Discussion and Limitations

While MST-DIM represents a significant step forward, certain limitations remain. In games with very simple visual structures, such as Boxing, the contrastive task can become "too easy," leading to feature saturation where the model fails to improve further at extreme masking levels. Additionally, while the representations are demonstrably superior, the paper focuses on the vision component; the subsequent step of integrating these encoders into an active RL loop to improve game scores is an area for future research.

Conclusion

MST-DIM demonstrates that unsupervised contrastive learning, when paired with strategic masking, can produce state representations that are highly resilient to partial observability. By outperforming supervised methods in noisy environments, this research suggests that unsupervised objectives may be better suited for the complexities of real-world data than traditional label-based approaches. This work paves the way for more robust RL agents capable of operating in environments where the full state is rarely, if ever, visible.

Summary updated

BibTeX
@inproceedings{meng2023unsupervised,
  author = {Li Meng and Morten Goodwin and Anis Yazidi and Paal Engelstad},
  title = {{Unsupervised State Representation Learning in Partially Observable Atari Games}},
  booktitle = {CAIP},
  year = {2023},
  doi = {10.1007/978-3-031-44240-7\_21},
}
Figure