NoLiMa: Long-Context Evaluation Beyond Literal Matching
Ali Modarressi, Hanieh Deilamsalehy, Franck Dernoncourt, Trung Bui, Ryan A. Rossi, Seunghyun Yoon, Hinrich Schütze
Abstract
Recent large language models (LLMs) support long contexts ranging from 128K to 1M tokens. A popular method for evaluating these capabilities is the needle-in-a-haystack (NIAH) test, which involves retrieving a "needle" (relevant information) from a "haystack" (long irrelevant context). Extensions of this approach include increasing distractors, fact chaining, and in-context reasoning. However, in these benchmarks, models can exploit existing literal matches between the needle and haystack to simplify the task. To address this, we introduce NOLIMA, a benchmark extending NIAH with a carefully designed needle set, where questions and needles have minimal lexical overlap, requiring models to infer latent associations to locate the needle within the haystack. We evaluate 13 popular LLMs that claim to support contexts of at least 128K tokens. While they perform well in short contexts (<1K), performance degrades significantly as context length increases. At 32K, for instance, 11 models drop below 50% of their strong short-length baselines. Even GPT-4o, one of the top-performing exceptions, experiences a reduction from an almostperfect baseline of 99.3% to 69.7%. Our analysis suggests these declines stem from the increased difficulty the attention mechanism faces in longer contexts when literal matches are absent, making it harder to retrieve relevant information. Even models enhanced with reasoning capabilities or CoT prompting struggle to maintain performance in long contexts. We publicly release the dataset and evaluation code at https://github.com/adoberesearch/NoLiMa . 1
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e00da7a6-1429-40ac-a065-de212224b1bfCited by top-tier papers7
- Sense and Sensitivity: Examining the Influence of Semantic Recall on Long Context Code UnderstandingAdam Storek, Mukur Gupta, Samira Hajizadeh, Prashast Srivastava et al.ACL 2026 · 4 citations
- AC-LoRA: (Almost) Training-Free Access Control Aware Multi-Modal LLMsLara Magdalena Lazier, Aritra Dhar, Vasilije Stambolic, Lukas CavigelliNeurIPS 2025 · 3 citations
- CogniLoad: A Synthetic Natural Language Reasoning Benchmark With Tunable Length, Intrinsic Difficulty, and Distractor DensityDaniel Kaiser, Arnoldo Frigessi, Ali Ramezani-Kebrya, Benjamin RicaudICLR 2026 · 3 citations
- A Multi-Agent Framework for High-Interaction Terminal SimulationKai Wei, Yuwen Cui, Kehan Shen, Hua Wei et al.ACL 2026
- L-CUBE: Isolating Long-Context Capacity from Knowledge with Controllable Mutual Information ScalingZhuo Chen, Oriol Mayné i Comas, Zhuotao Jin, Di Luo et al.ICML 2026
Builds on10
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo et al.NeurIPS 2022 · 8,168 citations
- Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng et al.SOSP 2023 · 1,016 citations
- Many-Shot In-Context LearningRishabh Agarwal, Avi Singh, Lei Zhang, Bernd Bohnet et al.NeurIPS 2024 · 271 citations
- Random-Access Infinite Context Length for TransformersAmirkeivan Mohtashami, Martin JaggiNeurIPS 2023 · 207 citations
Related papers
- Sequential-NIAH: A Needle-In-A-Haystack Benchmark for Extracting Sequential Needles from Long ContextsYifei Yu, Qian-Wen Zhang, Lingfeng Qiao, Di Yin et al.EMNLP 2025 · 2 citations
- HELMET: How to Evaluate Long-context Models Effectively and ThoroughlyHoward Yen, Tianyu Gao, Minmin Hou, Ke Ding et al.ICLR 2025
- One Thousand and One Pairs: A "novel" challenge for long-context language modelsMarzena Karpinska, Katherine Thai, Kyle Lo, Tanya Goyal et al.EMNLP 2024 · 6 citations
- NeedleInATable: Exploring Long-Context Capability of Large Language Models towards Long-Structured TablesLanrui Wang, Mingyu Zheng, Hongyin Tang, Zheng Lin et al.NeurIPS 2025 · 16 citations
- LongGenBench: Benchmarking Long-Form Generation in Long Context LLMsYuhao Wu, Ming Shan Hee, Zhiqiang Hu, Roy Ka-Wei LeeICLR 2025
