diff --git a/README.md b/README.md index 77460da347ea8596a388e41f273fef6f80e7e420..65a51ad6196664d6d24bdf26f25fa4f2f42ee0d8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ 阅读[ä¸æ–‡ç‰ˆæœ¬](README_ZH.md). -# LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding +# 📖 LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding **LongBench** is the first benchmark for bilingual, multitask, and comprehensive assessment of **long context understanding** capabilities of large language models. LongBench includes different languages (Chinese and English) to provide a more comprehensive evaluation of the large models' multilingual capabilities on long contexts. In addition, LongBench is composed of six major categories and twenty different tasks, covering key long-text application scenarios such as multi-document QA, single-document QA, summarization, Few-shot learning, code completion, and synthesis tasks. @@ -22,14 +22,15 @@ LongBench includes 13 English tasks, 5 Chinese tasks, and 2 code tasks, with the | Synthetic Tasks | 2 | 1 | - | | Code Completion | - | - | 2 | -## Table of Contents -- [Leaderboard](#leaderboard) -- [How to evaluate on LongBench](#how-to-evaluate-on-LongBench) -- [Evaluation Result on Each Dataset](#evaluation-result-on-each-dataset) -- [Acknowledgement](#acknowledgement) -- [Citation](#citation) - -## Leaderboard +## 🔠Table of Contents +- [ðŸ–¥ï¸ Leaderboard](#leaderboard) +- [âš™ï¸ How to evaluate on LongBench](#how-to-evaluate-on-LongBench) +- [📊 Evaluation Result on Each Dataset](#evaluation-result-on-each-dataset) +- [📄 Acknowledgement](#acknowledgement) +- [📠Citation](#citation) + +<a name="leaderboard"></a> +## ðŸ–¥ï¸ Leaderboard Here is the average scores (%) on the main task categories in both Chinese and English languages under the Zero-shot scenario. Please refer to this [link](task.md) for the evaluation metrics used for each task. > Note: For text exceeding the processing length capability of the model, we truncate from the middle of the text, preserving information from the beginning and end, in accordance with the observations from [Lost in the Middle](https://arxiv.org/abs/2307.03172). Experiments show that this truncation method has the least impact on model performance. @@ -67,7 +68,8 @@ To more specifically analyze the models' relative performance under different co > Note: Assume that the model scores x on the data within a specific length range of a task, and y on all data of that task, then the model's **relative score** for that length range is (x/y-1). To better compare the trends of different models, we shift all the lines to 0 on 0-4k. -## How to evaluate on LongBench +<a name="how-to-evaluate-on-LongBench"></a> +## âš™ï¸ How to evaluate on LongBench #### Load Data You can download and load the **LongBench** data through the Hugging Face datasets ([🤗 HF Repo](https://huggingface.co/datasets/THUDM/LongBench)): @@ -111,7 +113,8 @@ python eval.py ``` You can get the evaluation results on all datasets in `result.json`. Please note that in `config/`, we provide the input format suitable for each dataset and the maximum output length. Feel free to modify them to better suit the model you want to evaluate. After modification, when evaluating with [pred.py](pred.py), the data will be automatically organized according to the new format to get the corresponding model output. -## Evaluation Result on Each Dataset +<a name="evaluation-result-on-each-dataset"></a> +## 📊 Evaluation Result on Each Dataset The following tables show the Zero-shot evaluation results (%) on all datasets, where Chinese datasets are denoted by "zh" (please refer to this [link](task.md) for the evaluation metrics used for each task). @@ -186,11 +189,13 @@ The following tables show the Zero-shot evaluation results (%) on all datasets, | ChatGLM2-6B | 3.2 | 2.1 | 5.5 | | ChatGLM2-6B-32k | 77.5 | 2.0 | 62.5 | -## Acknowledgement +<a name="acknowledgement"></a> +## 📄 Acknowledgement - Some of the tasks of **LongBench** are based on the datasets proposed by previous researchers, including [HotpotQA](https://hotpotqa.github.io/), [2WikiMultihopQA](https://aclanthology.org/2020.coling-main.580/), [Musique](https://arxiv.org/abs/2108.00573), [DuReader](https://github.com/baidu/DuReader), [NarrativeQA](https://arxiv.org/pdf/1712.07040.pdf), [Qasper](https://arxiv.org/pdf/2105.03011.pdf), [GovReport](https://arxiv.org/pdf/2104.02112.pdf), [QMSum](https://arxiv.org/pdf/2104.05938.pdf), [VCSUM](https://arxiv.org/abs/2305.05280), [TriviaQA](https://nlp.cs.washington.edu/triviaqa/), [NQ](https://ai.google.com/research/NaturalQuestions/), [TREC](https://aclanthology.org/C02-1150.pdf), [LSHT](http://tcci.ccf.org.cn/conference/2014/dldoc/evatask6.pdf), [LCC](https://arxiv.org/abs/2306.14893) and [RepoBench-P](https://arxiv.org/abs/2306.03091). -## Citation +<a name="citation"></a> +## 📠Citation This is a joint work by **THU-KEG** and **Zhipu AI**. We are currently working on the paper, and the citation information will be updated when it's ready. Please stay tuned~ When citing our work, please cite all of the original dataset papers. The relevant citation information is listed [here](refs/ref.bib). diff --git a/README_ZH.md b/README_ZH.md index 6bb46f258800d9b23102728456cdba41c40fb499..d0d71564dc810a4571ef41552d620827510e708a 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -5,7 +5,7 @@ Read this in [English](README.md). -# LongBench: 多任务ä¸è‹±åŒè¯é•¿æ–‡æœ¬ç†è§£è¯„测基准 +# 📖 LongBench: 多任务ä¸è‹±åŒè¯é•¿æ–‡æœ¬ç†è§£è¯„测基准 **LongBench**是第一个多任务ã€ä¸è‹±åŒè¯ã€é’ˆå¯¹å¤§è¯è¨€æ¨¡åž‹**长文本ç†è§£èƒ½åŠ›**的评测基准。在目å‰å¤§æ¨¡åž‹å¤šè¯è¨€èƒ½åŠ›å¼•èµ·å¹¿æ³›å…³æ³¨çš„背景下,LongBench涵盖了ä¸åŒçš„è¯è¨€ï¼ˆä¸æ–‡å’Œè‹±æ–‡ï¼‰ï¼Œä»¥æ¤æ¥å¯¹å¤§æ¨¡åž‹åœ¨é•¿æ–‡æœ¬ä¸‹çš„多è¯è¨€èƒ½åŠ›è¿›è¡Œæ›´å…¨é¢çš„评估。åŒæ—¶ï¼ŒLongBenchç”±å…大类ã€äºŒå个ä¸åŒçš„任务组æˆï¼Œè¦†ç›–了å•æ–‡æ¡£QAã€å¤šæ–‡æ¡£QAã€æ‘˜è¦ã€Few-shotå¦ä¹ ã€ä»£ç 补全和åˆæˆä»»åŠ¡ç‰å…³é”®çš„长文本应用场景。 @@ -22,14 +22,15 @@ LongBench包å«13个英文任务ã€5个ä¸æ–‡ä»»åŠ¡å’Œ2个代ç 任务,多数 | åˆæˆä»»åŠ¡ | 2 | 1 | - | | 代ç 补全 | - | - | 2 | -## 目录 -- [排行榜](#排行榜) -- [如何在LongBench上评测模型](#如何在LongBench上评测模型) -- [详细评测结果](#详细评测结果) -- [致谢](#致谢) -- [引用](#引用) +## 🔠目录 +- [ðŸ–¥ï¸ æŽ’è¡Œæ¦œ](#排行榜) +- [âš™ï¸ å¦‚ä½•åœ¨LongBench上评测模型](#如何在LongBench上评测模型) +- [📊 详细评测结果](#详细评测结果) +- [📄 致谢](#致谢) +- [📠引用](#引用) -## 排行榜 +<a name="排行榜"></a> +## ðŸ–¥ï¸ æŽ’è¡Œæ¦œ 我们在这里展示了所有模型在Zero-shot场景下,在ä¸æ–‡å’Œè‹±æ–‡å„大类任务上得分的平å‡å€¼ï¼ˆ%),å„ä»»åŠ¡è¯„ä¼°æ‰€ç”¨æŒ‡æ ‡è¯·å‚考[这里](task_zh.md)。 > 注:对于超出模型处ç†é•¿åº¦èƒ½åŠ›çš„文本,å‚考[Lost in the Middle](https://arxiv.org/abs/2307.03172)的观察,我们从文本ä¸é—´è¿›è¡Œæˆªæ–,ä¿æŒå‰åŽéƒ¨åˆ†çš„ä¿¡æ¯ã€‚实验表明,这ç§æˆªæ–æ–¹å¼å¯¹æ¨¡åž‹æ€§èƒ½å½±å“最å°ã€‚ @@ -65,7 +66,8 @@ LongBench包å«13个英文任务ã€5个ä¸æ–‡ä»»åŠ¡å’Œ2个代ç 任务,多数 > 注:å‡è®¾æ¨¡åž‹åœ¨æŸä¸ªä»»åŠ¡çš„特定长度范围内数æ®ä¸Šå¾—分为x,在该任务所有数æ®ä¸Šå¾—分为y,则模型在该长度范围的**相对分数**为(x/y-1)。为了更好比较ä¸åŒæ¨¡åž‹çš„å˜åŒ–趋势,我们在0-4k将所有折线平移至0。 -## 如何在LongBench上评测模型 +<a name="如何在LongBench上评测模型"></a> +## âš™ï¸ å¦‚ä½•åœ¨LongBench上评测模型 #### è½½å…¥æ•°æ® ä½ å¯ä»¥é€šè¿‡Hugging Face datasetsæ¥ä¸‹è½½å¹¶è½½å…¥**LongBench**çš„æ•°æ®ï¼ˆ[🤗 HF Repo](https://huggingface.co/datasets/THUDM/LongBench)): @@ -107,7 +109,8 @@ python eval.py ``` å¯ä»¥åœ¨`result.json`ä¸å¾—到在å„æ•°æ®é›†ä¸Šçš„评测结果。请注æ„,我们在`config/`下æ供了我们总结出æ¥çš„在å„æ•°æ®é›†ä¸Šé€‚åˆçš„è¾“å…¥æ ¼å¼å’Œæœ€å¤§è¾“出长度é™åˆ¶ï¼Œåœ¨è¯„测的时候å¯ä»¥è¿›è¡Œä¿®æ”¹ä»¥æ›´å¥½åœ°é€‚ç”¨ä½ è¦è¯„测的模型,修改åŽåœ¨[pred.py](pred.py)è¯„æµ‹æ—¶ä¼šè‡ªåŠ¨æŒ‰ç…§æ–°çš„æ ¼å¼åŽ»æ•´ç†æ•°æ®å¹¶å¾—到对应的模型输出。 -## 详细评测结果 +<a name="详细评测结果"></a> +## 📊 详细评测结果 下é¢çš„å‡ å¼ è¡¨æ ¼å±•ç¤ºäº†æ¨¡åž‹åœ¨æ‰€æœ‰å任务数æ®é›†ä¸Šçš„Zero-shot评测结果(%),其ä¸çš„ä¸æ–‡æ•°æ®é›†ä»¥â€œzhâ€æ ‡ç¤ºï¼ˆå„ä»»åŠ¡è¯„ä¼°æ‰€ç”¨æŒ‡æ ‡è¯·å‚考[这里](task_zh.md))。 #### å•æ–‡æ¡£QA @@ -176,10 +179,12 @@ python eval.py | ChatGLM2-6B | 3.2 | 2.1 | 5.5 | | ChatGLM2-6B-32k | 77.5 | 2.0 | 62.5 | -## 致谢 +<a name="致谢"></a> +## 📄 致谢 - **LongBench**的部分任务基于之å‰çš„ç ”ç©¶è€…æ出的数æ®é›†æž„建,包括[HotpotQA](https://hotpotqa.github.io/),[2WikiMultihopQA](https://aclanthology.org/2020.coling-main.580/),[Musique](https://arxiv.org/abs/2108.00573),[DuReader](https://github.com/baidu/DuReader),[NarrativeQA](https://arxiv.org/pdf/1712.07040.pdf),[Qasper](https://arxiv.org/pdf/2105.03011.pdf),[GovReport](https://arxiv.org/pdf/2104.02112.pdf),[QMSum](https://arxiv.org/pdf/2104.05938.pdf),[VCSUM](https://arxiv.org/abs/2305.05280),[TriviaQA](https://nlp.cs.washington.edu/triviaqa/),[NQ](https://ai.google.com/research/NaturalQuestions/),[TREC](https://aclanthology.org/C02-1150.pdf),[LSHT](http://tcci.ccf.org.cn/conference/2014/dldoc/evatask6.pdf),[LCC](https://arxiv.org/abs/2306.14893)å’Œ[RepoBench-P](https://arxiv.org/abs/2306.03091)。 -## 引用 +<a name="引用"></a> +## 📠引用 本工作由**THU-KEG**å’Œ**Zhipu AI**å…±åŒå®Œæˆï¼Œç›¸å…³è®ºæ–‡æ£åœ¨æ’°å†™ä¸ï¼Œå±Šæ—¶å°†æ›´æ–°å¼•ç”¨ä¿¡æ¯ï¼Œæ•¬è¯·å…³æ³¨~ 如果您使用Longbench,请一并引用LongBench所基于的数æ®é›†å¯¹åº”的论文,相关引用信æ¯åœ¨[这里](refs/ref.bib)。