Harnessing Discrete Representations for Continual Reinforcement Learning

Edan Meyer, Adam White, Marlos C. Machado

TL;DR

This paper demonstrates that representing environment observations as discrete, sparse vectors (like those from a VQ-VAE) allows reinforcement learning agents to learn more accurate world models with less data and adapt significantly faster to changing environments. The authors reveal a surprising insight: the power of these representations stems from their sparse, binary nature rather than the "discreteness" of the values themselves.

What Problem Does This Paper Address?

In deep reinforcement learning (RL), agents usually represent their world using continuous vectors—long lists of floating-point numbers. While this is the standard in deep learning, recent high-performing agents (like DreamerV3) have started using "discrete representations" (vectors of categorical values).

However, there has been very little research into why this works. Does it help because the world is inherently discrete? Is it about memory efficiency? This paper investigates the mechanisms behind this success, specifically looking at how these representations affect an agent's ability to build "world models" (predicting the future) and how they help in continual RL, where the environment layout changes over time and the agent must adapt on the fly.

Methods

The researchers compared three primary ways of encoding observations:

  1. Dense/Continuous: A standard vanilla autoencoder (AE).
  2. Sparse/Continuous: A "Fuzzy Tiling Activation" (FTA) autoencoder, which creates sparse but still continuous outputs.
  3. Discrete/Binary: A Vector Quantized-Variational Autoencoder (VQ-VAE). This maps observations to a "codebook" of discrete indices, which are then represented as multi-one-hot vectors.

They tested these representations in two ways:

  • World-Model Learning: Training a model to predict the next state given the current state and action.
  • Model-Free RL: Training an agent using Proximal Policy Optimization (PPO) to solve tasks, both in static settings and "continual" settings where the map layout is periodically randomized.

Datasets

The study uses the Minigrid environment suite, specifically:

  • Empty: A simple room (used as a baseline).
  • Crossing: A room with a wall and a small gap the agent must find.
  • Door Key: A complex task requiring the agent to find a key, unlock a door, and reach a goal.

To test Continual RL, they modified these environments so that the internal walls and object positions randomize every few thousand steps, forcing the agent to constantly re-learn its strategy.

Key Insights and Ideas

  • Capacity Efficiency: Discrete representations allow world models to accurately capture rare transitions (like picking up a key) even when the model has very few "neurons" (hidden units). Continuous models struggle to represent these rare events unless they are scaled up significantly.
  • It’s the Encoding, Not the Discreteness: In a clever experiment, the authors compared "quantized" continuous values against "multi-one-hot" binary vectors. Even though both contained the same information, the binary, sparse version performed vastly better. This suggests that the sparsity and orthogonality of one-hot vectors are the real "secret sauce."
  • Faster Adaptation: In continual RL, the VQ-VAE agents recovered from environment changes much faster. Their "reconstruction loss" (a measure of how well they understand the world) spiked less and returned to baseline quicker than continuous models.
  • The "Big World" Hypothesis: The authors argue that because agents have limited resources compared to the vastness of the real world, they will always be in a state of "continual learning." Discrete, sparse representations are a key tool for managing this limited capacity.

Key Results

  • World Modeling: VQ-VAE models achieved near-perfect accuracy in complex environments where vanilla continuous models failed to predict rare but critical events (like passing through a door).
  • Sample Efficiency: In episodic RL, agents using VQ-VAE or FTA (sparse) representations converged to a solution 2 to 3 times faster than those using vanilla continuous representations.
  • Continual RL Performance: In the "Door Key" environment with changing layouts, the VQ-VAE agent achieved a mean reward of 1324 ± 64, significantly outperforming the Vanilla AE agent (866 ± 94) and the end-to-end baseline (14 ± 2).

Limitations and Future Work

  • Domain Specificity: Minigrid is a grid-based, discrete-action world. While the observations are pixels, the underlying logic is discrete. Future work needs to confirm if these benefits hold in high-dimensional, purely continuous control tasks (like robotics).
  • Disentangling Sparsity: While the paper points toward sparsity and binary values as the cause of success, it doesn't fully disentangle the two. It remains to be seen if a very sparse continuous representation could match the performance of a binary one.
  • Initial Learning Lag: The authors noted that VQ-VAEs can sometimes be slower to learn the initial representation compared to simple autoencoders, though they argue this "cost" is paid back by much faster adaptation later in the agent's life.

Summary updated

BibTeX
@inproceedings{meyer2024harnessing,
  author = {Edan Meyer and Adam White and Marlos C. Machado},
  title = {{Harnessing Discrete Representations for Continual Reinforcement Learning}},
  booktitle = {RLC},
  year = {2024},
  url = {https://openreview.net/forum?id=tCXURNlAZ3},
}
Figure