In Search of Needles in a 11M Haystack: Recurrent Memory Finds What LLMs Miss

Yuri Kuratov, Aydar Bulatov, Petr Anokhin, Dmitry Sorokin, Artyom Sorokin +1 more
2/16/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: booydar/babilong (257 stars, Apache-2.0, last commit 2025-09-02).

Abstract

This paper addresses the challenge of processing long documents using generative transformer models. To evaluate different approaches, we introduce BABILong, a new benchmark designed to assess model capabilities in extracting and processing distributed facts within extensive texts. Our evaluation, which includes benchmarks for GPT-4 and RAG, reveals that common methods are effective only for sequences up to $10^4$ elements. In contrast, fine-tuning GPT-2 with recurrent memory augmentations enables it to handle tasks involving up to $11\times 10^6$ elements. This achievement marks a substantial leap, as it is by far the longest input processed by any neural network model to date, demonstrating a significant improvement in the processing capabilities for long sequences.

View on arXivView PDF

Code Implementations(1)

booydar/babilongCommunity100%
Apache-2.0

BABILong is a benchmark for LLM evaluation using the needle-in-a-haystack approach.

25728Shell, PythonFeb 6, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{kuratov2024search,
  title  = {In Search of Needles in a 11M Haystack: Recurrent Memory Finds What LLMs Miss},
  author = {Yuri Kuratov and Aydar Bulatov and Petr Anokhin and Dmitry Sorokin and Artyom Sorokin and Mikhail Burtsev},
  year   = {2024},
  eprint = {2402.10790},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.10790v2}
}

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/2402.10790.svg)](https://codeofpaper.com/paper/2402.10790)

Discussion