input string | context string | answers list | length int32 | input_tokens int32 | context_tokens int32 | total_tokens int32 | dataset string | language string | all_classes list | _id string |
|---|---|---|---|---|---|---|---|---|---|---|
Where was the wife of Francis I Rákóczi born? | Passage 1:
Waldrada of Lotharingia
Waldrada was the mistress, and later the wife, of Lothair II of Lotharingia.
Biography
Waldrada's family origin is uncertain. The prolific 19th-century French writer Baron Ernouf suggested that Waldrada was of noble Gallo-Roman descent, sister of Thietgaud, the bishop of Trier, and n... | [
"Ozalj"
] | 4,696 | 14 | 7,061 | 7,075 | 2wikimqa | en | [] | 41ac2a4beb0af8f58d01863a62b90692f7c7d74b5e3a58d9 |
Who is Sobe (Sister Of Saint Anne)'s grandchild? | Passage 1:
Jim Ramel Kjellgren
Jim Love Ramel Kjellgren, (born 18 July 1987) is a Swedish actor. He is the son of Lotta Ramel and Johan H:son Kjellgren and the grandchild of Povel Ramel. He is perhaps best known as the character Jonte in the SVT series Eva & Adam, he reprised the role in the film Eva & Adam – fyra föde... | [
"John the Baptist"
] | 4,776 | 15 | 6,879 | 6,894 | 2wikimqa | en | [] | 3924e4ac5039ce3fadda49604bfcb0f5238af81774616e53 |
Where does the director of film Man At Bath work at? | Passage 1:
Jason Moore (director)
Jason Moore (born October 22, 1970) is an American director of film, theatre and television.
Life and career
Jason Moore was born in Fayetteville, Arkansas, and studied at Northwestern University. Moore's Broadway career began as a resident director of Les Misérables at the Imperial T... | [
"Cahiers du cinéma"
] | 4,274 | 12 | 6,292 | 6,304 | 2wikimqa | en | [] | 2c952e3e1ca394df975103b3135b3c38e0ee16e25d860258 |
Do both Beauty And The Bad Man and Wild Child (Film) films have the directors from the same country? | Passage 1:
Betty Hall
Beatrice Perin Barker Hall (March 18, 1921 – April 26, 2018) was an American politician from the state of New Hampshire. Hall served in the New Hampshire House of Representatives for a total of 28 years, serving non-consecutively from 1970 until 2008.
Hall grew up in New York City, where she atten... | [
"no"
] | 8,125 | 22 | 10,947 | 10,969 | 2wikimqa | en | [] | aec83da1f2faf6ec8badfd53d632f525c9ef2090d99d1c6c |
What is the date of birth of William Paulet, 3Rd Marquess Of Winchester's father? | Passage 1:
Henry, Lord Paulet
Lord Henry Paulet (1602–1672) was an English courtier who sat briefly in the House of Commons in the 2nd Parliament of Charles I, from February to June 1626.
Paulet was a son of William Paulet, 4th Marquess of Winchester. On 6 March 1618, he was admitted to Peterhouse, Cambridge. He was c... | [
"1510"
] | 4,621 | 23 | 7,108 | 7,131 | 2wikimqa | en | [] | 4b28d517ce1c1e3cfec9282ca7b212c1cb87c254781d7c86 |
Who is Edward Watson, Viscount Sondes's paternal grandfather? | Passage 1:
Edward Watson, Viscount Sondes
Edward Watson, Viscount Sondes (3 July 1686 – 20 March 1722) of Lees Court, Sheldwich, Kent, and Park Place, London, was a British Whig politician who sat in the House of Commons between 1708 and 1722.Watson was the eldest son of Lewis Watson, 1st Earl of Rockingham and Catheri... | [
"Edward Watson"
] | 4,625 | 14 | 7,428 | 7,442 | 2wikimqa | en | [] | 81cd47ec621f2228d8bb4ec351ffd6b23d23107e5b287ffb |
What is the date of death of Humphrey De Bohun, 7Th Earl Of Hereford's father? | "Passage 1:\nHenry de Bohun\nSir Henry de Bohun (died 23 June 1314) was an English knight, of Anglo-(...TRUNCATED) | [
"16 September 1360"
] | 5,001 | 23 | 7,357 | 7,380 | 2wikimqa | en | [] | 048e82b64b5651b74d452db7151c2110a718128dfd12a774 |
Who is Helmichis's father-in-law? | "Passage 1:\nBill Dundee\nWilliam Cruickshanks (born 24 October 1943) is a retired Scottish-born Aus(...TRUNCATED) | [
"Cunimund"
] | 7,639 | 10 | 10,870 | 10,880 | 2wikimqa | en | [] | c8fd8db4d295aef41a9434299a8eeffb9af5e2bbcde4f13a |
Where did Helena Carroll's father study? | "Passage 1:\nDonnie Elbert\nDonnie Elbert (May 25, 1936 – January 26, 1989) was an American soul s(...TRUNCATED) | [
"St Patrick's College"
] | 3,964 | 8 | 5,762 | 5,770 | 2wikimqa | en | [] | 4db5bcd1d49fce674507d9128850eb71b808b7dc4246e882 |
Where does the director of film Wine Of Morning work at? | "Passage 1:\nDana Blankstein\nDana Blankstein-Cohen (born March 3, 1981) is the executive director o(...TRUNCATED) | [
"Bob Jones University"
] | 5,162 | 12 | 7,367 | 7,379 | 2wikimqa | en | [] | be97290f663a83ba27007dd262ca2a6072c9156f775a24ad |
LongBench
Dataset Summary
LongBench is a bilingual, multitask benchmark for evaluating long-context understanding in large language models. It covers long-text application scenarios including single-document question answering, multi-document question answering, summarization, few-shot learning, synthetic long-context tasks, and code completion.
This Hugging Face dataset repository repackages locally downloaded LongBench JSONL files into a clean, typed, data-only Hugging Face dataset layout with one configuration per task. The goal of this repackaging is ease of use, reproducibility, dataset viewer compatibility, efficient loading, and convenient downstream evaluation. The dataset content, task design, and original benchmark are attributed to the LongBench authors and the THUDM LongBench project.
This repository keeps the LongBench records in their original task-level shape while publishing them as typed Parquet configs. The split is always test; the configuration name is the LongBench task name. That means the benchmark can be loaded with plain load_dataset(...) calls, without the legacy dataset script or a manual data.zip step.
The language metadata above is intentionally limited to Hub-valid values. Row-level LongBench labels are preserved in the data and include natural languages (en, zh) plus code labels (python, java, csharp) for the completion tasks.
This repackaging also adds token counts to every row: input_tokens, context_tokens, and total_tokens, computed with cl100k_base. LongBench is specifically about long-context behavior, so the added counts make it easier to filter by real prompt size, inspect outliers, and compare tasks without guessing from the original mixed length field.
Original Source and Attribution
- Original project: https://github.com/THUDM/LongBench
- Paper: https://arxiv.org/abs/2308.14508
- Original authors: Yushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu, Jiankai Tang, Zhidian Huang, Zhengxiao Du, Xiao Liu, Aohan Zeng, Lei Hou, Yuxiao Dong, Jie Tang, and Juanzi Li.
- This repository:
GinkgoQ/LongBench - Packaging contribution: typed Parquet configs, Hub-valid metadata, local build metadata, and per-row
cl100k_basetoken counts. - Attribution note: the benchmark design and source records remain LongBench.
Dataset Structure
Each LongBench task is exposed as a separate Hugging Face configuration. Every configuration has a single test split.
Schema
| Field | Type | Description |
|---|---|---|
input |
string |
The model-facing question, prompt, instruction, query, or task input. |
context |
string |
The long-context document, passage set, dialogue, code context, or retrieved evidence. |
answers |
list[string] |
Gold reference answer or answer candidates. |
length |
int32 |
Source-provided context length metadata. |
input_tokens |
int32 |
Number of cl100k_base tokens in input. Added by this repackaging. |
context_tokens |
int32 |
Number of cl100k_base tokens in context. Added by this repackaging. |
total_tokens |
int32 |
Number of cl100k_base tokens in input plus context, counted with one newline separator when input is non-empty. Added by this repackaging. |
dataset |
string |
Original dataset/task label from LongBench. |
language |
string |
Source-provided language label. |
all_classes |
list[string] |
Candidate class labels when applicable. Empty for tasks where this is not used. |
_id |
string |
Original example identifier, preserved when available. |
Configurations
| Configuration | Task Group | Examples | Languages | Mean Source Length | Mean Tokens | Max Tokens |
|---|---|---|---|---|---|---|
narrativeqa |
Single-Document QA | 200 | en |
18404.94 | 29790.89 | 65293 |
qasper |
Single-Document QA | 200 | en |
3618.7 | 4932.52 | 21129 |
multifieldqa_en |
Single-Document QA | 150 | en |
4558.7 | 6951.12 | 14962 |
multifieldqa_zh |
Single-Document QA | 200 | zh |
6700.68 | 7296.32 | 14962 |
hotpotqa |
Multi-Document QA | 200 | en |
9149.22 | 12812.86 | 16346 |
2wikimqa |
Multi-Document QA | 200 | en |
4885.31 | 7133.24 | 16356 |
musique |
Multi-Document QA | 200 | en |
11017.66 | 15595.57 | 16353 |
dureader |
Multi-Document QA | 200 | zh |
15768.04 | 17605.0 | 32255 |
gov_report |
Summarization | 200 | en |
8169.36 | 10242.25 | 51394 |
qmsum |
Summarization | 200 | en |
10545.94 | 13868.7 | 30389 |
multi_news |
Summarization | 200 | en |
2113.49 | 2609.06 | 13935 |
vcsum |
Summarization | 200 | zh |
15147.02 | 16896.71 | 49027 |
trec |
Few-Shot Learning | 200 | en |
5176.36 | 6768.22 | 11382 |
triviaqa |
Few-Shot Learning | 200 | en |
8209.3 | 11771.0 | 23349 |
samsum |
Few-Shot Learning | 200 | en |
6258.35 | 9155.56 | 17981 |
lsht |
Few-Shot Learning | 200 | zh |
22332.62 | 26322.06 | 51727 |
passage_count |
Synthetic Tasks | 200 | en |
11140.59 | 14898.67 | 28965 |
passage_retrieval_en |
Synthetic Tasks | 200 | en |
9287.97 | 12471.94 | 15188 |
passage_retrieval_zh |
Synthetic Tasks | 200 | zh |
6745.15 | 7765.06 | 10736 |
lcc |
Code Completion | 500 | csharp, java, python |
1235.28 | 3165.98 | 30150 |
repobench-p |
Code Completion | 500 | java, python |
4205.93 | 10813.41 | 39128 |
qasper_e |
LongBench-E | 224 | en |
4620.48 | 6218.5 | 21129 |
multifieldqa_en_e |
LongBench-E | 150 | en |
4558.7 | 6951.12 | 14962 |
hotpotqa_e |
LongBench-E | 300 | en |
6657.96 | 9470.88 | 16329 |
2wikimqa_e |
LongBench-E | 300 | en |
6146.54 | 8874.2 | 16333 |
gov_report_e |
LongBench-E | 300 | en |
7140.79 | 8160.53 | 27686 |
multi_news_e |
LongBench-E | 294 | en |
5999.31 | 7883.37 | 38322 |
trec_e |
LongBench-E | 300 | en |
6259.26 | 8181.84 | 17185 |
triviaqa_e |
LongBench-E | 300 | en |
6684.6 | 9693.12 | 36228 |
samsum_e |
LongBench-E | 300 | en |
6170.48 | 9035.07 | 18223 |
passage_count_e |
LongBench-E | 300 | en |
6117.3 | 8232.71 | 22952 |
passage_retrieval_en_e |
LongBench-E | 300 | en |
6115.38 | 8185.44 | 14490 |
lcc_e |
LongBench-E | 300 | csharp, java, python |
5546.3 | 13516.84 | 49200 |
repobench-p_e |
LongBench-E | 300 | java, python |
6067.31 | 15312.48 | 41008 |
Task Groups
Single-Document QA
- Configurations:
narrativeqa,qasper,multifieldqa_en,multifieldqa_zh - Examples: 750
Multi-Document QA
- Configurations:
hotpotqa,2wikimqa,musique,dureader - Examples: 800
Summarization
- Configurations:
gov_report,qmsum,multi_news,vcsum - Examples: 800
Few-Shot Learning
- Configurations:
trec,triviaqa,samsum,lsht - Examples: 800
Synthetic Tasks
- Configurations:
passage_count,passage_retrieval_en,passage_retrieval_zh - Examples: 600
Code Completion
- Configurations:
lcc,repobench-p - Examples: 1000
LongBench-E
- Configurations:
qasper_e,multifieldqa_en_e,hotpotqa_e,2wikimqa_e,gov_report_e,multi_news_e,trec_e,triviaqa_e,samsum_e,passage_count_e,passage_retrieval_en_e,lcc_e,repobench-p_e - Examples: 3668
Languages
Row-level labels: csharp, en, java, python, zh
Hub metadata labels: code, en, zh
Code labels preserved in rows: csharp, java, python
Source Dataset Labels
2wikimqa, 2wikimqa_e, dureader, gov_report, gov_report_e, hotpotqa, hotpotqa_e, lcc, lcc_e, lsht, multi_news, multi_news_e, multifieldqa_en, multifieldqa_en_e, multifieldqa_zh, musique, narrativeqa, passage_count, passage_count_e, passage_retrieval_en, passage_retrieval_en_e, passage_retrieval_zh, qasper, qasper_e, qmsum, repobench-p, repobench-p_e, samsum, samsum_e, trec, trec_e, triviaqa, triviaqa_e, vcsum
Token Counts
Token counts are generated during packaging with cl100k_base:
input_tokens: tokens in the task input or question.context_tokens: tokens in the long context.total_tokens: tokens in the combined input/context prompt.
Across this build, the mean total_tokens is 10450.43 and the largest row has 65293 tokens.
Loading
Load one task:
from datasets import load_dataset
dataset = load_dataset("GinkgoQ/LongBench", "narrativeqa", split="test")
print(dataset)
print(dataset[0])
Load multiple tasks:
from datasets import load_dataset
tasks = [
"narrativeqa",
"qasper",
"multifieldqa_en",
"multifieldqa_zh",
"hotpotqa",
"2wikimqa",
"musique",
"dureader",
"gov_report",
"qmsum",
"multi_news",
"vcsum",
"trec",
"triviaqa",
"samsum",
"lsht",
"passage_count",
"passage_retrieval_en",
"passage_retrieval_zh",
"lcc",
"repobench-p",
"qasper_e",
"multifieldqa_en_e",
"hotpotqa_e",
"2wikimqa_e",
"gov_report_e",
"multi_news_e",
"trec_e",
"triviaqa_e",
"samsum_e",
"passage_count_e",
"passage_retrieval_en_e",
"lcc_e",
"repobench-p_e"
]
datasets_by_task = {
task: load_dataset("GinkgoQ/LongBench", task, split="test")
for task in tasks
}
Load all available configurations dynamically:
from datasets import get_dataset_config_names, load_dataset
repo_id = "GinkgoQ/LongBench"
configs = get_dataset_config_names(repo_id)
datasets_by_task = {
config: load_dataset(repo_id, config, split="test")
for config in configs
}
Example Record
{
"input": "...",
"context": "...",
"answers": ["..."],
"length": 12345,
"input_tokens": 12,
"context_tokens": 6789,
"total_tokens": 6802,
"dataset": "narrativeqa",
"language": "en",
"all_classes": [],
"_id": "..."
}
Intended Use
This dataset is intended for:
- Long-context language model evaluation
- Benchmarking retrieval-augmented and long-context systems
- Comparing performance across long-document QA, multi-document QA, summarization, classification, synthetic reasoning, and code-completion tasks
- Reproducible evaluation workflows using the Hugging Face
datasetslibrary
Out-of-Scope Use
This dataset should not be used as the sole evidence for claims about general model safety, factuality, robustness, legal compliance, medical reliability, or deployment readiness. It is an evaluation benchmark and should be combined with domain-specific tests when used for production model assessment.
Data Fields
input
The model-facing user query, prompt, question, task instruction, or completion prefix.
context
The long context provided to the model. Depending on the task, this may contain documents, passages, reports, dialogue, retrieved evidence, or source code.
answers
Reference answer list. Some tasks may include multiple valid answers.
length
Source-provided length metadata.
input_tokens
Number of cl100k_base tokens in input, added by this packaging script.
context_tokens
Number of cl100k_base tokens in context, added by this packaging script.
total_tokens
Number of cl100k_base tokens in the combined input/context prompt. When input is non-empty, the counter uses input + "\n" + context; otherwise it counts context.
dataset
Original dataset or task label.
language
Source-provided language metadata.
all_classes
Candidate labels for classification-style tasks. Empty when not applicable.
_id
Original example identifier when available. If an identifier was missing in a local source row, this build pipeline generated a deterministic fallback identifier using the task name and row index.
Build Details
This repository was generated automatically from local JSONL files using a validation and conversion pipeline.
- Build timestamp UTC:
2026-05-24T08:44:19.240990+00:00 - Source directory:
/home/arman/project/LongBench/LongBench_data/data - Number of configurations: 34
- Total examples: 8418
- File format: Parquet
- Split:
test - Schema: fixed typed schema shared by all configurations
- Validation mode:
strict - Max shard size:
500MB - Token count method:
cl100k_base
Processing Pipeline
The build pipeline performs the following steps:
- Detects available LongBench JSONL files.
- Validates task names against the known LongBench task list.
- Reads each JSONL file line by line.
- Validates JSON syntax and row object type.
- Normalizes all original fields into a consistent Hugging Face schema.
- Adds
input_tokens,context_tokens, andtotal_tokenswithcl100k_base. - Preserves the original LongBench fields.
- Converts each task into a typed Hugging Face
Dataset. - Writes each task as Parquet under
data/<config>/test-*.parquet. - Generates this dataset card dynamically from the detected files and statistics.
- Generates
dataset_infos.jsonandbuild_metadata.json. - Optionally creates the Hugging Face dataset repository.
- Uploads the generated repository folder to the Hugging Face Hub.
- Optionally performs a remote smoke test with
load_dataset.
Validation Notes
The build script supports strict and non-strict modes.
In strict mode, the script fails if required fields are missing, if input or context are empty, if length is negative, or if list-like fields cannot be normalized.
In non-strict mode, the script preserves maximum compatibility by filling missing optional values with deterministic defaults where possible.
Citation
If you use this repackaged dataset, cite the original LongBench paper:
@article{bai2023longbench,
title={LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding},
author={Bai, Yushi and Lv, Xin and Zhang, Jiajie and Lyu, Hongchang and Tang, Jiankai and Huang, Zhidian and Du, Zhengxiao and Liu, Xiao and Zeng, Aohan and Hou, Lei and Dong, Yuxiao and Tang, Jie and Li, Juanzi},
journal={arXiv preprint arXiv:2308.14508},
year={2023}
}
License
This repository uses the license metadata apache-2.0. Users should verify licensing and redistribution requirements against the original LongBench project and any upstream datasets included in LongBench before public redistribution or commercial usage.
Acknowledgements
All benchmark design, task construction, and source data attribution belong to the LongBench authors and the THUDM LongBench project. This repository only repackages the source files for easier loading and use through the Hugging Face Hub.
- Downloads last month
- 172