arXiv:2410.23771cs.CLcs.LG2024-10ICLR被引 67

提出新指标LongPPL,解决长文本理解中困惑度失效问题。

What is Wrong with Perplexity for Long-context Language Modeling?

  • 用长短上下文对比识别关键令牌,改进传统困惑度
  • 新指标与长文本任务表现相关性达-0.96,显著优于原指标
  • 适合评估和优化大模型长文本能力的研究者使用

长上下文处理对大语言模型在扩展对话、文档摘要和多示例上下文学习等任务中至关重要。尽管近期方法已扩展模型上下文窗口并采用困惑度(PPL)作为标准评估指标,但PPL在评估长上下文能力时已被证明不可靠。本文揭示其根本原因:PPL通过平均所有令牌的损失,忽略了对长上下文理解至关重要的关键令牌,从而掩盖了模型真实表现。为此,我们提出新指标LongPPL,通过长短上下文对比方法识别关键令牌。实验表明,LongPPL与多个长上下文基准性能高度相关(皮尔逊相关系数-0.96),预测准确性显著优于传统PPL。此外,我们引入LongCE损失函数,通过重加权策略在微调中优先关注关键令牌,在多种基准上均实现一致提升。这些工作深化了对PPL局限性的理解,并提供了精准评估与增强长上下文能力的有效方案。代码已开源:https://github.com/PKU-ML/LongPPL。

原文摘要 · Abstract (English)

Handling long-context inputs is crucial for large language models (LLMs) in tasks such as extended conversations, document summarization, and many-shot in-context learning. While recent approaches have extended the context windows of LLMs and employed perplexity (PPL) as a standard evaluation metric, PPL has proven unreliable for assessing long-context capabilities. The underlying cause of this limitation has remained unclear. In this work, we provide a comprehensive explanation for this issue. We find that PPL overlooks key tokens, which are essential for long-context understanding, by averaging across all tokens and thereby obscuring the true performance of models in long-context scenarios. To address this, we propose \textbf{LongPPL}, a novel metric that focuses on key tokens by employing a long-short context contrastive method to identify them. Our experiments demonstrate that LongPPL strongly correlates with performance on various long-context benchmarks (e.g., Pearson correlation of -0.96), significantly outperforming traditional PPL in predictive accuracy. Additionally, we introduce \textbf{LongCE} (Long-context Cross-Entropy) loss, a re-weighting strategy for fine-tuning that prioritizes key tokens, leading to consistent improvements across diverse benchmarks. In summary, these contributions offer deeper insights into the limitations of PPL and present effective solutions for accurately evaluating and enhancing the long-context capabilities of LLMs. Code is available at https://github.com/PKU-ML/LongPPL.

长文本困惑度评估指标LLM

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