# THUDM/LongWriter

[ICLR 2025] LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs

Repository: https://github.com/THUDM/LongWriter
Canonical: https://ross.abutalabs.com/products/longwriter
Language: Python
License: Apache-2.0
License Family: permissive
Topics: fine-tuning, llm, long-context, long-text
Last push: 2025-06-24T06:41:41+00:00

## Health v2 (maintenance only)
Score: 35/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 28, release rhythm 35, longevity 53
- inputs: {"age_days": 751, "days_push": 435, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1875, forks 182 (observed 2026-08-28T04:05:47.622498+00:00)

## What it is
LongWriter is a research project from Tsinghua's THUDM group providing fine-tuned LLMs (based on GLM-4-9B and Llama-3.1-8B) plus training and inference code that enable generating 10,000+ word outputs from long-context models. It includes the LongWriter-6k dataset, the AgentWrite planning method, and LongWriter-Zero, an RL-trained variant.

## Use cases
- generate 10000-word documents with an llm
- write long-form reports or travel guides in one shot
- fine-tune a model to produce very long coherent outputs
- deploy a chatbot that writes ultra-long text fast with vllm
- train an llm for long-text generation with reinforcement learning
- evaluate models on long-form writing benchmarks

## When to choose
- you need single-pass generation of very long documents (10k+ words)
- you want to fine-tune or reproduce long-output LLM research
- you need open-weight 8-9B models specialized for long-form writing

## When to avoid
- you only need short or medium-length responses
- you want a hosted API rather than self-hosting open models
- you lack GPU resources for 9B-32B model inference or training

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, llm-training, machine-learning, nlp
- domain: large-language-models, artificial-intelligence
- platform: python
- tags: long-context, long-form-generation, fine-tuning, agentwrite, glm4, llama3, rl-training, huggingface, natural-language-processing, gpu, linux

## Member repositories
- THUDM/LongWriter (main) score 35

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:47.622498+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:14:45.715760+00:00, confidence not recorded.
  - readme: https://github.com/THUDM/LongWriter (fetched 2026-08-28T04:05:47.622498+00:00, sha 90bb753e606a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
