Skip to main content
QUICK REVIEW

[论文解读] NoLiMa: Long-Context Evaluation Beyond Literal Matching

Ali Modarressi, Hanieh Deilamsalehy|ArXiv.org|Feb 7, 2025
Speech and dialogue systemsComputer Science被引用 4
一句话总结

NoLiMa 创建了一个大海捞针的基准,在问题与针之间几乎没有字面重叠,揭示了在上下文长度增加时,12种流行的长上下文大语言模型的潜在联想推理能力极限。

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 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.

研究动机与目标

  • 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.

提出的方法

  • 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.

实验结果

研究问题

  • 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?

主要发现

  • 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.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。