Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
the dataset is currently locked, please try again later.
Error code:   LockedDatasetTimeoutError

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

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
Who is Hermann Ii, Count Palatine Of Lotharingia's paternal grandfather?
Passage 1: Adolf I of Lotharingia Adolf I of Lotharingia, count of Keldachgau, Vogt of Deutz from 1008 until 1018, was the son of Hermann I "Pusillus" (the Little Pfalzgraf), count palatine of Lotharingia. He left three sons: Hermann III, Vogt of Deutz in St. Severin (Cologne) und Werden (died 1056); Adolf II of Lotha...
[ "Hezzelin I" ]
2,521
20
4,119
4,139
2wikimqa_e
en
[]
8c17c1259ed0c31bff3ee48ef8a6c4c54469c7769ffbc1c1
Where was the director of film Requiem For Dominic born?
Passage 1: Brian Kennedy (gallery director) Brian Patrick Kennedy (born 5 November 1961) is an Irish-born art museum director who has worked in Ireland and Australia, and now lives and works in the United States. He was the director of the Peabody Essex Museum in Salem for 17 months, resigning December 31, 2020. He wa...
[ "Temesvár" ]
2,873
13
4,309
4,322
2wikimqa_e
en
[]
52150ca076ef6a156239c8fd2cb45983ba9b8cd446312f22
What is the place of birth of Ibrahim Ibn Muhammad's mother?
Passage 1: Marzuban ibn Muhammad ibn Shaddad Marzuban ibn Muhammad ibn Shaddad was a Kurdish ruler, the brother of Lashkari ibn Muhammad. He succeeded his brother to the throne of the Shaddadids in 978. He was incompetent, however, and reigned only until his murder by his younger brother Fadl ibn Muhammad in 985. Sour...
[ "Egypt" ]
3,618
13
5,679
5,692
2wikimqa_e
en
[]
61fa50e62866fbeeffc9822aa76f8f363578e72c1a7436af
Which film has the director died earlier, Kadamba (1983 Film) or Mickey'S Tent Show?
Passage 1: Mickey's Tent Show Mickey's Tent Show is a 1933 short film in Larry Darmour's Mickey McGuire series starring a young Mickey Rooney. Directed by Jesse Duffy, the two-reel short was released to theaters on October 27, 1933 by Post Pictures Corp. Synopsis Mickey and the Gang decide to put on a circus show for ...
[ "Mickey'S Tent Show" ]
2,858
21
4,365
4,386
2wikimqa_e
en
[]
4adca5ba1654b740d1e25c6e73d45aa2f3621537bed9086b
Who was born first, Damien Hétu or Matan Cohen?
Passage 1: Matan Cohen Matan Cohen (born February 8, 1982) is an Israeli musician best known for his work as the guitarist for successful groove/metalcore band Betzefer and the recently reunited melodic death metal band Nail Within. Cohen is also a frequent collaborator of comedy punk rock act Bo La'Bar featuring his N...
[ "Damien Hétu" ]
3,977
14
5,650
5,664
2wikimqa_e
en
[]
3ec0722ff6e0d8361ed2ab093a992915fe5b1ddb10ee39a9
Do director of film Happy Days (1929 Film) and director of film Hero (1982 Film) share the same nationality?
Passage 1: Peter Levin Peter Levin is an American director of film, television and theatre. Career Since 1967, Levin has amassed a large number of credits directing episodic television and television films. Some of his television series credits include Love Is a Many Splendored Thing, James at 15, The Paper Chase, Fam...
[ "no" ]
3,470
26
5,445
5,471
2wikimqa_e
en
[]
16a0130f95804e9b0791a89e2d18e46f611c1620891658b8
Which film has the director who is older than the other, A Hungarian Fairy Tale or The Hero Of My Dreams?
Passage 1: A Hungarian Fairy Tale A Hungarian Fairy Tale (original title: Hol volt, hol nem volt) is a 1987 Hungarian film directed by Gyula Gazdag. Plot Andris is a child living in Budapest. He is conceived when his mother Maria is attracted to a mysterious stranger during a performance of The Magic Flute. The strang...
[ "The Hero Of My Dreams" ]
2,951
24
4,666
4,690
2wikimqa_e
en
[]
6e020fda91702d5ab63283c032fc436f3a6b7fd6c568aba7
Are both Flying Fifty-Five and Approaching Midnight from the same country?
Passage 1: Nancy Burne Nancy Burne (23 December 1907 – 25 March 1954) was an English stage and film actress.Born in Chorlton, Lancashire, she began her film career at British International Pictures, starring alongside comedians such as Gene Gerrard, Stanley Lupino and Will Hay. Most of her subsequent screen appearances...
[ "no" ]
2,258
15
3,443
3,458
2wikimqa_e
en
[]
7a0b2aa530cd3c6c74154e334e96c8aae27f68fa12d65bb1
What is the place of birth of Anne Elizabeth Rector's husband?
Passage 1: Anne Elizabeth Rector Anne Elizabeth Rector (June 26, 1899 – February 17, 1970) was an American artist. Rector was the daughter of Enoch J. Rector and she attended the Art Students League of New York studying under John French Sloan. Ann also studied landscape painting under Andrew Dasburg. She married Edmun...
[ "Jersey City" ]
3,648
14
5,041
5,055
2wikimqa_e
en
[]
14387a7ce67635d6f5c75fd29b6d3344758a8be64311ea6e
Was Bronisław Dembowski or Carlo Delle Piane born first?
Passage 1: Paolo Delle Piane Paolo Delle Piane (born 1 May 1964 in Bologna) is a retired Italian racing driver. See also Motorsport in Italy Passage 2: Wesley Barresi Wesley Barresi (born 3 May 1984) is a South African born first-class and Netherlands international cricketer. He is a right-handed wicket keeper-batsman...
[ "Bronisław Dembowski" ]
3,074
16
4,407
4,423
2wikimqa_e
en
[]
8e33b783534c90d43c07617f4106a5056cb93ba21758b91c
End of preview.

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_base token 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 datasets library

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:

  1. Detects available LongBench JSONL files.
  2. Validates task names against the known LongBench task list.
  3. Reads each JSONL file line by line.
  4. Validates JSON syntax and row object type.
  5. Normalizes all original fields into a consistent Hugging Face schema.
  6. Adds input_tokens, context_tokens, and total_tokens with cl100k_base.
  7. Preserves the original LongBench fields.
  8. Converts each task into a typed Hugging Face Dataset.
  9. Writes each task as Parquet under data/<config>/test-*.parquet.
  10. Generates this dataset card dynamically from the detected files and statistics.
  11. Generates dataset_infos.json and build_metadata.json.
  12. Optionally creates the Hugging Face dataset repository.
  13. Uploads the generated repository folder to the Hugging Face Hub.
  14. 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
-

Paper for GinkgoQ/LongBench