What is Wrong with Perplexity for Long-context Language Modeling?
State Key Lab of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University(一般人工智能国家重点实验室,智能科学与技术学院,北京大学);MIT CSAIL(麻省理工学院计算机科学与人工智能实验室);Alibaba Group(阿里巴巴集团);TUM CIT, MCML, MDSI(技术大学(TUM) CIT、MCML、MDSI);MIT EECS, CSAIL(麻省理工学院电子工程与计算机科学系,计算机科学与人工智能实验室);Institute for Artificial Intelligence, Peking University(人工智能研究院,北京大学)
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.
Large Pre-trained Language Models Contain Human-like Biases of What is Right and Wrong to Do
Technical University of Darmstadt(达姆施塔特工业大学);Leibniz Institute for Research and Information in Education(莱布尼茨教育研究与信息研究所);Hessian Center for Artificial Intelligence (hessian.ai)(黑森州人工智能中心)
What's Wrong with Your Code Generated by Large Language Models? An Extensive Study
Fudan University(复旦大学);Peking University(北京大学);University of North Carolina at Chapel Hill(北卡罗来纳大学教堂山分校);Shanghai Qiji Zhifeng Co., Ltd.(上海启智风科技有限公司);Huazhong University of Science and Technology(华中科技大学)
How Many Code and Test Cases Are Enough? Evaluating Test Cases Generation from a Binary-Matrix Perspective
Harbin Institute of Technology(哈尔滨工业大学);Central South University(中南大学);Chinese Academy of Sciences(中国科学院);Peking University(北京大学);Beijing University of Posts and Telecommunications(北京邮电大学)
Same-Number Citation Swaps: Stress-Testing Jev as a Financial Evidence Judge
Sofia University(索菲亚大学);Indiana University(印第安纳大学);University of California, San Diego(加州大学圣迭戈分校);Northeastern University(东北大学);Michigan State University(密歇根州立大学)
The Lottery LLM Hypothesis, Rethinking What Abilities Should LLM Compression Preserve?
The Hong Kong University of Science and Technology(香港科技大学);The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));National University of Singapore(新加坡国立大学)