BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystack

Yuri Kuratov, A. Bulatov, Petr Anokhin, Ivan Rodkin, Dmitry Sorokin +2 more
2/3/2026

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

Abstract

In recent years, the input context sizes of large language models (LLMs) have increased dramatically. However, existing evaluation methods have not kept pace, failing to comprehensively assess the efficiency of models in handling long contexts. To bridge this gap, we introduce the BABILong benchmark, designed to test language models' ability to reason across facts distributed in extremely long documents. BABILong includes a diverse set of 20 reasoning tasks, including fact chaining, simple induction, deduction, counting, and handling lists/sets. These tasks are challenging on their own, and even more demanding when the required facts are scattered across long natural text. Our evaluations show that popular LLMs effectively utilize only 10-20\% of the context and their performance declines sharply with increased reasoning complexity. Among alternatives to in-context reasoning, Retrieval-Augmented Generation methods achieve a modest 60\% accuracy on single-fact question answering, independent of context length. Among context extension methods, the highest performance is demonstrated by recurrent memory transformers after fine-tuning, enabling the processing of lengths up to 50 million tokens. The BABILong benchmark is extendable to any length to support the evaluation of new upcoming models with increased capabilities, and we provide splits up to 10 million token lengths.

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{kuratov2026babilong,
  title  = {BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystack},
  author = {Yuri Kuratov and A. Bulatov and Petr Anokhin and Ivan Rodkin and Dmitry Sorokin and Artyom Y. Sorokin and M. Burtsev},
  year   = {2026},
  eprint = {2406.10149},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2406.10149},
  url    = {https://arxiv.org/abs/2406.10149},
  journal = {NEURIPS 2024 2024}
}

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

Discussion