Abstract
Episodic Control (EC) reinforcement learning agents achieve high sample efficiency by caching successful experiences, but they face significant scalability challenges due to linear memory growth. We introduce Dynamic Online k-means (DkM), a novel memory management strategy that intelligently clusters experiences and applies a decay factor to old clusters. DkM allows agents to maintain high performance with up to 20x less memory compared to standard baselines. Our evaluation across diverse environments, including Atari 2600, demonstrates that DkM effectively addresses the stability-plasticity dilemma in memory-constrained RL.
Introduction
Standard Deep Reinforcement Learning (RL) is notoriously sample inefficient, often requiring millions of frames to learn tasks that humans grasp in minutes. Episodic Control (EC) addresses this by mimicking the human hippocampus, "caching" successful experiences and retrieving them via k-Nearest Neighbors (k-NN). However, EC suffers from a "memory explosion" problem; as the agent learns, memory usage and search times grow linearly. Existing solutions, such as Least Recently Used (LRU) deletion, often lead to catastrophic forgetting of rare but vital states. This paper proposes Dynamic Online k-means (DkM) to balance memory stability and plasticity.
Methods: Dynamic Online k-means
The authors evaluate several memory strategies, including Maximise Surprise (SUR), Maximise Rewards (REW), and standard Online k-means (kM). The core contribution, DkM, improves upon standard clustering by introducing a temporal decay mechanism.
In DkM, new states are merged into the nearest existing cluster. To prevent the memory from becoming static—a common failure in non-stationary RL environments—the "weight" of every cluster is decayed over time. When a cluster's weight reaches zero, it is replaced by a new state. This hybrid approach ensures the memory preserves the state-space topology while remaining receptive to new data distributions.
Experimental Evaluation
The researchers tested DkM across three tiers of complexity:
- Classic Control: Cartpole and Acrobot (continuous state spaces).
- Gridworlds: Navigation tasks in "OpenRoom" and "FourRoom".
- Atari 2600: Five games with varied gameplay, including Ms. Pac-Man and Pong.
Key Results
DkM consistently outperformed baselines in memory-constrained settings. In Cartpole, with a budget of only 50 states, DkM was the only method to reach an average reward of >200. In Acrobot, DkM achieved the best rewards in 10 out of 12 experimental settings, outperforming standard Deep Q-Networks (D3QN).
Key insights include:
- Clustering vs. Deletion: Merging similar states into clusters is far more effective than simple deletion for preserving the topology of the state space.
- Decay is Essential: Standard online k-means fails in RL because the data distribution is non-stationary. DkM’s decay mechanism prevents the agent from getting stuck with "zombie clusters" from early exploration.
- Computational Efficiency: DkM adds negligible $O(N)$ overhead compared to the already expensive k-NN lookup process.
Discussion and Limitations
While DkM excels in low-memory regimes, its advantage diminishes as memory becomes abundant (e.g., $10^5$ states in Atari). In these cases, the risk of "state aliasing"—incorrectly merging distinct states that look similar—can outweigh the benefits of clustering. Future research could enhance DkM by incorporating Q-values into the clustering metric to prevent merging high-reward and low-reward states. DkM represents a significant step toward deploying RL on resource-constrained hardware like edge computing devices.
Summary updated