Learning, Fast and Slow: A Goal-Directed Memory-Based Approach for Dynamic Environments

Chong Min John Tan, Mehul Motani · DOI

Abstract

Traditional Reinforcement Learning (RL) algorithms often struggle with sample inefficiency and adaptation in dynamic environments due to a focus on finding optimal policies. This paper presents a dual-process RL framework inspired by human cognition that prioritizes "satisficing"—finding sufficient solutions quickly—over absolute optimality. By integrating a fast, goal-conditioned neural network with a slow, parallel memory-retrieval system for planning, the proposed agent achieves a 92% solve rate in dynamic grid worlds, significantly outperforming state-of-the-art methods like PPO and TRPO.

Introduction

Standard Reinforcement Learning is notoriously sample-inefficient, frequently requiring millions of interactions to master relatively simple tasks. This inefficiency often stems from a fundamental commitment to optimality. In the pursuit of the "perfect" path, agents must engage in exhaustive exploration, leading to slow convergence. Furthermore, many RL agents rely on neural "world models" to predict future states—a process that is computationally expensive and often inaccurate (lossy).

In dynamic environments where obstacles move or goals shift, the pursuit of optimality becomes a liability. A policy that was optimal in one configuration may become obsolete when the environment changes, forcing the agent to "unlearn" old habits before it can adapt. This paper proposes a shift in perspective: prioritizing "good enough" solutions that can be found and updated rapidly.

Methodology: The Fast and Slow Framework

Inspired by Daniel Kahneman’s dual-process theory of "Thinking, Fast and Slow," the authors propose a two-part architecture designed for rapid adaptation.

1. The Fast Mechanism: Goal-Directed Exploration

The "Fast" component is a goal-conditioned Multi-Layer Perceptron (MLP) that functions as an intuitive "compass." Rather than learning abstract state values, it learns to select actions based on the current state and a specific target goal. This network is trained online using hippocampal replay, where the agent learns from both actual past experiences and imagined future trajectories. This allows the agent to develop a quick, reactive policy for navigation.

2. The Slow Mechanism: Memory-Based Planning

The "Slow" component handles deliberate planning. Instead of a neural network-based world model, the agent utilizes an external hash table to store environmental transitions in the form of (state, action -> next state). For planning, the agent executes 100 parallel "lookahead" branches within this memory bank. If the memory search identifies a viable path to the goal, it overrides the neural network's suggested action.

This dual-process approach is designed to satisfice. By focusing on finding a functional path rather than the shortest possible one, the agent can adapt to environmental "shocks" almost instantly. The hash table acts as a non-parametric, perfect model of the explored world that updates without the training lag associated with neural networks.

Experimental Evaluation

The framework was evaluated using custom 2D grid world environments designed to test adaptability:

  • Static Grid World: A 10x10 maze baseline.
  • Dynamic Grid World: Mazes of varying sizes (10x10, 20x20, and 40x40) where obstacles are redistributed mid-simulation (at episode 50) and start/end points vary randomly each episode.

Key Results

The "Fast & Slow" agent demonstrated superior performance compared to traditional actor-critic models (PPO, TRPO, and A2C) in dynamic navigation tasks.

  • Solve Rate: In the 10x10 dynamic task, the Fast & Slow agent achieved a 92% solve rate, while PPO and TRPO struggled at 54% and 50%, respectively.
  • Efficiency: The agent was significantly more efficient, requiring an average of only 1,478 steps above the theoretical minimum, compared to 5,208 steps for PPO.
  • Scalability: In larger 20x20 environments, the agent maintained an 85% solve rate, whereas the performance of all baseline models dropped below 20%.
  • Ablation: Studies confirmed that both the neural network (Fast) and the memory bank (Slow) are essential; removing either component resulted in a significant performance decline.

Discussion and Insights

The success of this approach highlights several key insights for RL research:

  • Action over State Prediction: Learning "what action to take" is often faster than learning "what the next state will look like." Offloading state prediction to a simple memory structure bypasses the inaccuracies of neural world models.
  • Memory as an Instant Model: A hash table provides an immediate, perfect record of visited states. When the environment changes, the agent can simply purge conflicting memories to allow for immediate behavioral shifts.
  • The Power of Satisficing: Removing the hard constraint of optimality allows for much faster convergence. In volatile environments, being "good enough" immediately is more valuable than being "perfect" after the opportunity has passed.

Limitations and Future Work

While promising, the current implementation has limitations. The use of a hash table is suited for discrete spaces; extending this to continuous environments (like robotics) would require state abstraction or density models. Additionally, the approach currently requires clear, vectorizable goals. Future research could explore "memory forgetting" mechanisms to manage large-scale environments and the potential for multi-agent memory sharing.

Conclusion

By combining the reactive speed of neural networks with the deliberative precision of memory-based planning, the Fast & Slow framework offers a robust alternative to traditional RL. It demonstrates that prioritizing adaptability and satisficing can lead to significantly better performance in the complex, changing environments that characterize the real world.

Summary updated

BibTeX
@inproceedings{tan2023learning,
  author = {Chong Min John Tan and Mehul Motani},
  title = {{Learning, Fast and Slow: A Goal-Directed Memory-Based Approach for Dynamic Environments}},
  booktitle = {ICDL},
  year = {2023},
  doi = {10.1109/icdl55364.2023.10364540},
}
Figure