Abstract
The capability of large language models to handle long-context information plays a crucial role across various real-world applications. Existing methods for evaluating long-context abilities often rely either on real-world long texts, making it difficult to exclude the influence of models' inherent knowledge, or introduce large amounts of irrelevant filler content to artificially reach target lengths, reducing the relevance and effectiveness of assessments. To address these limitations, we introduce NeedleBench, a comprehensive synthetic framework designed to assess retrieval and reasoning performance in bilingual long-context tasks with adaptive context lengths. NeedleBench systematically embeds key data points at varying depths to rigorously test models' capabilities in diverse settings. Tasks within NeedleBench are categorized into two distinct scenarios: information-sparse, characterized by minimal relevant details embedded within extensive irrelevant text; and information-dense, implemented as the Ancestral Trace Challenge (ATC), where relevant information is continuously distributed throughout the context. Our experiments show that while recent reasoning models demonstrate strong performance on mathematical benchmarks, they still struggle to generalize their reasoning abilities to information-dense tasks, frequently encountering difficulties with continuous retrieval and reasoning even at relatively shorter context lengths.
Introduction
As Large Language Model (LLM) context windows expand to 128k tokens and beyond, traditional evaluation methods like the "Needle In A Haystack" (NIAH) test have become insufficient. NIAH typically involves retrieving a single fact buried in a mountain of irrelevant filler text. However, real-world long-context tasks—such as analyzing legal case files or technical documentation—are often information-dense, meaning almost every sentence is relevant. Furthermore, existing benchmarks often use real-world text, which risks data contamination. NeedleBench aims to provide a rigorous, synthetic, and bilingual framework to evaluate both retrieval and multi-step reasoning across varying information densities.
Methodology
The NeedleBench framework categorizes tasks into two primary scenarios to test the limits of long-context processing:
- Information-Sparse Tasks: These follow the traditional NIAH structure but add complexity. They include Single-Needle Retrieval (S-RT), Multi-Needle Retrieval (M-RT), and Multi-Needle Reasoning (M-RS), where a model must find and then logically connect 2 to 5 distinct facts hidden in filler text.
- Information-Dense Tasks (The Ancestral Trace Challenge - ATC): This is the primary innovation of the benchmark. Instead of filler text, the entire context consists of a scrambled series of kinship relationships. To identify the "eldest ancestor," the model must perform continuous retrieval and logical chaining. Every sentence in the context is a necessary link in the chain.
To quantify performance, the researchers proposed the ENL-50 (Effective Needle Length) metric, which measures the maximum number of logical steps (needles) a model can handle while maintaining at least 50% accuracy.
Key Results and Analysis
Experiments conducted across a wide range of models, including the Qwen-2.5 series, LLaMA-3.1, and reasoning-focused models like DeepSeek-R1, yielded several critical insights:
- The Reasoning Gap: Retrieval is largely "solved." Modern architectural advances allow even small models (1.5B) to achieve near-perfect scores on single-fact retrieval. However, as soon as the task requires connecting multiple "needles," performance plummets across the board.
- The "Under-thinking" Bottleneck: A specific failure mode was identified in state-of-the-art reasoning models. Even when a model is capable of deep thought, it often prematurely concludes that "no further inference can be made" despite clear clues remaining in the text. This accounted for over 60% of errors in dense reasoning tasks.
- The Density Wall: Most models fail entirely once the information density hits a certain threshold (around 64 needles in the ATC task). Even the strongest models struggle to maintain a continuous chain of logic when the context is saturated with relevant data.
DeepSeek-R1 achieved the best overall performance on the information-dense ATC task, demonstrating an ENL-50 of 256. In contrast, most standard non-chain-of-thought models had an ENL-50 of only 2 to 8.
Conclusion
NeedleBench reveals that while LLMs have mastered simple long-context retrieval, a significant gap remains in multi-step reasoning within dense information environments. The identification of the "under-thinking" phenomenon provides a target for future improvements, potentially through Reinforcement Learning (RL) strategies designed to encourage persistence in reasoning. NeedleBench provides the community with a essential tool for understanding and improving the genuine long-context capabilities of LLMs beyond simple memorization or retrieval.
Summary updated