longbench-write-eval
LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs — Bai et al. (2024) (arXiv:2408.07055, 2024)
What this evaluates
Evaluates an LLM's ability to generate ultra-long, coherent, and high-quality text (up to 20k words) while strictly adhering to explicit length constraints. It probes long-context generation capabilities, structural coherence over extended outputs, and instruction-following for length requirements.
Datasets
Metrics
Sq (Quality Score) (primary) — range: [0, 100]
- Overall quality score rated on a 0-100 scale, aggregating sub-dimensions (Relevance, Accuracy, Coherence, Clarity, Breadth and Depth, Reading Experience). Higher values indicate better generation quality.
Sl (Length Score) — range: [0, 100]
- Score measuring adherence to the required output length constraint, rated on a 0-100 scale. Evaluated separately across four output length brackets: [0, 500), [500, 2k), [2k, 4k), [4k, 20k).
Input / output format
Input: A writing prompt specifying a topic and a required output length (e.g., 'Write a 20,000-word article about...').
Output: A single continuous text generation of arbitrary length.
Scoring recipe
# For each sample in LongBench-Write test set:
predictions = model.generate(prompt)
gold_length = extract_required_length(prompt)
actual_length = count_words(predictions)
# Quality & Length scores (0-100) are obtained via human/LLM annotation per sub-dimension
sq = compute_quality_score(predictions)
sl = compute_length_adherence_score(predictions, gold_length)
# Aggregate by length bracket
bracket = assign_bracket(actual_length)
record(sq, sl, actual_length, bracket)
# Final metric: mean Sq and Sl per bracket, plus overall mean
overall_sq = mean(sq for all samples)
overall_sl = mean(sl for all samples)
Common pitfalls
- Models frequently truncate outputs well before the required length, especially beyond 4k words.
- Quality scores (Sq) often degrade significantly in longer brackets due to coherence loss, even when length is met.
- Length constraints in prompts are sometimes ignored or misinterpreted, leading to severe under-generation.
Evidence (verbatim from paper)
Table 7: Evaluation results on English samples in LongBench-Write.
Citation
@misc{bai2024longwriter,
title={LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs},
author={Bai et al. (2024)},
year={2024},
note={arXiv:2408.07055}
}
1---2name: longbench-write-eval3description: Evaluates an LLM's ability to generate ultra-long, coherent, and high-quality text (up to 20k words) while strictly adhering to explicit length constraints. It probes long-context generation capabilities, structural coherence over extended outputs, and instruction-following for length requirements. Use when the user wants to benchmark on LongBench-Write, or asks about evaluating this task. Reports Sq (Quality Score).4---56# longbench-write-eval78> LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs — Bai et al. (2024) (arXiv:2408.07055, 2024)910## What this evaluates1112Evaluates an LLM's ability to generate ultra-long, coherent, and high-quality text (up to 20k words) while strictly adhering to explicit length constraints. It probes long-context generation capabilities, structural coherence over extended outputs, and instruction-following for length requirements.1314## Datasets1516- **LongBench-Write** — total ?; splits: test (-1); repo https://github.com/THUDM/LongWriter1718## Metrics1920- `Sq (Quality Score)` **(primary)** — range: [0, 100]21 - Overall quality score rated on a 0-100 scale, aggregating sub-dimensions (Relevance, Accuracy, Coherence, Clarity, Breadth and Depth, Reading Experience). Higher values indicate better generation quality.22- `Sl (Length Score)` — range: [0, 100]23 - Score measuring adherence to the required output length constraint, rated on a 0-100 scale. Evaluated separately across four output length brackets: [0, 500), [500, 2k), [2k, 4k), [4k, 20k).2425## Input / output format2627**Input**: A writing prompt specifying a topic and a required output length (e.g., 'Write a 20,000-word article about...').2829**Output**: A single continuous text generation of arbitrary length.3031## Scoring recipe3233```python34# For each sample in LongBench-Write test set:35predictions = model.generate(prompt)36gold_length = extract_required_length(prompt)37actual_length = count_words(predictions)3839# Quality & Length scores (0-100) are obtained via human/LLM annotation per sub-dimension40sq = compute_quality_score(predictions)41sl = compute_length_adherence_score(predictions, gold_length)4243# Aggregate by length bracket44bracket = assign_bracket(actual_length)45record(sq, sl, actual_length, bracket)4647# Final metric: mean Sq and Sl per bracket, plus overall mean48overall_sq = mean(sq for all samples)49overall_sl = mean(sl for all samples)50```5152## Common pitfalls5354- Models frequently truncate outputs well before the required length, especially beyond 4k words.55- Quality scores (Sq) often degrade significantly in longer brackets due to coherence loss, even when length is met.56- Length constraints in prompts are sometimes ignored or misinterpreted, leading to severe under-generation.5758## Evidence (verbatim from paper)5960> Table 7: Evaluation results on English samples in LongBench-Write. 6162<table><tr><td rowspan="2"></td><td colspan="3">Overall</td><td colspan="2">[0, 500)</td><td colspan="2">[500, 2k)</td><td colspan="2">[2k, 4k)</td><td colspan="2">[4k, 20k)</td></tr><tr><td>S̅</td><td>Sl</td><td>Sq</td><td>Sl</td><td>Sq</td><td>Sl</td><td>Sq</td><td>Sl</td><td>Sq</td><td>Sl</td><td>Sq</td></tr>6364## Citation6566```bibtex67@misc{bai2024longwriter,68 title={LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs},69 author={Bai et al. (2024)},70 year={2024},71 note={arXiv:2408.07055}72}73```7475- arXiv: 2408.07055