Testing Memory Capabilities in Large Language Models with the Sequence Order Recall Task

Mathis Pink, Vy A. Vo, Qinyuan Wu, Jianing Mu, Javier S. Turek, Uri Hasson, Kenneth A. Norman, Sebastian Michelmann, Alexander Huth, Mariya TonevaLXAI @ NeurIPS 2024

TL;DR

This paper introduces the Sequence Order Recall Task (SORT), a new benchmark designed to evaluate the episodic memory capabilities of Large Language Models (LLMs). By testing LLMs' ability to recall the correct order of text segments, the authors reveal a significant gap: while LLMs excel at in-context recall, their performance plummets when relying on internal memory, suggesting a need for memory-augmented LLM architectures.

What Problem Does This Paper Address?

Current benchmarks for Large Language Models (LLMs) primarily focus on evaluating their semantic memory – their ability to recall facts and relationships. However, human memory is also deeply tied to episodic recall, where context like time and place is crucial for reconstructing events. LLMs currently lack a robust evaluation for this type of contextual memory. This paper aims to bridge this gap by introducing a task that specifically probes an LLM's ability to remember the order of information, akin to human episodic memory.

Methods

The core contribution is the Sequence Order Recall Task (SORT). This task presents an LLM with a text excerpt and then asks it to determine the correct order of two non-overlapping segments (XA and XB) that were originally part of that excerpt. The task is designed to be self-supervised, meaning it doesn't require additional human annotations.

The authors implement SORT in two main ways:

  1. In-context evaluation: The full text excerpt is provided to the LLM as part of the prompt, along with instructions to recall the order of segments.
  2. Memory-less evaluation: The LLM is only given the two segments (XA and XB) and the instruction to determine their original order, without access to the full text excerpt. This condition tests the model's ability to rely on memory stored within its parameters.
  3. Fine-tuning evaluation: A variation where the model is fine-tuned on the text excerpt before being tested in a memory-less fashion.

Datasets

The authors introduce the Book-SORT dataset. This dataset consists of approximately 36,000 samples extracted from 9 public domain books. The books were chosen to be long (averaging over 72,000 words) to challenge LLM context windows and were recently released to avoid pre-training contamination. The dataset is designed to vary factors like excerpt length, segment length, and the distance between segments to provide a comprehensive evaluation.

Key Insights and Ideas

  • Episodic Memory is a Weakness: The most striking finding is the stark performance difference between in-context recall and memory-less recall. This highlights that current LLMs, despite their impressive in-context abilities, struggle significantly when asked to recall information not explicitly presented in the immediate prompt.
  • In-Context Performance is High, but Fragile: LLMs achieve high accuracy (up to 95%) when the text is provided in-context. However, this performance degrades as the excerpt length increases, suggesting that even in-context, LLMs might have limitations in processing very long sequences.
  • Fine-tuning Doesn't Solve the Problem: Surprisingly, fine-tuning a model on the book texts did not significantly improve its performance in the memory-less condition. This suggests that simply exposing a model to data during fine-tuning doesn't necessarily imbue it with robust, recallable parametric memory for that specific data.
  • Distance Matters: Performance generally improves as the distance between the two segments increases. This might indicate that LLMs are better at distinguishing between segments that are further apart in the original sequence, potentially due to clearer temporal separation.

Key Results

  • In the in-context condition, LLMs achieved high accuracies, often exceeding 77% and reaching up to 95% for shorter excerpts. Performance generally decreased as excerpt length increased.
  • In the memory-less condition, accuracies dropped significantly, falling below 60% and often near chance levels. This indicates a failure to recall information stored in the model's weights.
  • Fine-tuning a Llama3-8b model on book texts did not lead to statistically significant improvements in the memory-less condition compared to models not fine-tuned on those specific books.
  • Some models showed slightly above-chance performance (up to 60%) in the memory-less condition for certain segment distances, which the authors find surprising and attribute to potential prior knowledge of the books or common sense reasoning.

Limitations and Future Work

The authors acknowledge that their evaluation of the memory-less condition is based on the assumption that the books in Book-SORT were not part of the LLMs' pre-training data. If this assumption is incorrect, the low performance might be less surprising.

Future work suggested by the paper includes:

  • Developing Memory-Augmented LLMs: The findings strongly suggest a need for architectures that explicitly incorporate memory mechanisms, rather than relying solely on parametric knowledge.
  • Expanding SORT: The task is extendable to other modalities like audio and video, opening avenues for evaluating memory across different data types.
  • Further Dataset Exploration: Investigating how different text characteristics or book genres affect performance could provide deeper insights.

Summary updated

BibTeX
@inproceedings{pink2024testing,
  author = {Mathis Pink and Vy A. Vo and Qinyuan Wu and Jianing Mu and Javier S. Turek and Uri Hasson and Kenneth A. Norman and Sebastian Michelmann and Alexander Huth and Mariya Toneva},
  title = {{Testing Memory Capabilities in Large Language Models with the Sequence Order Recall Task}},
  booktitle = {LXAI @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=5P0FhJRslE},
}
Figure