LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding

Yushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu, Jiankai Tang, Zhidian Huang, Zhengxiao Du, Xiao Liu, Aohan Zeng, Lei Hou, Yuxiao Dong, Jie Tang, Juanzi Li

Abstract

LongBench is the first comprehensive, bilingual (English and Chinese) benchmark designed to rigorously evaluate how Large Language Models (LLMs) handle long contexts. By moving beyond simple "needle-in-a-haystack" tests, it provides a multi-task suite that reveals a significant performance gap: even top-tier models like GPT-3.5-Turbo-16k struggle as context lengths scale toward their theoretical limits.

Introduction

In the current LLM landscape, context window sizes are expanding rapidly—from 2k tokens to 128k and beyond. However, a large window does not necessarily equate to effective reasoning over the information within it. Most existing evaluations rely on perplexity or simple synthetic tasks that fail to mirror real-world complexities like legal analysis or multi-document summarization. LongBench addresses this by providing a standardized, multi-task benchmark to test whether models can synthesize information across thousands of words in both English and Chinese.

Benchmark Composition

LongBench incorporates 21 datasets (14 English, 7 Chinese) covering six major task categories: Single-Doc QA, Multi-Doc QA, Summarization, Few-shot Learning, Synthetic Tasks, and Code Completion. The average length of English instances is approximately 6,700 words, while Chinese instances average 13,300 characters.

Table 1: Detailed overview of the 21 datasets included in LongBench, categorized by task type.

Methodology

To ensure a fair and rigorous evaluation, the authors implemented several key methodological choices:

  1. Standardization: All datasets were converted into a unified (Input, Context, Answer) format for automated, reproducible evaluation.
  2. Middle Truncation: When input exceeds a model's capacity, the middle of the text is truncated. This preserves the beginning (instructions) and the end (the specific question), which are often most critical.
  3. LongBench-E: A specialized subset with an even distribution of context lengths (0-4k, 4k-8k, and 8k+) to isolate performance degradation.
  4. Evaluation Metrics: Task-specific metrics such as F1-score, ROUGE-L, and Edit Similarity were utilized.

Key Insights and Results

The evaluation of various state-of-the-art models revealed several critical findings regarding long-context capabilities.

The "Long-Context Tax"

Even the highest-performing models exhibit a "significant decline" in performance as context length increases. For instance, GPT-3.5-Turbo-16k experienced a 17% drop in accuracy when moving from the 0-4k range to the 8k+ range. This suggests that current models struggle to maintain focus and reasoning quality over extended sequences.

Figure 4: Average scores of various LLMs across different context length ranges (0-4k, 4k-8k, 8k+), illustrating the performance decline as length increases.

Model Performance

  • Commercial Dominance: GPT-3.5-Turbo-16k outperformed all tested open-source models, though it still faced challenges with the longest sequences.
  • Open-Source Progress: Among open-source models, ChatGLM2-6B-32k and LongChat-v1.5-7B-32k emerged as top performers. ChatGLM2-6B-32k, in particular, achieved a 62% relative improvement over its base version, demonstrating the efficacy of supervised fine-tuning on long sequences.
  • Retrieval vs. Native Context: While Retrieval-Augmented Generation (RAG) can assist models with weak native long-context abilities, it can actually hinder models that possess native capabilities by discarding nuanced, distributed information.

Limitations and Future Directions

The authors identify several hurdles for future research:

  1. Metric Reliability: Standard metrics like ROUGE-L may not fully capture the quality of long-form generation.
  2. Instruction Following: Model scores are often "coupled" with their ability to follow specific output formats; a failure in instruction following can mask true context understanding.
  3. Reasoning over Retrieval: Future benchmarks should focus on tasks requiring reasoning over multiple scattered facts rather than simple fact retrieval.

Summary updated

BibTeX
@inproceedings{bai2024longbench,
  author = {Yushi Bai and Xin Lv and Jiajie Zhang and Hongchang Lyu and Jiankai Tang and Zhidian Huang and Zhengxiao Du and Xiao Liu and Aohan Zeng and Lei Hou and Yuxiao Dong and Jie Tang and Juanzi Li},
  title = {{LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.172},
}
Figure