Abstract
Current memory-augmented neural networks (MANNs) face significant scalability challenges when processing data streams that exceed the capacity of their external memory storage. In lifelong learning scenarios, models often receive effectively infinite data streams containing a high proportion of uninformative entries. We address this by proposing Long-term Episodic Memory Networks (LEMN), which utilize a reinforcement learning-based "retention agent" to manage memory. This agent learns to identify and protect data instances of both generic and historical importance while evicting less relevant entries. We evaluate LEMN on path-finding tasks, synthetic question answering (bAbI), and real-world reading comprehension (TriviaQA). Our results demonstrate that LEMN significantly outperforms rule-based memory scheduling (e.g., FIFO, LRU) and basic RL baselines by effectively filtering noise and retaining critical information over long horizons.
Introduction
While Recurrent Neural Networks (RNNs) and MANNs have advanced sequential data processing, they are often constrained by the size of their external memory. In streaming data contexts, where sequences are far larger than the available memory, the system must decide which information to overwrite. Most existing architectures rely on hand-crafted heuristics such as First-In-First-Out (FIFO) or Least Recently Used (LRU). These rules are content-agnostic; they may inadvertently delete a crucial "indicator" fact encountered early in a sequence that is required much later.
This paper frames memory management as a strategic learning problem. By training a retention agent to evaluate the relative and historical importance of data, we enable the model to develop a policy for long-term information preservation.
Methods
The core of the LEMN architecture is a retention agent trained via Reinforcement Learning, specifically using the Asynchronous Advantage Actor-Critic (A3C) algorithm with Generalized Advantage Estimation. When the memory buffer is full, the agent generates a probability distribution over all memory slots, sampling one for eviction to make room for new incoming data.
We explore three distinct architectures for the retention agent:
- Input-Matching LEMN (IM-LEMN): A baseline approach where the agent decides what to delete based solely on the similarity between the current input and individual memory entries.
- Spatial LEMN (S-LEMN): This variant employs a bidirectional GRU to process all current memory entries simultaneously. This allows the agent to assess the relative importance of an entry compared to its neighbors, facilitating the identification of redundant information.
- Spatio-Temporal LEMN (ST-LEMN): Our primary model adds a temporal GRU layer to track the historical importance of entries over time. By "remembering that it remembered" something important, the model achieves a more stable and consistent retention policy.
Experimental Evaluation
Datasets
We validated LEMN across three challenging domains:
- 3D Maze Navigation: In the "IMaze" task, the agent must remember a color indicator seen at the start of a long, featureless corridor to choose the correct exit at the end.
- Synthetic Episodic QA (bAbI): We utilized "Noisy" and "Large" versions of the bAbI tasks, where irrelevant sentences are injected to test the model's ability to filter out distractions.
- TriviaQA: A large-scale reading comprehension dataset using Wikipedia documents, testing the model's performance on natural language and long contexts.
Key Results
- Long-Range Dependencies: In the IMaze task with a corridor length of 200 steps, standard models using FIFO dropped to near 0% success. In contrast, ST-LEMN maintained a 100% success rate, demonstrating its ability to "lock" the critical indicator in memory despite hundreds of intervening uninformative frames.
- Noise Robustness: On the "Large" bAbI task with a limited memory size (N=10), ST-LEMN achieved an error rate of 5.6%, significantly lower than the FIFO baseline (32.4%) and the simpler IM-LEMN (9.0%).
- Real-World Scalability: On TriviaQA, ST-LEMN achieved an ExactMatch score of 45.21, nearly 2.5 times higher than the FIFO baseline (18.49). The temporal component proved vital, as ST-LEMN also outperformed the non-temporal S-LEMN (42.97).
Discussion and Insights
Our analysis reveals that memory management is a strategic behavior. In navigation tasks, ST-LEMN learns to immediately evict "corridor" frames—which are visually identical and provide no new information—to ensure the unique "indicator" frame is never overwritten.
The "Spatial" component allows the model to understand contextual importance, while the "Temporal" component provides the stability necessary for long-term retention. Without tracking historical importance, agent decisions can become erratic, leading to the accidental deletion of critical facts during long sequences.
Limitations and Future Work
While effective, the current retention agent was tested on relatively small memory capacities (N=5 to 10). Scaling to thousands of slots may increase computational overhead due to the bidirectional GRU layers. Future research could explore applying LEMN to dialogue generation, where a system must distinguish between transient "small talk" and long-term user preferences mentioned earlier in a conversation.
Summary updated