Needle in the Haystack for Memory Based Large Language Models

Elliot Nelson, Georgios Kollias, Payel Das, Subhajit Chaudhury, Soham Dan
7/1/2024
cs.CLcs.AIcs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Current large language models (LLMs) often perform poorly on simple fact retrieval tasks. Here we investigate if coupling a dynamically adaptable external memory to a LLM can alleviate this problem. For this purpose, we test Larimar, a recently proposed language model architecture which uses an external associative memory, on long-context recall tasks including passkey and needle-in-the-haystack tests. We demonstrate that the external memory of Larimar, which allows fast write and read of an episode of text samples, can be used at test time to handle contexts much longer than those seen during training. We further show that the latent readouts from the memory (to which long contexts are written) control the decoder towards generating correct outputs, with the memory stored off of the GPU. Compared to existing transformer-based LLM architectures for long-context recall tasks that use larger parameter counts or modified attention mechanisms, a relatively smaller size Larimar is able to maintain strong performance without any task-specific training or training on longer contexts.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nelson2024needle,
  title  = {Needle in the Haystack for Memory Based Large Language Models},
  author = {Elliot Nelson and Georgios Kollias and Payel Das and Subhajit Chaudhury and Soham Dan},
  year   = {2024},
  eprint = {2407.01437},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.01437v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.01437.svg)](https://codeofpaper.com/paper/2407.01437)

Discussion