Memory Allocation in Resource-Constrained Reinforcement Learning

Massimiliano Tamborski, David AbelarXiv 2025 · DOI

Abstract

This paper investigates the "memory allocation dilemma" in reinforcement learning: how an agent with a strictly limited memory budget should divide its resources between building a world model and executing a plan. By evaluating MCTS and DQN-based agents in resource-constrained environments, the authors demonstrate that performance follows an inverse U-shaped curve. The optimal balance between "modeling" and "thinking" depends heavily on data quality and task stability, suggesting that fixed allocation strategies may be suboptimal in dynamic environments.

Introduction: The Bounded Rationality Perspective

Most Reinforcement Learning (RL) research focuses on scaling—leveraging increased compute and memory to solve complex tasks. However, real-world agents, both biological and artificial, operate under strict resource constraints. This paper explores the perspective of bounded rationality, asking how agents should manage a fixed memory budget $N$.

The authors identify a fundamental trade-off between two primary uses of memory:

  1. Model Memory ($N_{\hat{p}}$): Resources used to store transitions and estimate the dynamics of the environment.
  2. Planning Memory ($N_{\pi}$): Resources used to represent an internal plan or search tree.
Conceptual diagram of the memory allocation trade-off between the transition model and the internal plan.

If an agent allocates too much memory to the model, it gains an accurate view of the world but lacks the "mental space" to compute a long-term strategy. Conversely, over-allocating to planning allows for deep look-ahead, but the search is conducted over a deeply flawed or incomplete model.

Methodology

The researchers formalize the agent's total memory as $N = N_{\hat{p}} + N_{\pi}$ and test this allocation across two distinct RL architectures:

  • Resource-Constrained MCTS: In a model-based setting, the agent uses $N_{\hat{p}}$ units to store transitions from a dataset to build a Maximum Likelihood Estimation (MLE) model. It then uses $N_{\pi}$ units as nodes in a Monte Carlo Tree Search (MCTS) to determine its policy.
  • PT-DQN (Permanent-Transient DQN): In a continual learning setting, the authors split a Deep Q-Network into a Permanent value function (storing general knowledge across tasks) and a Transient value function (capturing task-specific details). They vary the percentage of hidden units allocated to each.

Experimental Setup

The paper utilizes two primary environments to test these constraints:

  1. MiniGrid CorridorEnv: A grid-world environment where an agent must navigate to one of four goals. Goals further from the start offer higher rewards but require more steps, testing the agent's ability to plan long-term under memory pressure.
  2. Jelly Bean World: A 2D infinite grid used for continual learning. The rewards for specific objects swap periodically, forcing the agent to adapt its "transient" memory while maintaining "permanent" knowledge.

Results and Key Insights

The experiments reveal several critical properties of memory allocation in RL agents.

The Inverse U-Curve

Performance is not linear; there is a distinct "sweet spot" for memory allocation. In MCTS experiments within the CorridorEnv, performance peaked when memory was split roughly 50/50 ($N_{\pi} \approx N_{\hat{p}}$). Agents with very low $N_{\pi}$ (low planning) failed to reach any goals. As $N_{\pi}$ increased, they reached the closest goals, and eventually the furthest (best) goals, before performance dropped again as $N_{\hat{p}}$ became too small to sustain an accurate model.

Performance in the CorridorEnv across different memory allocations, showing the characteristic inverse U-curve for both optimal and noisy datasets.

Impact of Data Quality

When environment data is noisy or contains many random transitions, the agent requires more planning capacity ($N_{\pi}$) to account for "dead branches" in its search tree. The performance curves are not perfectly symmetric, suggesting that the "cost" of a poor model is different from the "cost" of a shallow plan.

Efficiency in Continual Learning

In the PT-DQN experiments within Jelly Bean World, the authors challenged the assumption that a 50/50 split between permanent and transient memory is ideal. They found that a small permanent allocation (around 10%) often outperforms a 50/50 split. A smaller transient network can recover faster from environment changes because its replay buffer is smaller and updates more quickly, reaching rewards of ~0.3 per step compared to ~0.2 for the standard split.

Discussion and Future Work

While this study provides a framework for understanding memory trade-offs, several questions remain. A primary challenge is defining a "unit" of memory consistently across different architectures. Furthermore, these experiments used fixed memory splits. Future research should investigate agents that can autonomously discover and adjust their memory allocation dynamically as they learn. Finally, the authors aim to bridge these findings with cognitive science to better understand how biological brains manage similar resource constraints.

Summary updated

BibTeX
@misc{tamborski2025memory,
  author = {Massimiliano Tamborski and David Abel},
  title = {{Memory Allocation in Resource-Constrained Reinforcement Learning}},
  year = {2025},
  eprint = {2506.17263},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.17263},
}
Figure