Lune

ICLR2025Top-tier venue

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

Lizhe Fang, Yifei Wang, Zhaoyang Liu, Chenheng Zhang, Stefanie Jegelka, Jinyang Gao, Bolin Ding, Yisen Wang

Abstract

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

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

22 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Efficient Streaming Language Models with Attention Sinks cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Efficient Streaming Language Models with Attention Sinks cites Compressive Transformers for Long-Range Sequence Modelling
  • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation cites Compressive Transformers for Long-Range Sequence Modelling
  • Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models cites Efficient Streaming Language Models with Attention Sinks
  • Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models cites Measuring Massive Multitask Language Understanding
  • Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • TruthfulQA: Measuring How Models Mimic Human Falsehoods cites Measuring Massive Multitask Language Understanding
  • InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation cites Efficient Streaming Language Models with Attention Sinks
  • InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long Adaptation cites Measuring Massive Multitask Language Understanding
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers22

  1. Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language ModelsXin Cheng, Wangding Zeng, Damai Dai, Qinyu Chen et al.ACL 2026 · 57 citations
  2. No Prompt Left Behind: Exploiting Zero-Variance Prompts in LLM Reinforcement Learning via Entropy-Guided Advantage ShapingThanh-Long V. Le, Myeongho Jeon, Kim Vu, Viet Dac Lai et al.ICLR 2026 · 55 citations
  3. InfLLM-V2: Dense-Sparse Switchable Attention for Seamless Short-to-Long AdaptationWeilin Zhao, Zihan Zhou, Zhou Su, Chaojun Xiao et al.ICLR 2026 · 32 citations
  4. Process-Verified Reinforcement Learning for Theorem Proving via LeanMinsu Kim, Se-Young YunICLR 2026 · 16 citations
  5. Short Window Attention Enables Long-Term MemorizationLoïc Cabannes, Maximilian Beck, Maria Lomeli, Gergely Szilvasy et al.ICLR 2026 · 11 citations

Builds on26

  1. Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
  2. TruthfulQA: Measuring How Models Mimic Human FalsehoodsStephanie Lin, Jacob Hilton, Owain EvansACL 2022 · 3,228 citations
  3. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
  4. Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 citations
  5. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations

Related papers

  1. 100-LongBench: Are de facto Long-Context Benchmarks Literally Evaluating Long-Context Ability?Wang Yang, Hongye Jin, Shaochen Zhong, Song Jiang et al.ACL Findings 2025
  2. Needle Threading: Can LLMs Follow Threads Through Near-Million-Scale Haystacks?Jonathan Roberts, Kai Han, Samuel AlbanieICLR 2025
  3. On Many-Shot In-Context Learning for Long-Context EvaluationKaijian Zou, Muhammad Khalifa, Lu WangACL 2025 · 6 citations
  4. L-Eval: Instituting Standardized Evaluation for Long Context Language ModelsChenxin An, Shansan Gong, Ming Zhong, Xingjian Zhao et al.ACL 2024 · 6 citations
  5. LongBench: A Bilingual, Multitask Benchmark for Long Context UnderstandingYushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu et al.ACL 2024 · 94 citations
Dusk over the sea between two cliffs drawn in fine vertical lines