Introduction
Deep Reinforcement Learning (DRL) has achieved remarkable success in various domains, yet it remains notoriously data-hungry, often requiring millions of environment interactions to master simple tasks. In contrast, biological systems exhibit high sample efficiency by leveraging episodic memory—the ability to recall specific past experiences to guide current decision-making. While integrating episodic memory into DRL agents has shown promise, existing approaches often rely on "non-adaptive" retrieval mechanisms. These systems typically retrieve memories based solely on the current state, failing to account for the specific task or goal at hand. This lack of task-specific adaptability limits an agent's ability to generalize across diverse multitask environments.
Methodology: The EMPPOHypernet Framework
To address the limitations of static memory retrieval, we propose EMPPOHypernet (Actor-Critic with Multitask Episodic Memory Based on Hypernetwork). This architecture introduces a task-adaptive retrieval mechanism inspired by the function of the biological hippocampus.
The framework consists of three core components:
- Task-Conditioned Hypernetwork: Rather than using fixed weights, the agent employs a hypernetwork to generate parameters for the retrieval and decision modules. This hypernetwork takes task-specific information—including a task ID and a natural language description processed by a T5 Transformer—as input. This allows the agent to dynamically reconfigure its internal processing logic for each unique goal.
- Adaptive Retrieval Network: Using the task-specific weights from the hypernetwork, this module utilizes an attention mechanism to query an episodic memory table. It identifies past state-value pairs that are most relevant to both the current observation and the specific task objectives.
- Dynamic Modification Mechanism: To integrate retrieved memories effectively, we modify the standard Critic loss function using a dynamic parameter, $\alpha$. When the retrieval system identifies highly relevant past experiences (indicated by high attention scores), $\alpha$ increases, allowing these memories to exert greater influence over the agent's current value estimation.
Experimental Setup
The proposed method was evaluated using the MiniGrid environment, a challenging 2D grid-world benchmark. We designed three multitask scenarios of increasing complexity:
- MT3: Comprising 3 tasks (LavaGap, RedBlueDoors, and Memory).
- MT5: Expanding to 5 tasks by adding DoorKey and DistShift.
- MT7: The most difficult scenario, featuring 7 tasks including SimpleCrossing and MultiRoom.
Performance was compared against standard Proximal Policy Optimization (PPO) and several episodic memory baselines.
Results and Discussion
The experimental results demonstrate that task-adaptive retrieval significantly enhances performance in multitask settings. As shown in the table below, EMPPOHypernet consistently outperforms all baselines across all scenarios.
In the most demanding MT7 scenario, EMPPOHypernet achieved an average reward of 0.60, a ten-fold improvement over standard PPO, which struggled at 0.06. Furthermore, the agent exhibited faster convergence, reaching higher reward levels earlier in the training process compared to non-adaptive retrieval methods. Ablation studies confirmed that both the hypernetwork-based parameter generation and the dynamic modification mechanism are critical for these gains; removing either component led to a significant degradation in performance.
Conclusion
This work highlights the importance of goal-oriented memory retrieval in multitask reinforcement learning. By conditioning the retrieval process on task information via a hypernetwork, agents can more effectively leverage relevant past experiences. Future research will focus on scaling this approach to larger memory buffers and exploring its applicability to continuous control tasks and high-fidelity 3D simulations.
Summary updated