# Human-like Episodic Memory for Infinite Context LLMs

**Authors:** Zafeirios Fountas, Martin A Benfeghoul, Adnan Oomerjee, Fenia Christopoulou, Gerasimos Lampouras, Haitham Bou-Ammar, Jun Wang  
**arXiv:** [2407.09450](https://arxiv.org/abs/2407.09450)  
**Date:** 2024-07-12  
**Summary page:** https://www.summarizepaper.com/en/paper/2407.09450v1/

## Key points

- Large language models (LLMs) struggle with processing extensive contexts, limiting coherence and accuracy over long sequences.
- The human brain excels at organizing and retrieving episodic experiences across vast temporal scales.
- EM-LLM integrates human-like episodic memory and event cognition into LLMs to address this limitation.
- EM-LLM organizes token sequences into coherent episodic events using Bayesian surprise and graph-theoretic boundary refinement in real-time.
- It allows the model to handle practically infinite context lengths efficiently.
- Events are retrieved through a two-stage memory process that combines similarity-based and temporally contiguous retrieval for efficient access to relevant information.
- EM-LLM outperforms the state-of-the-art InfLLM model on the LongBench dataset, showing an overall relative improvement of 4.3% and a 33% enhancement specifically on the PassageRetrieval task.
- The model's event segmentation correlates strongly with human-perceived events, bridging artificial systems with biological counterparts.
- EM-LLM leverages insights from hierarchical and nested-timescale structures in memory formation to enhance long-term memory recall efficiency in complex tasks with extended contexts.
- It provides a computational framework for exploring human memory mechanisms and opens new avenues for research in AI and cognitive science by integrating key aspects of human cognition into artificial intelligence systems.

## Summary

Large language models (LLMs) have demonstrated impressive capabilities but struggle with processing extensive contexts, limiting their coherence and accuracy over long sequences. In contrast, the human brain excels at organizing and retrieving episodic experiences across vast temporal scales. To address this limitation, we introduce EM-LLM, a novel approach that integrates human-like episodic memory and event cognition into LLMs. EM-LLM organizes token sequences into coherent episodic events using Bayesian surprise and graph-theoretic boundary refinement in real-time. This allows the model to handle practically infinite context lengths efficiently. When needed, events are retrieved through a two-stage memory process that combines similarity-based and temporally contiguous retrieval for efficient access to relevant information. Experiments on the LongBench dataset demonstrate EM-LLM's superior performance compared to the state-of-the-art InfLLM model. Across various tasks, including PassageRetrieval, EM-LLM shows an overall relative improvement of 4.3%, with a remarkable 33% enhancement on the PassageRetrieval task specifically. The model's event segmentation correlates strongly with human-perceived events, bridging artificial systems with biological counterparts. Furthermore, our method leverages insights from hierarchical and nested-timescale structures in memory formation. By dynamically segmenting token sequences into episodic events based on surprise levels and refining boundaries for cohesion and separation of content, EM-LLM enhances long-term memory recall efficiency in complex tasks with extended contexts. In conclusion, EM-LLM not only advances LLM capabilities in processing extended contexts but also provides a computational framework for exploring human memory mechanisms. This interdisciplinary approach opens new avenues for research in AI and cognitive science by integrating key aspects of human cognition into artificial intelligence systems.
