arXiv:2502.05167cs.CL2025-02ICML被引 122

测试大模型在超长文本中找信息的能力,发现真实表现远低于预期。

NoLiMa: Long-Context Evaluation Beyond Literal Matching

论文配图:NoLiMa: Long-Context Evaluation Beyond Literal Matching
图 1 · 摘自论文原文
  • 设计新评测方法,让问题与答案几乎无字面重合,逼模型理解深层关联。
  • 13个主流大模型在32K上下文时性能普遍下降,多数低于50%基准水平。
  • 连GPT-4o也从99.3%降至69.7%,说明长文本推理仍存根本性挑战。

当前大语言模型支持128K至100万词元的长上下文,主流评估方法为针堆测试(NIAH),即从大量无关内容中找出关键信息。现有方法常依赖问题与内容间的字面匹配,使任务过于简单。为此,我们提出NoLiMa,通过精心设计的问答对,使问题与答案极少出现词汇重合,迫使模型依靠隐含关联推理定位信息。我们评估了13个宣称支持至少128K上下文的主流模型。尽管在短上下文(<1K)表现良好,但随着上下文增长,性能显著下降:在32K时,11个模型性能低于其短上下文基线的50%。即使顶级模型GPT-4o,准确率也从接近完美的99.3%降至69.7%。分析表明,这主要源于注意力机制在缺乏字面匹配时,在长文本中难以有效捕捉相关线索。即便引入推理链或思维链提示,模型仍难维持高性能。数据集与代码已开源:https://github.com/adobe-research/NoLiMa。

原文摘要 · Abstract (English)

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.

长文本评测大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。