[Paper Review] NoLiMa: Long-Context Evaluation Beyond Literal Matching
NoLiMa creates a needle-in-a-haystack benchmark where questions have minimal literal overlap with needles, revealing latent associative reasoning limits of 12 popular long-context LLMs as context length grows.
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 almost-perfect 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/adobe-research/NoLiMa.
Motivation & Objective
- Motivate evaluation of long-context understanding beyond surface literal matches.
- Design a needle set with minimal lexical overlap between questions and needles to test latent associative reasoning.
- Assess how state-of-the-art LLMs perform as context length scales from short to very long (up to 32K tokens).
- Analyze factors like latent hops, needle placement, and literal-match ablations that influence length generalization.
Proposed method
- Construct NoLiMa needle sets where questions link to needles via associative links (one-hop and two-hop).
- Embed needles in long haystacks built from open books and filter haystacks to remove distracting or conflicting information.
- Evaluate 12 models (≥128K token support) across multiple context lengths with 58 question-needle pairs and 5 haystacks per length.
- Use a base score computed from short contexts (1K and below) to normalize longer-context performance.
- Analyze effects of latency hops, inversion (question structure), and Chain-of-Thought prompting on performance.
- Perform ablations to show the impact of literal matches (Direct and MC setups) on task difficulty.
Experimental results
Research questions
- RQ1How does model performance on long-context retrieval degrade as context length increases when literal overlaps are minimized?
- RQ2What is the impact of latent reasoning steps (one-hop vs two-hop) and needle placement within the context on NoLiMa accuracy?
- RQ3To what extent do Chain-of-Thought prompts and reasoning-based models mitigate length generalization gaps?
- RQ4How do literal matches or distractors influence model success on long-context associative tasks?
Key findings
- Most models show high base scores in short contexts, but effective length (where performance stays above 85% of base) is often ≤ 2K tokens, with GPT-4o as a notable exception.
- Performance declines substantially at 32K context length; 10 of 12 models fall to half or less of their base scores at 32K.
- Two-hop tasks are harder than one-hop, and the gap between them widens with longer contexts.
- Inverted needle templates (where question structure delays the direct cue) are more challenging than default templates.
- CoT prompting improves performance but does not fully close the gap for long contexts, especially for two-hop tasks beyond 16K tokens.
- Literal matches dramatically ease solving (Direct and MC setups), underscoring reliance on surface cues in many benchmarks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.