🚀 Excited to share our new pre-print: "Human-like Episodic Memory for Infinite Context LLMs"! We introduce EM-LLM, a novel approach integrating cognitive science insights into LLMs for vastly extended context processing:
arxiv.org/pdf/2407.09450
What we did:
· 📊 We treat LLMs' K-V cache as analogous to personal experiences and segmented it into events of episodic memory based on Bayesian surprise (or prediction error).
· 🔍 We then apply a graph-theory approach to refine these events, optimizing for relevant information during retrieval.
· 🔄 When deemed important by the LLM's self-attention, past events are recalled based on similarity to the current query, promoting temporal contiguity & asymmetry, mimicking human free recall effects.
· ✨ This allows LLMs to handle virtually infinite contexts more accurately than before, without retraining.
Our method outperforms the SOTA model InfLLM on LongBench, given an LLM and context window size, achieving a 4.3% overall improvement with a significant boost of 33% on PassageRetrieval. Notably, EM-LLM's event segmentation also strongly correlates with human-perceived events!!
We are releasing this method today with our first set of results, but more results and analysis are coming soon.
Huge thanks to all my co-authors/colleagues for this amazing collaboration: Martin A Benfeghoul, Adnan Oomerjee,
@fenchri,
@glampouras_NLP,
@hbouammar from
@Huawei Noah's Ark and Jun Wang from
@UCL.
For a fuller description, check out
@hbouammar's thread:
x.com/hbouammar/status/18127…
Stay tuned for more updates and a code release soon :)
#LLMs #LongContextLLMs #EpisodicMemory #NLP #CogSci #MachineLearning #AI