What is Wrong with Perplexity for Long-context Language Modeling?
Open accessAbstract
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.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
PPL may not distinguish a model's ability to capture local vs. long-range dependencies between tokens.
“This finding is in line with recent criticism that PPL may not distinguish a model's ability to capture local vs. long-range dependencies between tokens (Hu et al., 2024; Fang et al., 2024).”
From MesaNet: Sequence Modeling by Locally Optimal Test-Time Training (2025) · cites this paper as Fang et al., 2024
Cites
The publisher hasn’t deposited this paper’s reference list.
Cited by
Sorted by citations
LADM: Long-context Training Data Selection with Attention-based Dependency Measurement for LLMs
Chen, J., Wu, J., Xu, Y., & Zhang, J. (2025) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2025.acl-long.154 · Cited by 7 · see citing works
BehaviorBox: Automated Discovery of Fine-Grained Performance Differences Between Language Models
Tjuatja, L., & Neubig, G. (2025) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2025.acl-long.923 · Cited by 4 · see citing works
ConSens: Assessing Context Grounding in Open-Book Question Answering
Vankov, I., Ivanov, M., Correia, A. D., & Botev, V. (2025) · Lecture notes in computer science · doi:10.1007/978-3-032-04549-2_13 · Cited by 1 · see citing works
Cognitive stylometry: A computational study of defamiliarization in modern Chinese
Kurzynski, M. (2025) · Computational Humanities Research · doi:10.1017/chr.2025.10020 · Cited by 1 · see citing works
MesaNet: Sequence Modeling by Locally Optimal Test-Time Training
von Oswald, J., Scherrer, N., Kobayashi, S., Versari, L., Yang, S., Mittal, S., Schlegel, M., Maile, K., Schimpf, Y., Sieberling, O., et al. (2025) · arXiv
“This finding is in line with recent criticism that PPL may not distinguish a model’s ability to capture local vs. long-range dependencies between tokens [49, 30].”
“Otherwise” in Context: Exploring Discourse Functions with Language Models
Liu, G., Webber, B., & Rohde, H. (2025) · doi:10.18653/v1/2025.codi-1.7
Beyond One-Size-Fits-All: Adaptive Fine-Tuning for LLMs Based on Data Inherent Heterogeneity
Zhang, W., Xu, Y., Ren, S., & Zhang, J. (2025) · Lecture notes in computer science · doi:10.1007/978-981-95-3343-5_22
Koval, R., Andrews, N., & Yan, X. (2025) · International Joint Conference on Natural Language Processing and Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics (IJCNLP-AACL) · doi:10.18653/v1/2025.ijcnlp-long.54
LiteKV: A KV cache compression method for efficient inference on resource-constrained devices
Zhang, Z., & Ilvovsky, D. (2026) · Information Processing & Management · doi:10.1016/j.ipm.2026.104889
Klieb, L., Niinimaki, M., El-Yafouri, R., Makorn, P. T., Wanavit, T., Sallee, S., & Udofia, A. (2024) · International Journal of Healthcare Technology and Management · doi:10.1504/ijhtm.2024.154280
Diagnosing LLMs via Information Spectrum Analysis: Tail Behavior and the Effects of Side Information
Tachioka, Y. (2026) · Findings of the Association for Computational Linguistics: ACL (Findings of ACL) · doi:10.18653/v1/2026.findings-acl.594
TensorLens: End-to-End Transformer Analysis via High-Order Attention Tensors
Atad, I. A., Zimerman, I., Katz, S., & Wolf, L. (2026) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2026.acl-long.156
Hirosawa, T., Harada, Y., Kawamura, R., & Shimizu, T. (2026) · JMIR Formative Research · doi:10.2196/98819
Fixed-Content Perplexity as a Low-Overhead Contextual Boundedness Score for LLM Systems
Dimant, G., Neubauer, T. R., Maita, A. R. C., Filho, G. A. A., Costa, G. M. L., & Peres, S. M. (2026) · Lecture notes in computer science · doi:10.1007/978-3-032-39895-6_3
ClueKV: Self-Guided KV Cache Compression via Adaptive Head Prioritization
Xiao, Z., Kai, J., & Jiang, B. (2026) · Findings of the Association for Computational Linguistics: EMNLP (Findings of EMNLP) · doi:10.18653/2026.findings-emnlp.393
- Authors
- Fang, L., Wang, Y., Liu, Z., Zhang, C., Jegelka, S., Gao, J., Ding, B., & Wang, Y.
- Affiliations
- Peking University (CN)
- MIT Computer Science and Artificial Intelligence Laboratory (US)
- Alibaba Group (China) (CN)
- Munich Center for Machine Learning (DE)
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2024
- ISSN
- 2331-8422 (ISSN-L)
- arXiv
- 2410.23771
- OpenAlex
- W4404347231
- Cited by
- 2
- References
- 0
- Citations by year
- 2025: 2
- Type
- posted content
- Language
- en
- Open access
- green
- arxiv.org
- Licence
- Locations
- arXiv (Cornell University) (submittedVersion, cc-by-nc-sa)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Multimodal Machine Learning Applications
- Keywords
- perplexity, long-context language modeling, large language models, evaluation metrics, token weighting, in-context learning, long-context understanding
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review